From 7d87b4b9b4780c73adc425950f020ff5ded26110 Mon Sep 17 00:00:00 2001 From: Scott McCarty Date: Sat, 7 Nov 2026 11:07:58 -0500 Subject: [PATCH 1/2] Promote main on a branch push, latest on a release tag One floating tag moves per run, and which one is the point. `latest` is now the newest RELEASE; `main` is the branch. Constitution 1.33.0. Before this, a push to main moved `latest`, which is what 44 units across the fleet pull. On 2026-11-07 that put unreleased trentina 6.11.0 into production at 02:01 through podman-auto-update, where it climbed to the unit's 4g cap and was SIGKILLed. Nothing had asked for it and nothing was watching. The backwards-move guard now asks about whichever tag this run moves, rather than always about `latest`. A re-run of an old release tag must not demote `latest` any more than a re-dispatched old commit may demote `main`, and before this the release half of that was unguarded. The gates are unaffected: `bin/sdlc` resolves its image from the repo's IMAGE_TAG file, so every consumer already pulls a version tag and never `latest`. RT#1559 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01R7Y1jfBgAyvK9xarny6EHx --- .github/workflows/container.yml | 33 ++++++++++++++++++++++++++------- uv.lock | 8 ++++++++ 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 uv.lock diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index b992f8d..a2ac339 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -4,7 +4,8 @@ # arrived at the hard way in #689: the build pushes ONLY the commit SHA tag, the # gates address the image by the DIGEST the build reported, and `latest` plus the # semver tags move in a separate promote job that copies that tested digest -# without rebuilding. +# without rebuilding. `latest` is the newest RELEASE and `main` is the branch +# (constitution 1.33.0); a push to main moves `main` alone. # # Why that matters more here than anywhere else: 35 repos will pin this image. # A published tag that was never the thing the contract test ran against is a @@ -221,25 +222,43 @@ jobs: # Copies the tested digest. No rebuild, so the bytes that were verified # are the bytes that get the tag. - - name: Move latest, and the version tags on a release tag + - name: Move main, and latest plus the version tags on a release tag env: REF: ${{ needs.build.outputs.ref }} run: | set -eu - # The profile: promotion MUST NOT move `latest` back to an older + # ONE floating tag moves per run, and which one is the whole point of + # constitution 1.33.0. `latest` is the newest RELEASE: it moves on a + # version tag and never on a push to main, because 44 units across the + # fleet pull `:latest` and every one of their authors meant "the newest + # release". `main` is the tag for the branch, for a consumer that wants + # continuous delivery and is willing to name it. + # + # Before this, `latest` was main. On 2026-11-07 that put unreleased + # trentina 6.11.0 into production at 02:01 through podman-auto-update, + # where it climbed to the unit's 4g cap and was SIGKILLed. Nothing had + # asked for it and nothing was watching (RT#1559). + case "$GITHUB_REF" in + refs/tags/v*) floating=latest ;; + *) floating=main ;; + esac + + # The profile: promotion MUST NOT move a floating tag back to an older # commit when a newer one has landed. A scheduled rebuild or a # re-dispatch of an old commit would otherwise quietly demote the - # registry, and 35 repos pin this image. + # registry, and 35 repos pin this image. Asked of whichever tag THIS + # run moves: a re-run of an old release tag must not demote `latest` + # any more than a re-dispatched old commit may demote `main`. current=$(skopeo inspect --format \ '{{ index .Labels "org.opencontainers.image.revision" }}' \ - "docker://$QUAY:latest" 2>/dev/null || true) + "docker://$QUAY:$floating" 2>/dev/null || true) if [ -n "${current:-}" ] && [ "$current" != "$GITHUB_SHA" ]; then if git merge-base --is-ancestor "$GITHUB_SHA" "$current" 2>/dev/null; then - echo "refusing: :latest is $current, which already contains $GITHUB_SHA" >&2 + echo "refusing: :$floating is $current, which already contains $GITHUB_SHA" >&2 exit 1 fi fi - skopeo copy "docker://$REF" "docker://$QUAY:latest" + skopeo copy "docker://$REF" "docker://$QUAY:$floating" case "$GITHUB_REF" in refs/tags/v*) version=${GITHUB_REF#refs/tags/v} diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..488e898 --- /dev/null +++ b/uv.lock @@ -0,0 +1,8 @@ +version = 1 +revision = 5 +requires-python = ">=3.14" + +[[package]] +name = "python-sdlc" +version = "0.5.1" +source = { virtual = "." } From 0dd7be132761659601fb50fb0dfa30cc488b49f3 Mon Sep 17 00:00:00 2001 From: Scott McCarty Date: Sat, 7 Nov 2026 11:23:57 -0500 Subject: [PATCH 2/2] latest excludes prereleases, and moves no floating tag Gatehouse, on the same change in mcp-gemini: a `v*` test admits `v1.2.3-rc.1`, so a release candidate could move `latest` away from the newest stable release -- the one thing this change exists to prevent. A prerelease is not the branch either, so it now moves NO floating tag and publishes its version tags alone. SemVer puts every prerelease identifier after a hyphen, so `v*-*` is the whole test. RT#1559 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01R7Y1jfBgAyvK9xarny6EHx --- .github/workflows/container.yml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index a2ac339..3fa93cf 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -238,9 +238,16 @@ jobs: # trentina 6.11.0 into production at 02:01 through podman-auto-update, # where it climbed to the unit's 4g cap and was SIGKILLed. Nothing had # asked for it and nothing was watching (RT#1559). + # + # A prerelease moves no floating tag: `latest` is the newest STABLE + # release, and a release candidate is not the branch either. SemVer + # puts every prerelease identifier after a hyphen, so the pattern + # `v*-*` is the whole test. + floating= case "$GITHUB_REF" in - refs/tags/v*) floating=latest ;; - *) floating=main ;; + refs/tags/v*-*) ;; + refs/tags/v*) floating=latest ;; + *) floating=main ;; esac # The profile: promotion MUST NOT move a floating tag back to an older @@ -249,16 +256,18 @@ jobs: # registry, and 35 repos pin this image. Asked of whichever tag THIS # run moves: a re-run of an old release tag must not demote `latest` # any more than a re-dispatched old commit may demote `main`. - current=$(skopeo inspect --format \ - '{{ index .Labels "org.opencontainers.image.revision" }}' \ - "docker://$QUAY:$floating" 2>/dev/null || true) - if [ -n "${current:-}" ] && [ "$current" != "$GITHUB_SHA" ]; then - if git merge-base --is-ancestor "$GITHUB_SHA" "$current" 2>/dev/null; then - echo "refusing: :$floating is $current, which already contains $GITHUB_SHA" >&2 - exit 1 + if [ -n "$floating" ]; then + current=$(skopeo inspect --format \ + '{{ index .Labels "org.opencontainers.image.revision" }}' \ + "docker://$QUAY:$floating" 2>/dev/null || true) + if [ -n "${current:-}" ] && [ "$current" != "$GITHUB_SHA" ]; then + if git merge-base --is-ancestor "$GITHUB_SHA" "$current" 2>/dev/null; then + echo "refusing: :$floating is $current, which already contains $GITHUB_SHA" >&2 + exit 1 + fi fi + skopeo copy "docker://$REF" "docker://$QUAY:$floating" fi - skopeo copy "docker://$REF" "docker://$QUAY:$floating" case "$GITHUB_REF" in refs/tags/v*) version=${GITHUB_REF#refs/tags/v}