From aeea88f938e7c37ea4ef7946c10f8df2c78d3c61 Mon Sep 17 00:00:00 2001 From: Scott McCarty Date: Wed, 11 Nov 2026 10:01:14 -0500 Subject: [PATCH] fix: promote copies the tested digest, never a rewrap (RT#1550) The promote job used plain skopeo copy for :main/:latest and the version tags. Without --all --preserve-digests a copy may rewrite the manifest, so a tag could resolve to bytes no gate tested; 35 repos pin this image. Every promotion now copies with both flags and reads the tag back, failing if it is not the tested digest. python-sdlc stays a listed custom-release repo; it now inherits constitution v1.39.1, whose validator checks exactly this. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01R7Y1jh5QhdxRuFKyWVev5h --- .github/workflows/constitution.yml | 2 +- .github/workflows/container.yml | 16 +++++++++++++--- .github/workflows/dependabot-automerge.yml | 2 +- .specify/memory/constitution.md | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/constitution.yml b/.github/workflows/constitution.yml index a1e0004..51be531 100644 --- a/.github/workflows/constitution.yml +++ b/.github/workflows/constitution.yml @@ -18,4 +18,4 @@ permissions: jobs: constitution: name: Constitution - uses: crunchtools/constitution/.github/workflows/validate.yml@v1.35.0 + uses: crunchtools/constitution/.github/workflows/validate.yml@v1.39.1 diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 2e5f868..b583fe3 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -257,6 +257,16 @@ 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`. + # Copy the tested digest, never a rewrap of it (constitution VII, + # RT#1550): --preserve-digests refuses a copy that would change the + # manifest, and the read-back fails the job if the tag resolves to + # anything but the digest that was tested. + want=${REF#*@} + promote() { + skopeo copy --all --preserve-digests "docker://$REF" "docker://$QUAY:$1" + got=$(skopeo inspect --format '{{.Digest}}' "docker://$QUAY:$1") + [ "$got" = "$want" ] || { echo ":$1 resolves to $got, not the tested $want" >&2; exit 1; } + } if [ -n "$floating" ]; then current=$(skopeo inspect --format \ '{{ index .Labels "org.opencontainers.image.revision" }}' \ @@ -267,14 +277,14 @@ jobs: exit 1 fi fi - skopeo copy "docker://$REF" "docker://$QUAY:$floating" + promote "$floating" fi case "$GITHUB_REF" in refs/tags/v*) version=${GITHUB_REF#refs/tags/v} - skopeo copy "docker://$REF" "docker://$QUAY:$version" + promote "$version" # The minor tag so a consumer MAY track patches if it chooses to. - skopeo copy "docker://$REF" "docker://$QUAY:${version%.*}" + promote "${version%.*}" echo "promoted $version" ;; esac diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index f10e8e3..47017c6 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -15,4 +15,4 @@ permissions: jobs: automerge: name: Dependabot - uses: crunchtools/constitution/.github/workflows/dependabot-automerge.yml@v1.35.0 + uses: crunchtools/constitution/.github/workflows/dependabot-automerge.yml@v1.39.1 diff --git a/.specify/memory/constitution.md b/.specify/memory/constitution.md index 93f3200..8138b45 100644 --- a/.specify/memory/constitution.md +++ b/.specify/memory/constitution.md @@ -4,7 +4,7 @@ > **Ratified:** 2026-11-04 > **Amended:** 2026-11-04 > **Status:** Active -> **Inherits:** [crunchtools/constitution](https://github.com/crunchtools/constitution) v1.35.0 +> **Inherits:** [crunchtools/constitution](https://github.com/crunchtools/constitution) v1.39.1 > **Profile:** Container Image This is a manifest. It carries only what is unique to this repo; the fleet rules