[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 <htian@squareup.com>
This commit is contained in:
Helen Tian
2026-11-18 14:41:24 +11:00
committed by GitHub
parent 25b58ab98f
commit bc3afbb293
2 changed files with 10 additions and 0 deletions

View File

@@ -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}"

View File

@@ -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-<ts>-<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