feat(bootstrap): keep one deployment target and prune the other - #35
Merged
Conversation
ciaransweet
force-pushed
the
feat/bootstrap-target-choice
branch
2 times, most recently
from
September 8, 2026 15:43
d6a52d2 to
553661c
Compare
Both targets live here, and an instance is meant to keep one. Nothing said which lines were whose, so removing a target meant reading every file and judging each paragraph. A `target:k8s` or `target:aws` marker comment now delimits a block that goes with its target, written in the host file's own comment syntax so both blocks can sit in a valid file. `target:both` marks the third kind: text that only makes sense while the choice is open, such as the sentence telling you to make it. Nothing is rewritten in place, so lines that mixed the two targets had to be split, and a few are simply target-neutral now — a `case` arm matching index sentinels by shape, a mypy invocation that asks for the AWS dependency group only when the stack is there, and prose that named the charts and the stack where it meant "the deployment". No behaviour changes: every marker is a comment. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`./scripts/bootstrap` now asks which target you want before anything else, and `scripts/prune-target` removes the other one: its workflow, its directory under infra/, its dependency groups, its config file in every toolset, and its blocks in the shared files. The surviving target's markers are then unwrapped, so a bootstrapped repo carries no trace of having been a template with a choice in it. Bootstrap re-locks afterwards, since the dependency groups moved and every image build runs `uv sync --frozen`. It also sets the variables that target's deploy reads — MCP_NAMESPACE, or MCP_AWS_INSTANCE and MCP_AWS_REGION — and refuses a target this repo no longer has rather than pruning the one you are on. The prune removes itself and its test last. A repository that has chosen cannot choose again, so the machinery is useful exactly once, and a test asserting things about a target that is gone is worse than no test. Tested by pruning a copy of the repo both ways and reading the result, because what breaks here is not the algorithm but a marker someone forgets to close. Both pruned copies lint, test, and pass their own target's check — `helm lint` one side, a four-shape `cdk synth` with no lookups the other. Closes #28 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ciaransweet
force-pushed
the
feat/bootstrap-target-choice
branch
from
September 8, 2026 15:48
553661c to
c25ee65
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The last phase of #28. This repository carries both deployment targets; an
instance is meant to keep one. Until now nothing removed the other.
./scripts/bootstrapnow asks which target you want before anything else, andscripts/prune-targetremoves the other: its workflow, its directory underinfra/, its dependency groups, its config file in every toolset, and itsblocks in the shared files. Bootstrap then re-locks, since the dependency
groups moved and every image build runs
uv sync --frozen, and sets thevariables that target's deploy reads.
How the shared files are split
A
target:k8sortarget:awsmarker comment delimits a block that goes withits target, written in the host file's own comment syntax so both blocks sit in
a valid file.
target:bothmarks text that only makes sense while the choiceis open. Nothing is rewritten in place: a line mixing the two targets has to be
split first, because a regex that edits half a line is the kind of thing that
silently stops matching.
The kept target's markers are unwrapped afterwards, and the prune removes
itself and its test last, so a bootstrapped repo reads as an ordinary
repository rather than a half-used template.
Breaking change
./scripts/bootstrapprompts for a target, so a non-interactive call thatpassed only a namespace now stops and asks. Pass
--target k8s(oraws) tokeep it non-interactive.
Nothing changes for an already-deployed instance until it runs bootstrap.
Verified
Both targets pruned in a copy of the repo, then linted, tested, and put through
their own check:
helm linton one side, a four-shapecdk synthwith anempty
missingon the other. The tests do the same thing on every run, whichis what catches a marker someone forgets to close.
Closes #28
🤖 Generated with Claude Code