fix(image-deploy): monotonic tag guard — refuse backwards newTag writes #2

Merged
dev merged 1 commits from dev/bug-313bg8bgezp3/monotonic-tag-guard into main 2026-08-24 23:03:31 +00:00
1 Commits
Author SHA1 Message Date
Dave Kowalski 70e1a06816 fix(image-deploy): monotonic tag guard — refuse backwards newTag writes
validate / validate (pull_request) Successful in 4s
Two concurrent release runs can race such that the older build's
image-deploy step finishes after the newer build already committed its
tag. Without an ordering check, last-writer-wins and the manifest
silently reverts to a stale image.

Add _monotonic_check: reads origin/main's current newTag for the image
and exits 0 (with a loud SKIP log) if it is numerically greater than the
tag we are trying to write. The guard runs before the kustomize edit and
again after each rebase in the push-retry loop, so both race shapes are
covered:
- Clone-then-lose: second clone already sees the newer tag → initial
  guard fires before any commit.
- Concurrent-push: both cloned the same base; one pushes first; the
  other rebases, then the post-rebase guard fires before the re-push.

Fixes bug-313bg8bgezp3
2026-08-24 22:59:36 +00:00