From bc3afbb293244b72cb0b940d3c939ec1a34f1be3 Mon Sep 17 00:00:00 2001 From: Helen Tian Date: Wed, 18 Nov 2026 14:41:24 +1100 Subject: [PATCH] [buzz] fix(ci): link relay image indexes to their source (#9637) The relay image index includes the qualified Git revision. Add the source repository URL beside it so OCI registry clients and deployment tools can link the image to the exact source commit. The manifest assembly step derives the URL from GitHub Actions' server and repository variables. The release workflow contract checks that the index includes both the source and revision annotations. Signed-off-by: Helen Tian --- .github/workflows/docker.yml | 1 + scripts/test-relay-image-eligibility-workflow.sh | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c53e3c95ae..65408e22fc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -426,6 +426,7 @@ jobs: done annotations=( + --annotation "index:org.opencontainers.image.source=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" --annotation "index:org.opencontainers.image.revision=${SOURCE_SHA}" --annotation "index:xyz.block.buzz.build.id=github-actions:${GITHUB_RUN_ID}:${GITHUB_RUN_ATTEMPT}" --annotation "index:xyz.block.buzz.qualification.ci-run-id=${CI_RUN_ID}" diff --git a/scripts/test-relay-image-eligibility-workflow.sh b/scripts/test-relay-image-eligibility-workflow.sh index 6a2f22e898..e4457162c2 100755 --- a/scripts/test-relay-image-eligibility-workflow.sh +++ b/scripts/test-relay-image-eligibility-workflow.sh @@ -70,6 +70,15 @@ grep -Fq "actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10" <<<"$merge_ exit 1 } +for annotation in \ + 'index:org.opencontainers.image.source=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}' \ + 'index:org.opencontainers.image.revision=${SOURCE_SHA}'; do + grep -Fxq " --annotation \"$annotation\"" <<<"$merge_job" || { + echo "relay image index is missing its source annotation: $annotation" >&2 + exit 1 + } +done + # Staging auto-promotes the newest main--<7> gateway image, so the gateway # must publish that tag and only from a source the relay CI qualified. Match # whole lines (-x) so a commented-out or otherwise inactive copy cannot satisfy