Repository navigation
ci: fail the crates.io release when a planned crate is missing - #66
Conversation
cargo-workspaces 0.4.2 exits 0 even when crates.io rejects an upload. In v1.5.0 the trusted-publishing token expired after four crates and the other four got a 403, yet the job passed. Add a step that checks every crate in the plan against the crates.io index and fails the job if any is absent. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si> Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
There was a problem hiding this comment.
This adds a post-publish verification step to release-sdk-rust.yml that reads plan.json, checks each planned crate/version against the crates.io index via scripts/crates-io-published.py --wait, and fails the job with a recovery hint if any is missing, plus a matching note in the release skill's recovery docs. The approach is sound and the claim that cargo-workspaces 0.4.2 exits 0 despite registry rejections is corroborated publicly (it greps cargo output for success rather than propagating failures). One gap: the safety net only runs when the publish step itself succeeded.
Automated review by siGit Code Review · commit 57aca77 · see the review dashboard
A custom `if` with no status function implies success(), so the verification step was skipped exactly when publish exited nonzero partway through, which is the partial-publish case it exists to catch. Guard with always() so it runs after a failed publish, and gate on the plan step succeeding, since a failed plan leaves count empty and that reads as != '0'. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.10 <noreply@sigit.si> Co-Authored-By: OndeCode v1.1.2 <noreply@ondeinference.com>
There was a problem hiding this comment.
Re-review: the fix from the earlier thread is in. The verify step now gates on always() && steps.plan.outcome == 'success' && steps.plan.outputs.count != '0', so a partial publish (nonzero exit mid-run) still gets checked and the re-run hint, while a failed plan with an empty count no longer slips through the != '0' test. The added comment accurately documents both halves of that condition. Nothing new to flag.
Automated review by siGit Code Review · commit b0291f7 · changes since 57aca77 · see the review dashboard
The crates.io release job can pass while some crates were never published. In the v1.5.0 release the trusted-publishing token expired after four of the eight crates. The last four got
403 Invalid authentication token, but cargo-workspaces 0.4.2 loggedinfo publishedand exited 0, so the job went green. I only noticed because I checked crates.io by hand, then fixed it by dispatching the workflow again on the tag.This adds a step after the publish that reads
plan.json, asks the crates.io index about each planned crate withscripts/crates-io-published.py --wait, and fails the job if any is missing. The error message points at the fix: dispatch the workflow withpublish=trueand the samerelease_tag. The plan then lists only the missing crates and the auth step issues a fresh token.The release skill's recovery section now describes the token expiry.
I ran the step's script locally against a fake plan. With both crates on crates.io it exits 0. With one version that does not exist it prints the error and exits 1.
actionlintpasses on the workflow.