Skip to content

fix: release pipeline must always publish version greater than already published#23

Merged
konard merged 3 commits into
mainfrom
issue-22-d2a2ebbc5352
Mar 29, 2026
Merged

fix: release pipeline must always publish version greater than already published#23
konard merged 3 commits into
mainfrom
issue-22-d2a2ebbc5352

Conversation

@konard
Copy link
Copy Markdown
Member

@konard konard commented Mar 29, 2026

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:

  1. publish-crate.rs treated "already exists" as success (exit 0), masking the real failure
  2. version-and-commit.rs did not check crates.io for already-published versions — when a git tag existed, it stopped bumping instead of finding the next unpublished version
  3. check-release-needed.rs did not output the max published version from crates.io for diagnostic/coordination purposes

Changes

  • publish-crate.rs: "already exists" is now a hard failure (exit 1) with a clear error message explaining the pipeline must compute a new version
  • version-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 to max_published + 0.0.1. Also checks git tags and crates.io in a loop as a safety net
  • check-release-needed.rs: Now outputs max_published_version for downstream diagnostic use
  • Case study: Full timeline reconstruction and root cause analysis in docs/case-studies/issue-22/
  • Experiment script: Verifies version bumping logic against various published version scenarios

How It Prevents Recurrence

The fix operates at two levels:

  1. Prevention: version-and-commit.rs guarantees the new version exceeds all published versions before tagging
  2. Safety net: publish-crate.rs fails loudly if a version collision somehow still occurs, preventing silent false-positive releases

Test plan

  • All existing tests pass (cargo test --all-features)
  • cargo fmt and cargo clippy clean
  • File size check passes
  • Experiment script validates all version bumping edge cases
  • Manual verification: check-release-needed.rs correctly reports max published version (0.2.0)
  • Manual verification: version-and-commit.rs --bump-type minor correctly produces 0.3.0 (> 0.2.0)
  • Manual verification: version-and-commit.rs --bump-type patch correctly produces 0.2.1 (> 0.2.0)
  • CI pipeline passes on this branch

🤖 Generated with Claude Code

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #22
@konard konard self-assigned this Mar 29, 2026
…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>
@konard konard changed the title [WIP] We should always release version greater than already published fix: release pipeline must always publish version greater than already published Mar 29, 2026
@konard konard marked this pull request as ready for review March 29, 2026 17:52
@konard
Copy link
Copy Markdown
Member Author

konard commented Mar 29, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $5.870597
  • Calculated by Anthropic: $3.562967 USD
  • Difference: $-2.307630 (-39.31%)

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Main model: Claude Opus 4.6 (claude-opus-4-6)
  • Additional models:
    • Claude Haiku 4.5 (claude-haiku-4-5-20251001)

📎 Log file uploaded as Gist (1712KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented Mar 29, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit 9865f04 into main Mar 29, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We should always release version greater than already published

1 participant