fix(release-image): space multi-image promotions so their webhooks cannot race - #68
Merged
Merged
Conversation
…nnot race ghcr fires one package webhook per tag, and argocd-image-updater handles each in its own clone -> commit -> push against the same GitOps repo. A release that promotes two images tags them in the same second, so the second push is rejected with "cannot lock ref refs/heads/main" and is never retried: that image's pin stays on the previous version until the 30-minute poll repairs it (cshuttle/main#244). It has bitten VirtualWindow on four of its last five releases and Atlas twice in a day. A release now waits tag-spacing-seconds (default 60) between images. A push takes a couple of seconds, so a minute is far more room than it needs, and it costs one wait on a release that already runs for minutes. Repos whose images no bot watches can set 0. Co-Authored-By: Claude Opus 5 (1M context) <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.
Summary
A release that promotes two images tags them in the same second. ghcr fires one package webhook per tag, argocd-image-updater handles each in its own clone → commit → push against the same GitOps repo, and the loser is rejected:
It is not retried, so that image's pin stays on the previous version until the 30-minute poll repairs it (
cshuttle/main#244, and the reasoning inapps/argocd/image-updater/image-updater-serialize-patch.yaml). VirtualWindow has hit it on four of its last five releases; Atlas hit it twice in one day.tag-spacing-secondsinput, default 60: the promote loop waits that long between images (no wait before the first, none for a single-image release).tag-spacing-seconds: 0.Nothing else changes: images are still promoted by digest, in the same order, with the same verification.
Tests
yaml.safe_load), and the input default reads back as 60.🤖 Generated with Claude Code