Skip to content

fix(release): keep peer ranges in lockstep, and refuse to tag an unverified commit - #1281

Merged
lex00 merged 1 commit into
mainfrom
fix/1255-release-preflight
Jul 31, 2026
Merged

lex00 merged 1 commit into
mainfrom
fix/1255-release-preflight

Conversation

@lex00

@lex00 lex00 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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-lexicon

just release rewrites the @intentius/* peer ranges alongside .version (#411, because ranges frozen at an old version break clean installs). release-lexicon only 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:

moves core? correct peer range
just release yes, in lockstep ^$next
just release-lexicon no ^<current core version>

Pinning release-lexicon's range to $next would demand a core version that does not exist. The test asserts the mechanism (that it reads packages/core/package.json, and that it does not use $next) rather than comparing a shared value.

release-lexicon now also runs npm install --package-lock-only and commits it, for the same reason just release has since #1094.

3 — preflight before tagging

Both recipes pushed the bump commit straight to main:

remote: Bypassed rule violations for refs/heads/main:
remote: - 3 of 3 required status checks are expected.

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:

  • the working tree is clean (untracked files ignored; they aren't in the commit)
  • HEAD matches its pushed branch
  • the chant run for that commit concluded success

release additionally requires being on main, since it pushes main explicitly. release-lexicon allows 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 main mid-run and printed the run URL:

preflight: chant CI is still in_progress for 0ffd8e6b — wait for it.
https://github.com/INTENTIUS/chant/actions/runs/30668070092

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

…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
@lex00
lex00 merged commit c857677 into main Jul 31, 2026
6 checks passed
@lex00
lex00 deleted the fix/1255-release-preflight branch July 31, 2026 23:34
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