Skip to content

Second review fixes: one tagsOf, guarded DEFAULT_SHAPE, clearer names - #40

Merged
sodre merged 5 commits into
mainfrom
fix/review-2
Nov 14, 2026
Merged

sodre merged 5 commits into
mainfrom
fix/review-2

Conversation

@sodre

@sodre sodre commented Nov 14, 2026

Copy link
Copy Markdown
Member

Fixes from the second code review, over 6dbaa56..c137ee0. Review findings #5 (shapeOf spells out its defaults) and #6 (the hand-launch copies the fleet options) were accepted as they are and not changed here.

Summary

One commit per finding. Behaviour doesn't change.

 functions/launcher.js
-  tagsOf(tags)  -> { 'ci-runner:capacity': ..., 'ci-runner:vcpus': ... }
+  tagsOf(tags)  -> { capacity: ..., vcpus: ... }     # strips the prefix, like the webhook's and notifier's
-  t['ci-runner:capacity'], t['ci-runner:vcpus']
+  t.capacity, t.vcpus

 functions/webhook.js
-  // The shape of an instance launched before the shape tags.
+  // The shape of an instance or task launched before the shape tags, which
+  // swap repair re-queues with it. The launcher carries a copy.
-  const wire = { label: shape.capacity, vcpus, arch }
+  const queuedShape = { label: shape.capacity, vcpus, arch }   # comment on `label` kept

 test/conventions.test.js
+  test: launcher, webhook and notifier tagsOf are identical
+  test: launcher and webhook DEFAULT_SHAPE are identical

 test/launcher.test.js
-  fakeEcs({ running })
+  fakeEcs({ tasks })       # some are told to stop, or STOPPED

Evidence

  • Before: make test: 144 pass. The launcher's tagsOf and the webhook's DEFAULT_SHAPE could drift apart with no test failing.
    After: make test: 146 pass, and it passes after each commit. If any tagsOf copy or either DEFAULT_SHAPE differs, the new tests fail. make build: 74295 of 1048576 bytes.

Merge Danger

Door: two-way

Renames and comments, plus the launcher reading the same two tags under their stripped keys. Revert to roll back. Nothing needs deploying.

Blast Radius: launcher-budgets

If the launcher reads capacity/vcpus wrongly, the vCPU budgets count wrong. The existing budget tests cover both the EC2 and Fargate paths.

🤖 Generated with Claude Code

sodre and others added 5 commits November 14, 2026 01:08
… notifier's

The three copies are now guarded as identical in test/conventions.test.js.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Swap repair depends on the two agreeing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…it to both

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…TOPPED

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sodre
sodre merged commit ad08d24 into main Nov 14, 2026
2 checks passed
@sodre
sodre deleted the fix/review-2 branch November 14, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant