fix(release): allow registry version to be ahead of package.json in pre-push#3836
Closed
bokelley wants to merge 2 commits into
Closed
fix(release): allow registry version to be ahead of package.json in pre-push#3836bokelley wants to merge 2 commits into
bokelley wants to merge 2 commits into
Conversation
…re-push The version-sync hook required package.json, published_version, and adcp_version to all match exactly. The forward-merge release process (#3807) keeps package.json --ours on main, so during the window between cutting a version and bumping the dev package, registry is ahead of package.json by design — and pre-push failed for every contributor. Now: registry must be at or ahead of package.json. Still fails the genuine bug-modes (registry behind, fields missing, registry fields disagreeing). Pre-release tags fall back to strict equality so beta windows lockstep. Also adds the missing published_version: "3.0.4" so both registry fields agree (May 2026 state). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add --strict flag to verify-version-sync. In strict mode, registry MUST equal package.json exactly (release-time invariant after changeset version + build:schemas --release). Default (pre-push) mode keeps the relaxed registry-at-or-ahead semantics. - Wire `verify-version-sync -- --strict` into the `version` script so a failed release step is caught before tagging. - Drop dead test code: run() was copying the script to two locations and only executing one. - Clean up tmpdir fixtures via test.after. - Add tests for: numeric (not lexicographic) version compare, 0.x.y handling, asymmetric drift (one field ahead, other behind), strict mode pass/fail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
49e4a84 to
6cfed9c
Compare
Contributor
Author
|
Superseded by #3834 which landed the same relaxation while this PR was in review. Closing as redundant. The strict-mode + unit tests this PR adds are still useful and could be revived as a follow-on, but they're not blocking anything right now. |
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.
Summary
Pre-push has been failing for every contributor since the 3.0.4 forward-merge (May 2026). The hook required
package.json,published_version, andadcp_versionto all be exactly equal, but the forward-merge release process (#3807) deliberately keepspackage.json --ourson main — so during the window between cutting a version and bumping the dev package, registry is ahead ofpackage.jsonby design. Discovered while trying to push #3829.What changed
scripts/verify-version-sync.cjs: relax strict-equality to "registry at or ahead ofpackage.json" using a small X.Y.Z comparator. Still fails the genuine bug-modes:package.json(forgot to bump registry on release)published_versionoradcp_versionmissingstatic/schemas/source/index.json: add the missingpublished_version: "3.0.4"so both registry fields agree (main currently hasadcp_version: "3.0.4"but nopublished_version— the hook flagged that even before this PR).tests/verify-version-sync.test.cjs: 8 unit tests covering forward-merge window, the bug-modes, and pre-release tag handling.testscript.Why this matters beyond #3829
This blocks every local push from main, not just mine. The current admin-merge workflow on GitHub bypasses the hook (which is why main keeps drifting), but anyone pushing a feature branch from local hits this wall.
Test plan
node --test tests/verify-version-sync.test.cjs— 8/8 pass🤖 Generated with Claude Code