feat: auto-bump image version on rw2 release#1
Conversation
| echo "No version change — nothing to release." | ||
| else | ||
| git commit -m "Release v$CNEW (image $VERSION)" | ||
| git push origin HEAD:master |
There was a problem hiding this comment.
[COULD] Optional hardening — not blocking.
Moderator ruling: Confirmed low-risk and clean-failing:
compose-bumpserializes automated runs, so the only trigger is a human pushing to composemasterin the ~seconds window, andset -eaborts before the tag is created (no half-state — a re-dispatch fixes it cleanly). The suggestedgit pull --no-rebaseretry adds complexity for a rare, self-healing case. Acceptable as-is; Engineer may add the merge-then-push guard if cheap. Not expected for merge.
Severity: MINOR
Category: Robustness (non-fast-forward push)
Evidence: bump-image.yml:44 git push origin HEAD:master pushes the commit made on the checked-out (dispatch-time) master.
Issue: If master advances between checkout and push, the push is rejected (non-ff) and the release fails. The compose-bump concurrency group already prevents two automated runs from racing, so the only realistic trigger is a human pushing to master during the ~seconds-long window — low risk.
Optional hardening: git pull --no-rebase origin master (merge, per repo rule — no rebase) before commit, or a small retry. Not blocking.
— Reviewer
Tagged by Moderator
Reviewer summary — PR #1 (rocketwelder-compose)Verdict: essentially clean. 1 MINOR (non-ff push, inline above), 0 MAJOR, 0 BLOCKER. Verified correct:
— Reviewer |
… manual re-teach (P_k=V_k, no δ), recapture/deletion read-model fix
Summary
Adds
.github/workflows/bump-image.yml, the receiving half of the RocketWelder release pipeline. Whenrocket-welder2finishes promoting a new image to ACR, it sends a cross-reporepository_dispatchand this workflow updates the deployment bundle to point at the new image version.What it consumes
This workflow is triggered by the
rw2-releasedrepository_dispatchevent sent fromrocket-welder2(itspromote-images.ymlnotify-composejob). The image version arrives inclient_payload.version.Flow (bump → commit → tag)
masterwith full history (fetch-depth: 0) so all tags are available.client_payload.versioninto anenv:var (injection-safe), and fails fast if it is empty ([ -z "$VERSION" ] && exit 1)../update-version.sh set "$VERSION" --format=json, which rewritesrocketwelder.versionand the image tag indocker-compose.yml(+ arch-specific compose files).vX.Y.Z) from the latest existingv*tag — bumped independently of the image version line.git add -A. A no-op guard (if git diff --cached --quiet) skips the release entirely when nothing changed, so an unchanged version never produces an empty commit/tag.master, pushes, then creates and pushes the newvX.Y.Zcompose tag.Secrets / permissions
GITHUB_TOKENwithpermissions: contents: writeto push the commit and tag.rocket-welder2using itsCOMPOSE_DISPATCH_TOKENsecret — that token lives inrocket-welder2, not here.Other safeguards
concurrency: { group: compose-bump, cancel-in-progress: false }— serializes overlapping releases so two dispatches can't race on the tag bump.docker-compose.yml.bakthatupdate-version.shwrites is covered by.gitignore(*.bak), sogit add -Adoes not stage it.Activation note
repository_dispatchworkflows only become active after the file lands on the default branch. This PR must be merged tomasterbefore therw2-releaseddispatch will trigger anything.