Add release preflight checks for upstream sync, remote tags, and published packages#579
Open
petemoore wants to merge 1 commit into
Open
Add release preflight checks for upstream sync, remote tags, and published packages#579petemoore wants to merge 1 commit into
petemoore wants to merge 1 commit into
Conversation
57197d5 to
a038f4f
Compare
…ished packages The preflight checks now verify that: - Local HEAD matches the upstream main branch - The release tag doesn't exist on the remote (not just locally) - The version hasn't already been published to npm, PyPI, or crates.io Also updates the partial-failure recovery guidance in RELEASING.md to reflect that none of the registries allow re-publishing, and recommends incrementing the patch version rather than trying to re-run failed steps. Fixes json-e#577, fixes json-e#578, fixes json-e#580. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a038f4f to
eb7caaf
Compare
djmitche
reviewed
Apr 4, 2026
| fi | ||
|
|
||
| # Package not already published to registries | ||
| if command -v curl >/dev/null 2>&1; then |
Contributor
There was a problem hiding this comment.
I think command here is checking if curl is installed? Isn't that check done above?
Contributor
There was a problem hiding this comment.
In fact aren't all of those checks redundant?
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
mainHEAD matches the upstream remote'smainbefore releasing, catching ahead/behind/diverged states that would causegit pushto fail mid-release (after packages are already published)git ls-remote --tags), not just locally, preventing conflicts whengit push --follow-tagsrunsFixes #577, fixes #578, fixes #580.
Test plan
These checks require running
./release.shonmainwith release tooling installed. Registry URL checks were verified independently viacurl:./release.sh 99.99.99on a checkout that is behind upstream — should report the mismatch with both commit hashesv99.99.99, run./release.sh 99.99.99— should report "already exists locally"v4.8.2tag is caught as existing on remote:./release.sh 4.8.2curl -sf https://registry.npmjs.org/json-e/4.8.2returns success for existing version, failure for 99.99.99curl -sf https://pypi.org/pypi/json-e/4.8.2/jsonreturns success for existing version, failure for 99.99.99curl -sf https://crates.io/api/v1/crates/json-e/4.8.2returns success for existing version, failure for 99.99.99🤖 Generated with Claude Code