fix: release pipeline must always publish version greater than already published#23
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #22
…y published Root cause: publish-crate.rs treated "already exists" on crates.io as success (exit 0), masking the real problem that version-and-commit.rs was not bumping past already-published versions. Changes: - publish-crate.rs: "already exists" is now a failure (exit 1) with clear error - version-and-commit.rs: queries crates.io for max published version and ensures the new version strictly exceeds it before creating a tag - check-release-needed.rs: outputs max_published_version for diagnostics - Added case study documentation and experiment script Closes #22 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 7aad4b5.
Member
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
📎 Log file uploaded as Gist (1712KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Member
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
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
Fixes #22 — The auto-release pipeline was silently accepting "version already exists" on crates.io as success, when it should always publish a version strictly greater than what's already published.
Root Cause
Three interacting bugs in the CI/CD release scripts:
publish-crate.rstreated "already exists" as success (exit 0), masking the real failureversion-and-commit.rsdid not check crates.io for already-published versions — when a git tag existed, it stopped bumping instead of finding the next unpublished versioncheck-release-needed.rsdid not output the max published version from crates.io for diagnostic/coordination purposesChanges
publish-crate.rs: "already exists" is now a hard failure (exit 1) with a clear error message explaining the pipeline must compute a new versionversion-and-commit.rs: Now queries crates.io for the maximum published version and ensures the bumped version strictly exceeds it. If the initial bump produces a version ≤ published, it adjusts tomax_published + 0.0.1. Also checks git tags and crates.io in a loop as a safety netcheck-release-needed.rs: Now outputsmax_published_versionfor downstream diagnostic usedocs/case-studies/issue-22/How It Prevents Recurrence
The fix operates at two levels:
version-and-commit.rsguarantees the new version exceeds all published versions before taggingpublish-crate.rsfails loudly if a version collision somehow still occurs, preventing silent false-positive releasesTest plan
cargo test --all-features)cargo fmtandcargo clippycleancheck-release-needed.rscorrectly reports max published version (0.2.0)version-and-commit.rs --bump-type minorcorrectly produces 0.3.0 (> 0.2.0)version-and-commit.rs --bump-type patchcorrectly produces 0.2.1 (> 0.2.0)🤖 Generated with Claude Code