Repository navigation
fix(release): refuse re-dispatch of published versions + delete dead channel default (#2674, #2675) (dev twin) - #2717
Conversation
…channel default (#2674, #2675) admit now asks whether v<version> already carries a published GitHub Release and refuses the run when it does. A published release is immutable and this pipeline can no longer replay one: reconcile-release-assets.sh expects the current 20/28/36-asset delivery fanout while every pre-fanout release carries 12 that can never be extended, and reconcile-channel-manifests.sh derives a deterministic midnight-UTC released_at that no longer cmp-matches the wall-clock timestamps already on main. Both failures land AFTER the release is published and locked, so the rule "always allocate a fresh version" is now enforced mechanically instead of remembered. Drafts stay admissible so an interrupted run can finish the release it opened, and an ambiguous API answer fails closed. admit gains contents:read (never write) for the query. publish loses its dead CHANNEL="${INPUT_CHANNEL:-}" -> stable default. admit already exits 1 on an empty/unknown channel and both callers always pass one; had it ever fired, publish would have uploaded a 36-asset stable inventory that finalize aborts on, leaving a published-but-unfinalized release. publish now reads inputs.channel raw, exactly like finalize and manifests, and the stale "workflow_run defaults to stable" comment is gone. Tests: the reconcile-release-assets fake now returns TWO attestations per published tarball (GitHub's in-toto immutable-release attestation first, ours second), pinning that production selects by predicate type rather than by position or count. release-docs pins the new admit guard and the channel wiring. Refs #2674, #2675
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Refs #2674, #2675 (closed by the main twin, #2716).
Relationship to #2716
.github/workflows/release-publish.ymlandscripts/release-docs.test.tsare byte-identical to the main twin (verified withcmpagainst the twin commit before pushing). This PR adds one file the main half deliberately does not carry.What changed (same as #2716)
Release ops rule: never re-dispatch a version that already has a published release (pre-fanout releases are non-replayable) #2674 —
admitrefuses re-dispatch of an already published version. New step queriesgh api repos/<repo>/releases/tags/v<version>; adraft == falserelease fails the job with::error ::release-replay.publishedciting "published releases are non-replayable — allocate a fresh version" and Release ops rule: never re-dispatch a version that already has a published release (pre-fanout releases are non-replayable) #2674. Drafts stay admissible (an interrupted run must finish the release it opened), 404 is the normal fresh-version path, and any other API answer fails closed.admitmoves frompermissions: {}tocontents: read— never write, which still starts atpublish.release-publish.yml: delete the dead CHANNEL=stable default in publish; pin multi-attestation and CAS-loop coverage #2675 — dead
CHANNEL=stabledefault deleted frompublish.CHANNEL="${INPUT_CHANNEL:-}"→ stable was unreachable (admitexits 1 on an empty/unknown channel), its comment was stale, and it was the only reader ofsteps.meta.outputs.channel.publishnow readsinputs.channelraw likefinalize/manifests; the step is renamedResolve version + asset inventory.Dev-only addition: multi-attestation shape (#2675)
scripts/reconcile-release-assets.test.ts— the fakeghreturned exactly one attestation per tarball, so nothing pinned the real API shape. A published tarball actually carries two attestations for the same digest: GitHub's in-toto immutable-release attestation (minted when the release is locked) and ours. Production tolerates it —scripts/release-native-predicate.shreusable_control_sha()usesfirst(.[] | select(predicateType == ...)), i.e. selection by predicate type — but no test would have caught a regression to positional selection.[github-immutable-release, ours]for every non---bundletarball verification, GitHub's first, and records each batch size in state.selects our release predicate when GitHub also attests the immutable releaseasserts a clean run plusattestationBatchSizesof[2 x 8](4 platforms x 2 passes: unfiltered, then certificate-filtered).--bundledelivery path still returns exactly one, matching the script'slength == 1assertion on the descriptor equality check.Mutation-checked: rewriting
first(.[] | select(...))tofirst(.[0] | select(...))inrelease-native-predicate.shmakes the new test fail (exit 4). Reverted before commit.CAS-loop coverage: not added, recorded here
The manifests job's inline fetch/detach/reconcile/add/commit/push loop with 403-vs-non-fast-forward failure classification is workflow-inline shell with no testable seam — no script under
scripts/owns it (reconcile-channel-manifests.sh, which is tested, is only the reconcile step the loop calls). Covering it would require extracting the classifier into a new script and wiring it through theRUNNER_TEMPcopy the loop already performs for the reconciler, identically on both branches — a substantive refactor of the most fragile job in the release path, out of scope here. Deferred deliberately rather than faked, per #2675.Validation
actionlintran withshellcheckpresent, so the new inline shell was shellcheck-clean.