Repository navigation
fix(release): keep peer ranges in lockstep, and refuse to tag an unverified commit - #1281
Merged
Merged
Conversation
…rified commit Closes the two in-repo halves of #1255. The third (a trusted-publisher record for @intentius/chant-k8s-client) is done on npmjs.com — the package published 0.33.1 over OIDC with provenance in #1278. ## Peer ranges (#1255.2) `just release` rewrites the `@intentius/*` peer ranges alongside `.version`, added in #411 because ranges frozen at an old version break clean installs. `release-lexicon` only ever set `.version`, so a single-lexicon patch that needed a newer core silently shipped a stale range. The two recipes cannot share a literal. A whole-repo release moves everything together, so `^$next` is correct there; a single-lexicon patch leaves core where it is, so its ranges must track the CURRENT core and github-lexicon versions. Pinning them to `$next` would demand a core that does not exist. The test asserts that mechanism rather than a shared value. `release-lexicon` also now runs `npm install --package-lock-only` and commits the result, for the same reason `just release` has since #1094 — a bump that leaves the lockfile recording the old version is the same defect. ## Preflight (#1255.3) Both recipes pushed the bump commit straight to main, bypassing branch protection, so the commit a release tag pointed at was one CI never ran — and nothing checked that the code being released was green either. scripts/release-preflight.sh, shared by both recipes rather than copied into each, refuses to tag unless the tree is clean, HEAD matches its pushed branch, and the `chant` run for that commit concluded success. `release` additionally requires main, since it pushes main explicitly. `CHANT_RELEASE_SKIP_PREFLIGHT=1` is the emergency opt-out. Exercised every path: dirty tree, wrong branch, unpushed HEAD, CI still running (caught main mid-run and printed the run URL), and the opt-out. The guards live in release-wiring.test.ts, where #1255 said they belong, and each was verified to fail by reverting the fix it covers. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA
3 tasks
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.
Closes the two in-repo halves of #1255.
Item 1 (a trusted-publisher record for
@intentius/chant-k8s-client) is already done — it was configured on npmjs.com during #1278, and the package published 0.33.1 over OIDC with a provenance attestation. Its checkbox can be ticked.2 — peer ranges in
release-lexiconjust releaserewrites the@intentius/*peer ranges alongside.version(#411, because ranges frozen at an old version break clean installs).release-lexicononly set.version, so a single-lexicon patch needing a newer core silently shipped a stale range.The two recipes cannot share a literal, which is the interesting part:
just release^$nextjust release-lexicon^<current core version>Pinning
release-lexicon's range to$nextwould demand a core version that does not exist. The test asserts the mechanism (that it readspackages/core/package.json, and that it does not use$next) rather than comparing a shared value.release-lexiconnow also runsnpm install --package-lock-onlyand commits it, for the same reasonjust releasehas since #1094.3 — preflight before tagging
Both recipes pushed the bump commit straight to main:
So a release tag could point at a commit CI never ran, and nothing verified the released code was green.
scripts/release-preflight.sh— one implementation shared by both recipes, not copied into each — refuses to tag unless:HEADmatches its pushed branchchantrun for that commit concludedsuccessreleaseadditionally requires being onmain, since it pushesmainexplicitly.release-lexiconallows any branch but still requires pushed + green. Emergency opt-out:CHANT_RELEASE_SKIP_PREFLIGHT=1.Testing
Every preflight path exercised by hand: dirty tree, wrong branch, unpushed HEAD, CI still running, and the opt-out. The in-progress case caught
mainmid-run and printed the run URL:Guards added to
release-wiring.test.ts, where #1255 said they belong. Each was verified to actually fail by reverting the fix it covers — 9 pass, and reverting either half drops one.🤖 Generated with Claude Code
https://claude.ai/code/session_01JTHr67zuAjGHJAX6gF5tYA