fix(ci): recover missing Rust GitHub releases and improve crates.io publish resilience#263
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #261
🚨 Solution Draft FailedThe automated solution draft encountered an error: 🤖 Models used:
📎 Failure log uploaded as Gist (1538KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
🤖 AI Work Session Started Starting automated work session at 2026-04-13T15:38:22.250Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
…io publish resilience Root cause: When crates.io publish succeeds but verification fails due to propagation delay, retries get "already exists" error. While handled in current code, the GitHub release was never created because the publish step exited with failure. On the next CI run, changelog fragments were already consumed and the tag existed, so the release check saw "already released" and skipped everything — leaving the version published on crates.io but with no GitHub release. Changes: - rust.yml: Check crates.io API + GitHub release existence (not just git tags) when deciding whether to release. This enables recovery when a version is published on crates.io but the GitHub release is missing. - publish-to-crates.mjs: Check crates.io API before each retry attempt to detect if a prior attempt actually succeeded despite verification failure. Increase verification delay to 20s and retries to 5 for better resilience against crates.io propagation delays. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Case study documenting timeline, root causes, and fixes for the missing Rust GitHub release issue - Rust changelog fragment for the CI/CD recovery mechanism fix - JS changeset for publish script improvements Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When changelog fragments exist for a new version bump, the previous version's missing GitHub release would never be created. This adds a recovery step that runs BEFORE the fragment check to detect and create any missing GitHub releases for the current Cargo.toml version. This handles the v0.9.2 case: tag exists, crate on crates.io, but GitHub release was never created due to prior CI failures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $6.031028📊 Context and tokens usage:Claude Opus 4.6:
Total: (150.0K + 8.4M cached) input tokens, 24.5K output tokens, $5.768872 cost Claude Haiku 4.5: Total: (121.2K + 699.2K cached) input tokens, 8.2K / 64K (13%) output tokens, $0.262156 cost 🤖 Models used:
📎 Log file uploaded as Gist (3089KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit d1e3515.
Summary
Fixes #261 - Rust CI/CD was publishing crates to crates.io but failing to create GitHub releases with badges.
Root Cause
A chain of CI/CD failures led to v0.9.2 being published on crates.io but without a GitHub release:
CARGO_REGISTRY_TOKENnot set (fixed in PR fix(ci): use CARGO_TOKEN as fallback for CARGO_REGISTRY_TOKEN in Rust CI/CD #258)The core problem: no recovery mechanism for partially-completed releases. Once the CI pipeline failed after publishing to crates.io but before creating a GitHub release, there was no way to recover on the next run.
Changes
.github/workflows/rust.ymlscripts/publish-to-crates.mjsdocs/case-studies/issue-261/Changelog fragments
How to verify
rust-v0.9.2GitHub release with crates.io badgeTest plan
validate-changeset.mjs)rust-get-bump-type.mjs)check-file-size.mjs)This PR was created to solve issue #261