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
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ describe('resolveConfigBundleComponentKeys', () => {
});

const result = resolveConfigBundleComponentKeys(spec, deployedState, 'target1');
const keys = Object.keys(result.configBundles![0]!.components);
const keys = Object.keys(result.configBundles[0]!.components);
expect(keys).toEqual(['arn:aws:bedrock-agentcore:us-east-1:123:runtime/rt-1']);
});

Expand All @@ -550,7 +550,7 @@ describe('resolveConfigBundleComponentKeys', () => {
});

const result = resolveConfigBundleComponentKeys(spec, deployedState, 'target1');
const keys = Object.keys(result.configBundles![0]!.components);
const keys = Object.keys(result.configBundles[0]!.components);
expect(keys).toEqual(['arn:aws:bedrock-agentcore:us-east-1:123:gateway/gw-1']);
});

Expand All @@ -563,7 +563,7 @@ describe('resolveConfigBundleComponentKeys', () => {
});

const result = resolveConfigBundleComponentKeys(spec, deployedState, 'target1');
const keys = Object.keys(result.configBundles![0]!.components);
const keys = Object.keys(result.configBundles[0]!.components);
expect(keys).toEqual(['arn:mcp:gw:resolved']);
});

Expand All @@ -574,7 +574,7 @@ describe('resolveConfigBundleComponentKeys', () => {
const deployedState = makeDeployedState('target1', { runtimes: {} });

const result = resolveConfigBundleComponentKeys(spec, deployedState, 'target1');
const keys = Object.keys(result.configBundles![0]!.components);
const keys = Object.keys(result.configBundles[0]!.components);
expect(keys).toEqual(['arn:existing:key']);
});

Expand All @@ -585,7 +585,7 @@ describe('resolveConfigBundleComponentKeys', () => {
const deployedState = makeDeployedState('target1', { runtimes: {} });

const result = resolveConfigBundleComponentKeys(spec, deployedState, 'target1');
const keys = Object.keys(result.configBundles![0]!.components);
const keys = Object.keys(result.configBundles[0]!.components);
expect(keys).toEqual(['some-plain-key']);
});

Expand Down Expand Up @@ -629,9 +629,9 @@ describe('resolveConfigBundleComponentKeys', () => {

const result = resolveConfigBundleComponentKeys(spec, deployedState, 'target1');
// Original should still have the placeholder
expect(Object.keys(spec.configBundles![0]!.components)).toEqual(['{{runtime:my-rt}}']);
expect(Object.keys(spec.configBundles[0]!.components)).toEqual(['{{runtime:my-rt}}']);
// Result should have the resolved key
expect(Object.keys(result.configBundles![0]!.components)).toEqual(['arn:resolved']);
expect(Object.keys(result.configBundles[0]!.components)).toEqual(['arn:resolved']);
});

it('prefers HTTP gateway over MCP gateway when both exist with same name', () => {
Expand All @@ -644,7 +644,7 @@ describe('resolveConfigBundleComponentKeys', () => {
});

const result = resolveConfigBundleComponentKeys(spec, deployedState, 'target1');
const keys = Object.keys(result.configBundles![0]!.components);
const keys = Object.keys(result.configBundles[0]!.components);
// HTTP gateway should take precedence (checked first in code)
expect(keys).toEqual(['arn:http:gw']);
});
Expand Down
4 changes: 2 additions & 2 deletions src/cli/primitives/ABTestPrimitive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export class ABTestPrimitive extends BasePrimitive<AddABTestOptions, RemovableAB
return { success: false, error: `AB test "${testName}" not found.` };
}

const removedTest = project.abTests![index]!;
project.abTests!.splice(index, 1);
const removedTest = project.abTests[index]!;
project.abTests.splice(index, 1);

// Cascade: remove auto-created online eval configs for target-based tests
// Only remove eval configs that were auto-created (matching the {testName}_eval_ prefix pattern)
Expand Down
2 changes: 1 addition & 1 deletion src/cli/primitives/ConfigBundlePrimitive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class ConfigBundlePrimitive extends BasePrimitive<AddConfigBundleOptions,
return { success: false, error: `Configuration bundle "${bundleName}" not found.` };
}

project.configBundles!.splice(index, 1);
project.configBundles.splice(index, 1);
await this.writeProjectSpec(project);

return { success: true };
Expand Down
4 changes: 2 additions & 2 deletions src/schema/schemas/primitives/ab-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export type TargetRef = z.infer<typeof TargetRefSchema>;

const ConfigBundleVariantConfigSchema = z.object({
configurationBundle: ConfigurationBundleRefSchema,
target: z.undefined().optional(),
target: z.never().optional(),
});

const TargetVariantConfigSchema = z.object({
configurationBundle: z.undefined().optional(),
configurationBundle: z.never().optional(),
target: TargetRefSchema,
});

Expand Down
Loading