Skip to content

fix(release): gate crates.io publish behind the release job + idempotent version guard; regen skill bundle - #492

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/release-ordering-crates-guard
Oct 21, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/release-ordering-crates-guard

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

What

Fixes the release-pipeline ordering defect that broke the v1.4.3 attempt (run 39598031043), plus the content drift that actually blocked the release job.

Root cause (run 39598031043)

  • publish-crates declared no needs and raced the build/gate jobs: niubash-runtime 1.4.3 and niubash 1.4.3 were uploaded to crates.io before/while the gates ran — a half-released state (crates.io carried 1.4.3, the GitHub Release page never existed).
  • The actual blocker for the release job was skill-bundle's golden check: the release: 1.4.3 prep — version bump 1.4.2 → 1.4.3 (lock self-entries in lockstep, pins untouched) #488 version bump (55cc901) never regenerated the bundle, so skills/niubash/SKILL.md still said "Bundle version: niubash 1.4.2" → DRIFT skills/niubash/SKILL.md → FAIL → release skipped by the dependency graph.

Changes

  1. Job graph reorder — publish-crates now declares
    needs: [release, build-windows, build-linux, build-macos, journey, perfbudget, skill-bundle]:
    build all platforms → journey + per-asset timing gates → GitHub Release with all assets → crates.io publish last. A publish failure can no longer race the gates or precede the release page.
  2. crates.io idempotency guard — a new guard step queries https://crates.io/api/v1/crates/<name> (3 retries, proper User-Agent) and skips any crate whose max_version equals this release's version (with a ::notice), so re-running a release whose versions already ship stays green. API lookup failure is fail-open to cargo publish's existing idempotency verdicts ("already uploaded" / "already exists on crates.io index"), which remain as backstop.
  3. skill bundle regenerated — skills/niubash/SKILL.md bundle version now reads 1.4.3; python scripts/generate-skill.py --check passes.
  4. Stale comment refresh ("rubash 1.0.0 is not on crates.io" → rubash 1.4.2 is on crates.io and the dep carries version = "1.4.1").

Verification

  • generate-skill.py --check: PASS locally.
  • Guard logic dry-run against the live crates.io API: both niubash-runtime and niubash report max_version=1.4.3 → guard emits skip (this is exactly the re-tag scenario the guard is for).
  • Workflow YAML parses (10 jobs); step if: conditions verified.

…ent version guard; regen skill bundle

Run 39598031043 post-mortem:
- publish-crates declared no needs and raced the build/gate jobs;
  niubash-runtime 1.4.3 and niubash 1.4.3 reached crates.io while the
  GitHub Release page never existed (the real blocker was skill-bundle's
  golden check failing, which skipped the release job).
- publish-crates now needs [release, build-windows, build-linux,
  build-macos, journey, perfbudget, skill-bundle]: build all platforms ->
  journey + per-asset timing gates -> GitHub Release with all assets ->
  and only then crates.io. A publish failure can no longer race the gates
  or precede the release page.
- New guard step queries the crates.io API before publishing and skips
  any crate whose max_version equals this release's version (::notice),
  so re-running a release whose versions already ship stays green; an API
  lookup failure falls back to cargo publish's own idempotency verdicts.
- skills/niubash/SKILL.md: the #488 version bump never regenerated the
  bundle, so "Bundle version" still said 1.4.2 - the drift that actually
  failed the golden check and blocked the release job. Regenerated.
- Refreshed the stale "rubash 1.0.0 is not on crates.io" publish comment.
@caomengxuan666
caomengxuan666 merged commit 3a58357 into master Oct 21, 2026
10 of 11 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/release-ordering-crates-guard branch October 21, 2026 15:19
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.

1 participant