mirror of
https://github.com/block/buzz.git
synced 2026-11-24 02:02:07 +00:00
[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:
1
.github/workflows/docker.yml
vendored
1
.github/workflows/docker.yml
vendored
@@ -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}"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user