Repository navigation
fix(release): resume package releases from the release tag - #654
Merged
Merged
Conversation
Automatic recovery of an assetless draft dispatched Package Release from the release branch. That run built the tagged tree, but GitHub signs artifact attestations with the run's own ref and commit, so v5.115.0 and v5.116.0 were attested for main's head instead of their tag commits and fail every verifier that pins the tag. - dispatch the resume from the immutable tag ref, as the first dispatch does - refuse branch-ref Package Release runs that would build a candidate - accept a retained candidate only from a run on the exact tag ref and commit - document the tag-bound recovery contract Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…lishing Review follow-ups for the tag-bound resume: - select the Classic validation check by name; each tag-ref attempt adds check runs to the tag commit and could push it off the first page - block automatic recovery after three consecutive failed attempts of any class, since a tag-ref retry cannot pick up fixes from main - restore the retained-candidate proof step name renamed in #580, and test every job and step name the resolver inspects against the workflows - require tag-signer, tag-commit and tag-ref provenance for every asset and the image before a draft is published - execute the tag-binding run blocks in tests with inert commands - remove the unreferenced main-ref queue helper and the unused --recovery-main flag; document the cap, its stall and way out, duplicate resumes, and the maintenance-branch backport requirement Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Delta-review follow-ups: - count failed retained-candidate continuations against the attempt cap, now that the restored step name makes that path reachable - count only failed attempts on the draft tag's lineage toward the cap - verify asset provenance before the draft upload, so a failure leaves the draft assetless, and the image after its attestation; share one helper - exercise the tag-commit binding with real assets and assert that a blocked disposition runs no release mutation - document the manual tag-ref retry, rerun limits, the disposition helper's scope, and which tag definitions contain the new checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Second delta-review follow-ups: - report the inspected attempt count on retained-candidate resumes - test the retained cap end to end against a real Git lineage - correct the proof-step rename guidance and the disposition helper's scope - document the exits from a blocked draft that has assets, the server-image check after upload, and the source branch for manual tag-ref retries Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Third delta-review follow-ups: clear inherited GIT_* overrides in the real-lineage retained-cap test, assert its first attempt count, clarify the proof-step name comment, and document that both exits from a blocked draft with assets close after about 30 days. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review of #654 at head What was reviewed
First review ( The reviewer confirmed the core design:
Findings:
Delta review of
Delta review of
Delta review of
Validation at
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the tag-ref Package Release run fails before uploading a draft asset, Semantic Release's "Resume the incomplete package release" step dispatched the retry with
--ref "${ATRINIK_RELEASE_BRANCH}", that is frommain. The retry built the tagged tree. But GitHub signs artifact attestations with the workflow run's own ref and commit (the OIDCref/shaclaims), not with the commit the run checks out. So the recovered releases were attested formain's head:main)SourceRepositoryDigest/ ref8ff534bacf05ff3a,refs/heads/main5935b9009d066c82,refs/heads/main8779fdfe8779fdfe,refs/tags/v5.117.0Every verifier that pins the tag commit rejects v5.115.0 and v5.116.0. That includes service-updater's stable channel (
gh attestation verify --signer-workflow …/package-release.yml --source-digest <tag commit>).After this PR, every recovery path that builds or attests release artifacts runs on the tag ref. Package Release also refuses to publish any byte that lacks tag-bound provenance.
Why the resume used
mainThis was a deliberate escape hatch from #30 (the v5.6.0 incident): if the tag's own workflow definition was broken, rerunning from the tag would fail the same way, so recovery ran
main's validated definition instead. Nothing on GitHub requires it. Tag-refworkflow_dispatchalready works: the first dispatch (queue_package_release.sh) and Recover Missing Release both use it from the same token, and thediscord-releaseenvironment admitsv*tags. The flaw was that the resolver can't tell a broken definition from a transient failure, so every resume took themainpath.Both incidents were transient AppImage image-preparation failures, and their tooling was identical between tag and
main:maindiffered only in.github/dependabot.yml.maindiffered only inlibatrinik/andserver/(fix(server): detect a dead rendezvous control within a minute #652).The only way for a tag-ref run to execute
main's definition is to call a reusable workflow at@main. That keeps the tag's source digest, butBuildSignerURIthen names the reusable workflow, and the updater also pins it topackage-release.yml. So no design letsmain's definition sign for the tag in a form existing consumers accept.Implementation / behavior
release.ymldispatches the resume with--ref "${RELEASE_TAG}", after checking the tag format, and keepssource_branch=${ATRINIK_RELEASE_BRANCH}.package-release.ymlpreflight refuses a branch-ref run withoutcandidate_run_id, withcandidate builds must run from refs/tags/<tag>. Branch mode remains only for retained-candidate publication, which never builds. The metadata step requires a tag ref.tools/release/verify_tag_provenance.shrunsgh attestation verifywith thepackage-release.ymlsigner, the tag commit as source digest,refs/tags/<tag>as source ref, and--deny-self-hosted-runners. Each subject gets three attempts.LiveSigstoreVerifier.VerifyandVerifyCertExtensionskeep the attestations that verify and fail only if none do.blocked. That is the first dispatch plus two retries, or the candidate run plus two current-maincontinuations. A tag-ref retry can't pick up fixes frommain, and each attempt adds about 15 check runs to the tag commit. Off-lineage runs don't use up attempts.validate_release.py,recover_release.pyand the branch-mode check querycheck-runs?check_name=Classic%20validation, keeping the defaultfilter=latest. Before, they read one unfiltered page of up to 100 check runs.RETAINED_PROOF_STEPSstill named "Recheck candidate hashes before publication", renamed in feat(client): add automated Linux Debian release packages #580, so retained-candidate recovery could never match. The name is fixed, and a test now checks every job and step name the resolver inspects against the workflows.server/tools/queue-release.sh(a--ref maindispatcher) and the unusedvalidate_release.py --recovery-main.docs/RELEASING.md: documentsX.Y.xbranch from an older tag.Validation
test_resolve_pending_release,test_workflow_contracts,test_release_mutation_fences, the newtest_package_release_preflight,test_recover_release,test_select_release_batch,test_sync_release_assets,test_release_artifactsandtest_github_releasegive 179 tests, OK (3 CMake skips).CI='' python3 -m unittest discover -s tools/testsruns 894 tests. The only errors (104) areFileNotFoundError: 'cmake', because this host has no CMake.test_package_release_preflightruns the checked-in guard, metadata, retained and both provenance steps with inert PATH mocks. Mutation checks confirm it catches each of these regressions: removing the guard, the retained tag/commit checks,--source-ref,--deny-self-hosted-runners, the retry, the image subject, or the tag-commit binding.maincontinuations, thenblocked.classic-server@sha256:00132a3c…pass;expected SourceRepositoryDigest to be 5935b900…, got 9d066c82…. This gate would have stopped both incidents.concurrency.queuereports are identical on the base revision. ShellCheck is clean on the new helper.python3 tools/verify_import_history.py,node tools/tests/test_release_policy.cjsandgit diff --checkpass.main.classic-server:5.115.0and5.116.0images carry their tag commits inorg.opencontainers.image.revision.No release, Package Release run or other dispatch was triggered. The recovery paths and the provenance gate run for real only in a release run. In particular, the attestation API's read-after-write latency right after
actions/attestis unverified; the helper retries for 20 seconds.Limitations / follow-up
main, so tag-pinned verifiers keep rejecting them. What to do about them is an owner decision outside this PR.discord-releaseenvironment: it still admitsmain, which this workflow no longer uses. Narrowing it is a separate settings change and is not made here.--ref mainand nosource_branch. It doesn't support maintenance-line drafts, and on anX.Y.xline those continuations wouldn't count toward the cap. NoX.Y.xbranch exists.🤖 Generated with Claude Code