Skip to content

Let the release commit pass its own gates: README status version and the release-prep check - #158

Merged
NSchatz merged 1 commit into
mainfrom
release-commit-passes-its-own-gates
Sep 25, 2026
Merged

NSchatz merged 1 commit into
mainfrom
release-commit-passes-its-own-gates

Conversation

@NSchatz

@NSchatz NSchatz commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

The release pipeline runs pnpm test on Changesets' version commit before it publishes. That commit moves package.json to 0.1.0 and consumes every pending changeset, and two gates asserted the pre-bump state only, so the 0.1.0 publish would have stopped in the Verify step.

Repro (before this change)

On a copy of #157's head:

pnpm install --frozen-lockfile
pnpm run version       # package.json -> 0.1.0, changesets consumed
# commit that result locally, as the Version Packages PR would
pnpm exec vitest run test/readme-standard.test.ts test/release/release-prep.test.ts
# 4 failed | 80 passed:
#   readme-standard: "names the version package.json declares" (README still says 0.0.18)
#   release-prep: "passes the release-prep check", "AC7: ... 0.0.x band", "AC3: ... resolve to exactly 0.1.0"

The change

  • scripts/sync-readme-version.ts rewrites the one **Version X.Y.Z** marker in README ## Status to package.json's version, and refuses (exit 1) when the section or a single marker is missing. The version script runs it after sync-version.mjs and formats README.md, so the bump and the README line land in the same commit, as the VERSION constant already does. test/scripts/sync-readme-version.test.ts drives it on README text built in the test and checks this README carries exactly one marker.
  • README ## Status now states what 0.1.0 promises, in the wording the README standard requires from 0.1.0 on ("settled and safe to depend on"), plus the stability terms: exported names and warning codes kept stable, the warning registry additions-only, and below 1.0 a breaking change bumps the minor with its migration in the changelog. Before the bump it reads "From 0.1.0 ..."; after the sync it reads "Version 0.1.0 ... From 0.1.0 ...".
  • test/release/release-prep.test.ts recognizes the release commit: the manifest at the prepared version AND nothing pending (isReleaseCommit). Only there are the three prepare-state checks skipped. A premature bump (0.1.0 with the set pending) and a set removed without the bump both still fail, each pinned by a synthetic case; the section and inventory-enumeration checks run in every state.

Proof after the change

The same simulation on #157 plus this branch: pnpm run version prints sync-readme-version: README.md -> 0.1.0, and pnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm attw exits 0 on the simulated version commit (121 files, 4945 passed, 8 skipped). On this branch as pushed, pnpm typecheck, pnpm lint and the three affected test files pass (96 tests).

No change under src/. Independent of #157 in content; either can merge first.

https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9

…the release-prep check

The release pipeline runs pnpm test on Changesets' version commit before
it publishes. That commit moves package.json to 0.1.0 and consumes every
pending changeset, and two gates asserted the pre-bump state only, so
the 0.1.0 publish would have stopped in the Verify step:

- test/readme-standard.test.ts requires README `## Status` to name the
  version package.json declares, and at 0.1.0 and later to state the
  API is "settled and safe to depend on". Changesets rewrites only
  package.json, so the README still said 0.0.18.
- test/release/release-prep.test.ts asserted a 0.0.x manifest and a
  pending set resolving to 0.1.0, both false on the version commit.

Fix:

- scripts/sync-readme-version.ts rewrites the one `**Version X.Y.Z**`
  marker in `## Status` to package.json's version, and refuses when the
  section or a single marker is missing. The `version` script runs it
  after sync-version.mjs, so the bump and the README line land in the
  same commit, as the VERSION constant already does. Tested on README
  text built in the test, plus a check that this README has exactly one
  marker.
- README `## Status` now states what 0.1.0 promises ("settled and safe
  to depend on", stable exports and codes, breaking changes bump the
  minor below 1.0), which is true after the bump and says "from 0.1.0"
  before it.
- The release-prep check recognizes the release commit: the manifest at
  the prepared version AND nothing pending. Only there are the three
  prepare-state checks skipped. A premature bump and a set removed
  without the bump both still fail, pinned by synthetic cases; the
  section and inventory-enumeration checks run in every state.

Claude-Session: https://claude.ai/code/session_01U24bnHKNxQWMxmfN7ny7w9
@NSchatz
NSchatz enabled auto-merge (squash) September 25, 2026 20:46
@NSchatz
NSchatz merged commit 012b14e into main Sep 25, 2026
12 checks passed
@NSchatz
NSchatz deleted the release-commit-passes-its-own-gates branch September 25, 2026 20:50
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