Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ const partitionPlugin = {
'no-hardcoded-arn-partition': {
meta: {
type: 'problem',
docs: { description: 'Disallow hardcoded arn:aws: partition in ARN construction. Use arnPrefix(region) instead.' },
docs: {
description: 'Disallow hardcoded arn:aws: partition in ARN construction. Use arnPrefix(region) instead.',
},
schema: [],
},
create(context) {
function checkForHardcodedArn(node, value) {
if (/arn:aws:/.test(value)) {
context.report({ node, message: 'Hardcoded "arn:aws:" detected. Use arnPrefix(region) from src/cli/aws/partition.ts for multi-partition support.' });
context.report({
node,
message:
'Hardcoded "arn:aws:" detected. Use arnPrefix(region) from src/cli/aws/partition.ts for multi-partition support.',
});
}
}
return {
Expand All @@ -34,7 +40,10 @@ const partitionPlugin = {
'no-hardcoded-endpoint-tld': {
meta: {
type: 'problem',
docs: { description: 'Disallow hardcoded amazonaws.com in endpoint URL construction. Use serviceEndpoint() or dnsSuffix() instead.' },
docs: {
description:
'Disallow hardcoded amazonaws.com in endpoint URL construction. Use serviceEndpoint() or dnsSuffix() instead.',
},
schema: [],
},
create(context) {
Expand All @@ -49,13 +58,21 @@ const partitionPlugin = {
TemplateLiteral(node) {
for (const quasi of node.quasis) {
if (hasHardcodedEndpoint(quasi.value.raw)) {
context.report({ node, message: 'Hardcoded ".amazonaws.com" in template literal. Use serviceEndpoint() or dnsSuffix() from src/cli/aws/partition.ts for multi-partition support.' });
context.report({
node,
message:
'Hardcoded ".amazonaws.com" in template literal. Use serviceEndpoint() or dnsSuffix() from src/cli/aws/partition.ts for multi-partition support.',
});
}
}
},
Literal(node) {
if (typeof node.value === 'string' && hasHardcodedEndpointWithRegion(node.value)) {
context.report({ node, message: 'Hardcoded endpoint with region detected. Use serviceEndpoint() or dnsSuffix() from src/cli/aws/partition.ts for multi-partition support.' });
context.report({
node,
message:
'Hardcoded endpoint with region detected. Use serviceEndpoint() or dnsSuffix() from src/cli/aws/partition.ts for multi-partition support.',
});
}
},
};
Expand Down
11 changes: 0 additions & 11 deletions src/cli/tui/components/ResourceGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
);
}

export function getTargetDisplayText(target: AgentCoreGatewayTarget): string {

Check warning on line 112 in src/cli/tui/components/ResourceGraph.tsx

View workflow job for this annotation

GitHub Actions / lint

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
if (target.targetType === 'mcpServer' && target.endpoint) return target.endpoint;
if (target.targetType === 'apiGateway' && target.apiGateway)
return `${target.apiGateway.restApiId}/${target.apiGateway.stage}`;
Expand Down Expand Up @@ -420,17 +420,6 @@
<Text color="magenta">{ICONS.gateway}</Text> gateway{' '}
<Text color="red">{ICONS['policy-engine']}</Text> policy engine
</Text>
{resourceStatuses && resourceStatuses.length > 0 && (
<Box flexDirection="column" marginTop={1}>
<Text>
<Text color="green">[Deployed]</Text>
<Text color="gray"> live in AWS</Text>
{' '}
<Text color="yellow">[Local only]</Text>
<Text color="gray"> not yet deployed</Text>
</Text>
</Box>
)}
</Box>
</Box>
);
Expand Down
31 changes: 0 additions & 31 deletions src/cli/tui/components/__tests__/ResourceGraph.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,37 +262,6 @@ describe('ResourceGraph', () => {
expect(lastFrame()).toContain('deploy');
});

it('renders deployment state legend when resourceStatuses provided', () => {
const project = {
...baseProject,
runtimes: [{ name: 'my-agent' }],
} as unknown as AgentCoreProjectSpec;

const resourceStatuses: ResourceStatusEntry[] = [
{ resourceType: 'agent', name: 'my-agent', deploymentState: 'deployed' },
];

const { lastFrame } = render(<ResourceGraph project={project} resourceStatuses={resourceStatuses} />);

expect(lastFrame()).toContain('[Deployed]');
expect(lastFrame()).toContain('live in AWS');
expect(lastFrame()).toContain('[Local only]');
expect(lastFrame()).toContain('not yet deployed');
});

it('does not render deployment state legend when no resourceStatuses', () => {
const project = {
...baseProject,
runtimes: [{ name: 'my-agent' }],
} as unknown as AgentCoreProjectSpec;

const { lastFrame } = render(<ResourceGraph project={project} />);

// Should have the base legend but not the deployment state legend
expect(lastFrame()).toContain('agent');
expect(lastFrame()).not.toContain('[Deployed]');
});

it('renders removed credentials in Removed Locally section', () => {
const resourceStatuses: ResourceStatusEntry[] = [
{
Expand Down
Loading