Skip to content

chore(release): catch the three gaps v0.22.0 found - #2108

Merged
robcohen merged 2 commits into
mainfrom
chore/release-preflight-guards
Aug 21, 2026
Merged

robcohen merged 2 commits into
mainfrom
chore/release-preflight-guards

Conversation

@robcohen

Copy link
Copy Markdown
Member

Each of these turned a five-second pre-flight question into a failure
part-way through distributing v0.22.0.

1. A never-published crate now fails pre-flight, not the release

scripts/check-publish-crates.py already kept the CRATES array in sync with
the workspace, and it passed for v0.22.0 — rustledger-returns and
rustledger-budget were both correctly listed. Neither had ever been
published, and trusted publishing cannot create a crate, so the crates.io job
died on the first of them (403 Trusted Publishing tokens do not support creating new crates) and seven dependents cascaded behind it with no matching package. Half the release had already gone out.

--check-registry asks crates.io whether each listed crate exists.
RELEASING.md's pre-flight now runs it. Off by default, so the per-PR run stays
offline and network-independent.

Two things worth noting about the check itself:

  • It sends a User-Agent. crates.io answers 403 without one, which a
    naive status check reads as "exists" — for every crate. I made exactly that
    mistake while diagnosing the failure, and briefly concluded both crates were
    already published.
  • Verified it can report dirty: a bogus crate name comes back absent, two
    real ones do not. A guard that has only ever said "clean" isn't a guard.

2. Channel verification no longer requires the publish run to have succeeded

release-test.yml gated on conclusion == 'success'. At v0.22.0 an expired
COPR token failed one packaging job, the run concluded failure, and the
workflow never fired — so nothing checked whether crates.io and npm were
actually serving the release. That is the question it exists to answer, and
the one you most want answered when a release has gone sideways.

It now runs on failure too. A partial publish produces red channel tests
naming exactly which channels are short, which beats silence. cancelled and
skipped still skip — there is nothing to verify.

3. COPR credentials have a troubleshooting entry

The job builds ~/.config/copr from the COPR_LOGIN / COPR_TOKEN
repository secrets, so renewing the token locally does nothing for CI — a
fact that took reading the workflow to establish while the release was
half-done. The entry names both secrets and uses gh secret set with no
argument, which prompts with hidden input rather than putting the value in
shell history.

Verification

  • check-publish-crates.py passes offline and with --check-registry
    (17/17 crates present), and unpublished() correctly flags a bogus name.
  • actionlint on release-test.yml: 38 shellcheck findings, identical to
    main — none introduced. (They are pre-existing unquoted-variable warnings
    elsewhere in the file.)

🤖 Generated with Claude Code

https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr

Each of these turned a five-second pre-flight question into a failure
part-way through distributing a release.

**A crate that has never been published now fails pre-flight, not the
release.** `check-publish-crates.py` already kept the `CRATES` array in
sync with the workspace, and it passed for v0.22.0 —
`rustledger-returns` and `rustledger-budget` were both correctly listed.
Neither had ever been published, and trusted publishing cannot create a
crate, so the crates.io job died on the first of them and seven
dependents cascaded behind it with `no matching package`. `--check-registry`
asks crates.io whether each listed crate exists; RELEASING.md's pre-flight
runs it. Off by default so the per-PR run stays offline.

The check sends a User-Agent, because crates.io answers 403 without one
and a naive status check reads that as "exists" for every crate. Verified
it reports dirty: a bogus name comes back absent, two real ones do not.

**Release Channel Testing no longer requires the publish run to have
succeeded.** It gated on `conclusion == 'success'`, so an expired COPR
token failed one packaging job, the run concluded failure, and the
workflow never fired — nothing checked whether crates.io and npm were
serving the release, which is the question it exists to answer and the
one you most want answered when a release went sideways. It now runs on
failure too; a partial publish produces red channel tests naming which
channels are short, which beats silence. `cancelled` and `skipped` still
skip, since there is nothing to verify.

**COPR credentials have a troubleshooting entry.** The job builds
`~/.config/copr` from the `COPR_LOGIN` / `COPR_TOKEN` repository secrets,
so renewing the token locally does nothing — a fact that took reading the
workflow to establish. The entry names both secrets and uses `gh secret
set` without arguments, which prompts with hidden input rather than
putting the value in shell history.

The shellcheck findings actionlint reports for release-test.yml are
pre-existing: 38 on main, 38 with this change.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
Copilot AI lite review requested due to automatic review settings August 21, 2026 13:32
@robcohen
robcohen requested a review from a team as a code owner August 21, 2026 13:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the release pipeline by adding pre-flight checks and ensuring post-publish channel verification runs even when the publish workflow fails, addressing failure modes encountered during v0.22.0 distribution.

Changes:

  • Extend scripts/check-publish-crates.py with an optional --check-registry mode to verify all crates in the publish list already exist on crates.io (trusted publishing cannot create new crates).
  • Update release-test.yml to run channel verification when Release Publish concludes with failure (not only success), so partial publishes are validated.
  • Document the new pre-flight step and add troubleshooting guidance for renewing COPR credentials in RELEASING.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
scripts/check-publish-crates.py Adds --check-registry crates.io existence verification to catch never-published crates before release.
RELEASING.md Documents the new pre-flight check and adds COPR secret-renewal troubleshooting steps.
.github/workflows/release-test.yml Expands trigger gating so channel verification runs after failed publish runs (to detect partial distribution).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/release-test.yml Resolved
Comment thread scripts/check-publish-crates.py Resolved
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100% (raw 93%, 170 masked)
Full AST Match 100%
Total Files 811
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
    The headline is the EFFECTIVE rate, after pairs where beanquery
    itself is wrong are masked. raw is the same run with nothing
    masked. A widening gap means the registry grew, not that rledger
    changed.
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

…ent crates.io errors

Both from Copilot's review, and both right.

**The trigger enumerated conclusions instead of excluding them.** The
comment above it said `cancelled` and `skipped` are the ones with nothing
to verify, but the condition listed `success` and `failure` — so
`timed_out`, `action_required` and `neutral` would have skipped channel
verification too. Those are exactly the conclusions most likely to leave a
partial publish behind, which is the case this change exists to cover.
Inverted to match what the comment already claimed.

**`--check-registry` treated any non-404 as fatal.** A 429 or a 502 says
nothing about whether a crate exists, and failing pre-flight on a blip
trains people to ignore the check — worse than not having it. Transient
statuses and connection errors now retry with backoff; a definitive 404
still answers immediately.

Verified by injection rather than by reading: two 503s then success
recovers on the third attempt, a persistent 503 exits after four with the
status named, and a 404 is answered in one attempt without retrying.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr
@robcohen
robcohen merged commit 80fe5bc into main Aug 21, 2026
55 checks passed
@robcohen
robcohen deleted the chore/release-preflight-guards branch August 21, 2026 14:21
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