FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add release preflight checks for upstream sync, remote tags, and published packages by petemoore · Pull Request #579 · json-e/json-e · GitHub

/ json-e Public

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

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

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 commented Apr 1, 2026
edited
Loading

Copy link
Copy Markdown
Collaborator

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 force-pushed the release-preflight-checks branch 2 times, most recently from 57197d5 to a038f4f Compare April 1, 2026 14:02
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
petemoore force-pushed the release-preflight-checks branch from a038f4f to eb7caaf Compare April 1, 2026 14:05
petemoore marked this pull request as ready for review April 1, 2026 14:13
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
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

In fact aren't all of those checks redundant?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

It was missing from the list, I can add it there instead, good call.

In fact aren't all of those checks redundant?

They just help to keep output clean so if the tool is missing, we don't get additional bogus error messages. Note, the release script reports all startup errors before exiting, rather than exiting after the first error. With curl the checks were positive (if curl -sf ...), so it fails silently either way, i.e. was safe to delete.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Were you going to push an update?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Whoops, pushed now, thanks!

petemoore self-assigned this May 7, 2026
petemoore requested a review from djmitche August 17, 2026 21:05
petemoore force-pushed the release-preflight-checks branch from eb7caaf to bcd2ebf Compare August 18, 2026 10:08
…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 force-pushed the release-preflight-checks branch from bcd2ebf to 53c1c9d Compare August 18, 2026 10:19

Copy link
Copy Markdown
Collaborator Author

Closing this in favour of #591

petemoore closed this Aug 18, 2026
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

Labels

None yet

Projects

None yet

2 participants


Back | FazBrowse Home | New Git URL