Repository navigation
ci: the deploy image check retries transient registry errors instead of failing on them - #632
Merged
Merged
Conversation
…of failing on them The step added for #600 failed Dependabot's #622 with 'does not resolve' on an image that exists: Docker Hub answered 502 Bad Gateway. It treated every non-429 error as a missing image. Now there are three outcomes. Manifest unknown / not found / denied fails, which is the defect. Any 5xx, 429 or timeout is retried three times with backoff, then reported as a visible warning: a registry outage says nothing about whether the image exists. Anything unrecognised still fails, so a new error is read rather than waved through. Tested by running the step's own loop against a stubbed docker: a flaky 502 recovers to ok, a persistent 502 warns, a missing image and an unknown error both fail. The real Docker Hub answer for the deleted minio/minio:RELEASE.2025-09-07 image is 'denied ... unauthorized', which classifies as missing.
scttfrdmn
enabled auto-merge (squash)
October 19, 2026 20:19
This was referenced Oct 20, 2026
scttfrdmn
added a commit
that referenced
this pull request
Oct 21, 2026
…ls (#633) (#635) Go does not retry a module fetch. A single HTTP/2 stream error from proxy.golang.org or sum.golang.org failed five correct PRs in October (#582, #631, #622, #614, #632) before anything compiled. Each module that failed had just been bumped on main, and the Security Scan failures came from uncached @latest tool installs. .github/scripts/go-retry.sh runs a go command and splits failures three ways. A transient answer (stream INTERNAL_ERROR, 5xx, timeout, reset) is retried with backoff, and each retry is printed. A missing module, or any other error, fails on the first attempt. A checksum mismatch / SECURITY ERROR is checked first and never retried, even beside a transient-looking line, so a corrupted download can't be retried until a lucky attempt hides it. Still transient after three attempts is a failure: a build can't proceed without its modules. Every job that sets up Go (18 across ci.yml, security.yml, release.yml and live-aws.yml) fetches modules through it as the step after setup-go. security.yml's existing bare 'go mod download' is replaced. gosec, govulncheck and go-licenses are pinned (v2.29.0, v1.9.0, v1.6.0) rather than @latest and installed through it; govulncheck had already moved from v1.8.0 under @latest with no commit. The MinIO and substrate installs go through it too. Tests: - TestGoRetryScriptRetriesOnlyTransientModuleServerErrors runs the real script against a stub go, asserting the number of attempts as well as the exit status. Removing the checksum guard, retrying everything, and never retrying each fail the cases they should. - TestEveryGoJobFetchesModulesThroughTheRetry walks every workflow: a retry download after setup-go with no go before it, no bare go install, no @latest. Floor of 15 Go jobs. Deleting a job's download step, adding @latest back, a bare go install, and a go build before the download each fail naming the job and step. Against real go, with a local proxy that 502s the first two requests into an empty GOMODCACHE: two visible retries, then success. A nonexistent version 404s and fails in 2s with no retry. Pinned govulncheck v1.9.0 reports no vulnerabilities, and go-licenses v1.6.0 passes.
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.
The image-existence step I added in #619 (for #600) failed Dependabot's #622 with
does not resolveon an image that exists. Docker Hub had answered 502 Bad Gateway, and the step treated every error other than a 429 as a missing image. So a registry hiccup failed an unrelated PR, which is the opposite of what the check is for.Now: three outcomes
Verified
The step's own loop, run against a stubbed
docker:The real Docker Hub answer for the deleted
minio/minio:RELEASE.2025-09-07T16-13-09Zisdenied: requested access to the resource is denied … unauthorized, which classifies as missing. The check still catches the #600 case.🤖 Generated with Claude Code