Repository navigation
ci: ride out GitHub's transient failures in the image and release workflows - #1143
Merged
Merged
Conversation
…kflows Registry and git calls retry with backoff (.github/scripts/registry.sh), latest only moves forward when an older run is re-run, and a failed Image or Release run started by a push is re-run once on its own (rerun.yml). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
GitHub fails often (5xx from ghcr.io or the API, rate limits, dropped connections, runners lost mid-job). Until now a single such error failed the image build on
main(solatest, and staging through Kargo, missed that commit) or a release (so Kargo's release pipeline saw no version tag) until someone re-ran it by hand.What changes (
image.yml,release.yml; production'sci-cd-production.ymlis untouched):.github/scripts/registry.shwraps everydocker push,imagetools inspect/createand the release'sgit fetch: a failed call is tried again after 10 s, doubling to 2 minutes, 8 attempts (about 9 minutes). "Not found" is an answer, not a failure, so the release still waits up to 40 minutes for the commit's image as before.latestonly moves forward. It used to be pushed by every run ofmain, so re-running an older run moved it, and staging, backwards. It now moves only tomain's tip or to a descendant of the commitlatestnames (itsorg.opencontainers.image.revisionlabel), as graph-explorer-x and subgraph-studio already do. The image job checks outmain's history (blobless) for this.rerun.yml: when a push-started run of Image or Release fails, its failed jobs run again 5 minutes later, once. This covers what can't be retried inside a step (checkout, setup actions, a lost runner). Both workflows are safe to run again: a version tag never moves, andlatestnever moves backwards.The release job was already idempotent (an existing version tag at the same digest succeeds; at another digest it fails). That's unchanged.
Tested:
registry.shagainst a fakedocker(transient errors retried then success; giving up after 8; not-found returned at once;latestkept for an older commit, moved for the tip, for a descendant and when absent);shellcheck;actionlint(only the custom runner labels flagged).🤖 Generated with Claude Code