Skip to content

Commit 09ace05

Browse files
authored
Merge branch 'main' into feat/linear-processor-feedback
2 parents b58fd6e + 3a06c20 commit 09ace05

5 files changed

Lines changed: 35 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitignore

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Handler entry tests: `cdk/test/handlers/orchestrate-task.test.ts`, `create-task.
4545
- **`MISE_EXPERIMENTAL=1`** — required for namespaced tasks like **`mise //cdk:build`** (see [CONTRIBUTING.md](./CONTRIBUTING.md)).
4646
- **`mise run build`** runs **`//agent:quality`** before CDK — the deployed image bundles **`agent/`**; agent changes belong in that tree.
4747
- **`prek install`** fails if Git **`core.hooksPath`** is set — another hook manager owns hooks; see [CONTRIBUTING.md](./CONTRIBUTING.md).
48+
- **Editing on `main` directly** — ALWAYS create a worktree with a feature branch for changes, even trivial ones. Main should stay clean; all work flows through worktree → branch → PR → merge.
4849
- **Git worktrees**`node_modules/` and `agent/.venv/` are per-tree (not shared). Run **`mise run install`** in each new worktree before building. All CDK path references (`__dirname`-relative) and mise `config_roots` resolve correctly without extra setup.
4950

5051
### Tech stack

cdk/src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ const stack = new AgentStack(
4242
},
4343
);
4444

45+
const computeType = app.node.tryGetContext('compute_type') ?? 'agentcore';
46+
Tags.of(stack).add('compute_type', computeType);
47+
4548
const githubTagKeys = [
4649
'sha',
4750
'ref',

cdk/test/stacks/github-tags.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ function synthWithTags(context: Record<string, string> = {}): Template {
4444
env: { account: '123456789012', region: 'us-east-1' },
4545
});
4646

47+
const computeType = app.node.tryGetContext('compute_type') ?? 'agentcore';
48+
Tags.of(stack).add('compute_type', computeType);
49+
4750
const githubTagKeys = [
4851
'sha', 'ref', 'ref-type', 'actor', 'head-ref',
4952
'base-ref', 'pr-number', 'run-id', 'run-attempt',
@@ -125,4 +128,25 @@ describe('github:* resource tags', () => {
125128
expect(tags.find(t => t.Key === 'github:sha')!.Value).toBe('none');
126129
expect(tags.find(t => t.Key === 'github:head-ref')!.Value).toBe('none');
127130
});
131+
132+
test('compute_type tag defaults to "agentcore" when no context is provided', () => {
133+
const resources = templateWithDefaults.findResources('AWS::DynamoDB::Table');
134+
const firstResource = Object.values(resources)[0];
135+
const tags: Array<{ Key: string; Value: string }> = firstResource?.Properties?.Tags ?? [];
136+
137+
const tag = tags.find(t => t.Key === 'compute_type');
138+
expect(tag).toBeDefined();
139+
expect(tag!.Value).toBe('agentcore');
140+
});
141+
142+
test('compute_type tag reflects context value when provided', () => {
143+
const template = synthWithTags({ compute_type: 'ecs' });
144+
const resources = template.findResources('AWS::DynamoDB::Table');
145+
const firstResource = Object.values(resources)[0];
146+
const tags: Array<{ Key: string; Value: string }> = firstResource?.Properties?.Tags ?? [];
147+
148+
const tag = tags.find(t => t.Key === 'compute_type');
149+
expect(tag).toBeDefined();
150+
expect(tag!.Value).toBe('ecs');
151+
});
128152
});

0 commit comments

Comments
 (0)