Skip to content

Add release preflight checks for upstream sync, remote tags, and published packages#579

Open
petemoore wants to merge 1 commit into
json-e:mainfrom
petemoore:release-preflight-checks
Open

Add release preflight checks for upstream sync, remote tags, and published packages#579
petemoore wants to merge 1 commit into
json-e:mainfrom
petemoore:release-preflight-checks

Conversation

@petemoore
Copy link
Copy Markdown
Contributor

@petemoore petemoore commented Apr 1, 2026

Summary

  • Verify local main HEAD matches the upstream remote's main before releasing, catching ahead/behind/diverged states that would cause git push to fail mid-release (after packages are already published)
  • Check the release tag on the remote (via git ls-remote --tags), not just locally, preventing conflicts when git push --follow-tags runs
  • Query npm, PyPI, and crates.io registries to verify the version hasn't already been published, catching partial release recovery scenarios where git tags were cleaned up but packages remain on registries
  • Update RELEASING.md partial-failure guidance to recommend bumping the patch version rather than trying to re-run failed steps

Fixes #577, fixes #578, fixes #580.

Test plan

These checks require running ./release.sh on main with release tooling installed. Registry URL checks were verified independently via curl:

  • Run ./release.sh 99.99.99 on a checkout that is behind upstream — should report the mismatch with both commit hashes
  • Create a local tag v99.99.99, run ./release.sh 99.99.99 — should report "already exists locally"
  • Delete local tag, verify the existing v4.8.2 tag is caught as existing on remote: ./release.sh 4.8.2
  • curl -sf https://registry.npmjs.org/json-e/4.8.2 returns success for existing version, failure for 99.99.99
  • curl -sf https://pypi.org/pypi/json-e/4.8.2/json returns success for existing version, failure for 99.99.99
  • curl -sf https://crates.io/api/v1/crates/json-e/4.8.2 returns success for existing version, failure for 99.99.99
  • Verify all errors appear together (not one-at-a-time) when multiple conditions fail

🤖 Generated with Claude Code

@petemoore petemoore force-pushed the release-preflight-checks branch 2 times, most recently from 57197d5 to a038f4f Compare April 1, 2026 14:02
@petemoore petemoore changed the title Check local/remote main sync and remote tags before releasing Add release preflight checks for upstream sync, remote tags, and published packages Apr 1, 2026
…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>
@petemoore petemoore force-pushed the release-preflight-checks branch from a038f4f to eb7caaf Compare April 1, 2026 14:05
@petemoore petemoore marked this pull request as ready for review April 1, 2026 14:13
@petemoore petemoore requested a review from djmitche April 1, 2026 14:13
Comment thread release.sh
fi

# Package not already published to registries
if command -v curl >/dev/null 2>&1; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think command here is checking if curl is installed? Isn't that check done above?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact aren't all of those checks redundant?

@petemoore petemoore self-assigned this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants