From 7932ac5c2be30fa22a58d7a61e97e7058acd1061 Mon Sep 17 00:00:00 2001 From: fastrevmd-lab Date: Thu, 29 Oct 2026 23:25:18 -0400 Subject: [PATCH] fix(ci): retry cosign verify in reusable-release-image for registry lag (#595) 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 --- .github/workflows/reusable-release-image.yml | 23 ++++++++++++++++---- CHANGELOG.md | 11 ++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-release-image.yml b/.github/workflows/reusable-release-image.yml index 6b62fef..3a63029 100644 --- a/.github/workflows/reusable-release-image.yml +++ b/.github/workflows/reusable-release-image.yml @@ -249,12 +249,27 @@ jobs: if [ "${DH_PUSH}" = "true" ]; then refs="${refs} ${DH_IMAGE}@${DIGEST}" fi + # Docker Hub's referrers index is eventually consistent: a signature + # pushed <1 s ago can read as "no signatures found" (#595). Retry + # each ref, 6 attempts over ~59 s; the gate stays hard. for ref in ${refs}; do echo "Verifying ${ref}" - cosign verify \ - --certificate-oidc-issuer https://token.actions.githubusercontent.com \ - --certificate-identity-regexp '^https://github\.com/mechubsec/mecmcp/\.github/workflows/reusable-release-image\.yml@' \ - "${ref}" > /dev/null + attempt=1 + for delay in 2 4 8 15 30 0; do + if cosign verify \ + --certificate-oidc-issuer https://token.actions.githubusercontent.com \ + --certificate-identity-regexp '^https://github\.com/mechubsec/mecmcp/\.github/workflows/reusable-release-image\.yml@' \ + "${ref}" > /dev/null; then + break + fi + if [ "${delay}" -eq 0 ]; then + echo "::error::cosign verify failed for ${ref} after ${attempt} attempts" + exit 1 + fi + echo "cosign verify attempt ${attempt}/6 failed for ${ref}; retrying in ${delay}s" + sleep "${delay}" + attempt=$((attempt + 1)) + done done env: GHCR_IMAGE: ${{ inputs.image }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f66460e..a2c2a72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 > > Entries from 0.21.0 onward should be written by hand at release time. +## [Unreleased] + +### Fixed + +- **ci**: `reusable-release-image.yml` `Verify signatures (hard gate)` now retries each + ref's `cosign verify` (6 attempts, backoff 2/4/8/15/30 s, about 59 s) before failing. + Docker Hub's referrers index is eventually consistent, so verify right after signing could + report `no signatures found` and fail the release (seen on rustsdcmcp v0.6.0). The gate + stays hard: a signature that never appears still fails the job with cosign's last error. + Consumers pin this workflow by SHA, so they only get the fix after bumping that pin (#595). + ## [0.31.1] - 2026-10-29 ### Fixed