Skip to content

Commit f86e978

Browse files
fix(ci): retry cosign verify in reusable-release-image for registry lag (#595) (#600)
Docker Hub's referrers index is eventually consistent, so verify ~1 s after signing could report "no signatures found". Retry each ref 6 times (2/4/8/15/30 s backoff); the gate stays hard and fails after the last try. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 4eafc30 commit f86e978

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

‎.github/workflows/reusable-release-image.yml‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,27 @@ jobs:
249249
if [ "${DH_PUSH}" = "true" ]; then
250250
refs="${refs} ${DH_IMAGE}@${DIGEST}"
251251
fi
252+
# Docker Hub's referrers index is eventually consistent: a signature
253+
# pushed <1 s ago can read as "no signatures found" (#595). Retry
254+
# each ref, 6 attempts over ~59 s; the gate stays hard.
252255
for ref in ${refs}; do
253256
echo "Verifying ${ref}"
254-
cosign verify \
255-
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
256-
--certificate-identity-regexp '^https://github\.com/mechubsec/mecmcp/\.github/workflows/reusable-release-image\.yml@' \
257-
"${ref}" > /dev/null
257+
attempt=1
258+
for delay in 2 4 8 15 30 0; do
259+
if cosign verify \
260+
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
261+
--certificate-identity-regexp '^https://github\.com/mechubsec/mecmcp/\.github/workflows/reusable-release-image\.yml@' \
262+
"${ref}" > /dev/null; then
263+
break
264+
fi
265+
if [ "${delay}" -eq 0 ]; then
266+
echo "::error::cosign verify failed for ${ref} after ${attempt} attempts"
267+
exit 1
268+
fi
269+
echo "cosign verify attempt ${attempt}/6 failed for ${ref}; retrying in ${delay}s"
270+
sleep "${delay}"
271+
attempt=$((attempt + 1))
272+
done
258273
done
259274
env:
260275
GHCR_IMAGE: ${{ inputs.image }}

‎CHANGELOG.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2727
>
2828
> Entries from 0.21.0 onward should be written by hand at release time.
2929
30+
## [Unreleased]
31+
32+
### Fixed
33+
34+
- **ci**: `reusable-release-image.yml` `Verify signatures (hard gate)` now retries each
35+
ref's `cosign verify` (6 attempts, backoff 2/4/8/15/30 s, about 59 s) before failing.
36+
Docker Hub's referrers index is eventually consistent, so verify right after signing could
37+
report `no signatures found` and fail the release (seen on rustsdcmcp v0.6.0). The gate
38+
stays hard: a signature that never appears still fails the job with cosign's last error.
39+
Consumers pin this workflow by SHA, so they only get the fix after bumping that pin (#595).
40+
3041
## [0.31.1] - 2026-10-29
3142

3243
### Fixed

0 commit comments

Comments
 (0)