fix: release.yml promotes a pinned per-commit tag, not floating dev-* tags - #66
Merged
Merged
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
… tags
release.yml's promote job retagged whichever images dev-amd64/dev-arm64
(floating tags, overwritten by every push) happened to point to at
release-creation time, with no verification against the commit
actually being released. If a second commit's build job overwrote
those tags before the first commit's release had been promoted, the
release silently shipped the wrong commit's code -- every step still
reported success.
Confirmed this happened live: v0.20.44's deployed image was missing
the homelab#720 security fix present in the exact commit its own git
tag points to. Manually re-triggered docker.yml (workflow_dispatch)
to get a correct build out as v0.20.45 while this fix was in flight.
docker.yml's build step now also pushes sha-<commit>-{amd64,arm64}
per platform. release.yml resolves the release tag's actual commit
(checks out the tag, reads git rev-parse HEAD) and promotes from that
pinned tag instead of the floating dev-* ones -- eliminates the race
entirely.
Fixes dvystrcil/homelab#822
dvystrcil
force-pushed
the
fix/release-promote-race-condition
branch
from
August 1, 2026 23:57
b918f5a to
e0fc9d3
Compare
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.
User description
What
release.yml's promote job now resolves the release tag's actual commit SHA and promotessha-<sha>-{amd64,arm64}(new, pushed bydocker.yml's build step) instead of the floatingdev-amd64/dev-arm64tags.Why
dev-amd64/dev-arm64are overwritten by every push to main.release.yml's promote job read whichever images they pointed to at release-creation time, with no check against the commit actually being released. If a second commit's build job won the race and overwrote those tags before the first commit's release had been promoted, the release silently shipped the wrong commit's code -- every workflow step still reportedsuccess.Evidence this actually happened
Investigating why
homelab#720's fix (process-log retention sweep) wasn't running live despite being merged, taggedv0.20.41, and documented in CHANGELOG days ago: the deployed image tagged0.20.44was missing_sweep_expired_log_filesentirely, even though it's present in every commit since the fix landed, includingv0.20.44's own git tag's commit (69ad9de). Two Renovate-bot commits landed 10 minutes apart that day;v0.20.44's promote job started 5 seconds before its own triggering commit'sdocker.ymlbuild had even finished.Fix
docker.yml: build step also pushessha-<commit>-{amd64,arm64}per platform (immutable, pinned to the exact commit).release.yml: new first step checks outgithub.event.release.tag_name, resolvesgit rev-parse HEAD, and the promote step retags fromsha-<that-sha>-{amd64,arm64}instead of the floating tags. No race possible -- the source tag is pinned to the exact commit being released.Immediate remediation (already done, separate from this PR)
Manually re-triggered
docker.ymlviaworkflow_dispatchfrom currentmainto get a correct build out (v0.20.45) and get the actual homelab#720 fix live, since no other commits were racing at that moment.Test plan
python3 -c "import yaml; yaml.safe_load(...)"on both files).dvystrcil/yaml-validate-action's fold-swallow checker against both files: clean.Fixes dvystrcil/homelab#822
PR Type
Bug fix
Description
Pinned immutable commit tags in docker workflow
Resolved exact release commit SHA in promote job
Updated release promotion to use pinned tags
Documented race condition fix in changelog
Diagram Walkthrough
File Walkthrough
docker.yml
Add pinned commit tags to docker build step.github/workflows/docker.yml
release.yml
Resolve and use exact commit SHA for release promotion.github/workflows/release.yml
CHANGELOG.md
Document release promotion race condition fix in changelogCHANGELOG.md