Repository navigation
Let the release commit pass its own gates: README status version and the release-prep check - #158
Merged
Merged
Conversation
…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
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 release pipeline runs
pnpm teston Changesets' version commit before it publishes. That commit movespackage.jsonto0.1.0and 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:
The change
scripts/sync-readme-version.tsrewrites the one**Version X.Y.Z**marker in README## Statustopackage.json's version, and refuses (exit 1) when the section or a single marker is missing. Theversionscript runs it aftersync-version.mjsand formatsREADME.md, so the bump and the README line land in the same commit, as theVERSIONconstant already does.test/scripts/sync-readme-version.test.tsdrives it on README text built in the test and checks this README carries exactly one marker.## Statusnow 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 "From0.1.0..."; after the sync it reads "Version 0.1.0 ... From0.1.0...".test/release/release-prep.test.tsrecognizes 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 versionprintssync-readme-version: README.md -> 0.1.0, andpnpm typecheck && pnpm lint && pnpm test && pnpm build && pnpm attwexits 0 on the simulated version commit (121 files, 4945 passed, 8 skipped). On this branch as pushed,pnpm typecheck,pnpm lintand 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