fix(release): assert required release assets by presence in auto-promote - #460
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
The auto-promote "Verify published release" gate asserted an exact
ASSET_COUNT = 5("4 archives + checksums.txt"). That count predates release signing and SBOMs (added in #395, with cosign migrated to the Sigstore bundle format in #459). A signed final release now publishes 11 assets, so the exact-count assertion would fail the final publish and block auto-promotion. v0.7.0 predates the signed path, so this had never been exercised against a real signed release.Fix
Replace the brittle exact count with presence-based assertions on the load-bearing named assets:
checksums.txtchecksums.txt.bundle(cosign signature)checksums.txt.asc(GPG signature)*.tar.gz)Each required asset is reported present/missing in the step summary, and a missing one sets
fail=1and exits 1. The presence loop isset -euo pipefail-safe (thejq -emembership test runs inside anifcondition). The draft, prerelease, and latest-release checks are unchanged, and the change is scoped to this single step. Asserting by name keeps the gate stable as the artifact set grows (for example the per-archive SBOMs).Verification
Enumerated the goreleaser output from
goreleaser release --snapshot --clean --skip=publish,sign,sbomplus the.goreleaser.yamlsigns/sbomsconfig. Full published set (11):cascade_<ver>_{linux,darwin}_{amd64,arm64}.tar.gzchecksums.txtchecksums.txt.bundle(cosign,signsid cosign,signature: ${artifact}.bundle)checksums.txt.asc(gpg,signsid gpg)cascade_<ver>_<os>_<arch>.sbom.spdx.jsonactionlint .github/workflows/auto-promote.yaml: clean. Presence logic sanity-tested against mock release JSON: full set passes (fail=0), a set missingchecksums.txt.bundlefails (fail=1).