Skip to content

ci: fail the crates.io release when a planned crate is missing - #66

Merged
setoelkahfi merged 2 commits into
developmentfrom
feature/verify-crates-publish
Nov 20, 2026
Merged

setoelkahfi merged 2 commits into
developmentfrom
feature/verify-crates-publish

Conversation

@setoelkahfi

Copy link
Copy Markdown
Collaborator

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 logged info published and 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 with scripts/crates-io-published.py --wait, and fails the job if any is missing. The error message points at the fix: dispatch the workflow with publish=true and the same release_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. actionlint passes on the workflow.

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>

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread .github/workflows/release-sdk-rust.yml Resolved
@setoelkahfi setoelkahfi self-assigned this Nov 20, 2026
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>

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@setoelkahfi
setoelkahfi merged commit ee97fd0 into development Nov 20, 2026
5 checks passed
@setoelkahfi
setoelkahfi deleted the feature/verify-crates-publish branch November 20, 2026 07:13
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.

2 participants