From ac28c0b378ce7e1bf5f28387451d16dca79d2d91 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 14 Oct 2026 14:33:45 +0200 Subject: [PATCH] fix(ci): keep the backfill floor on the path the architecture gate takes The main merge joined two correct rules into one broken script. The architecture gate republishes the highest version when :latest misses an architecture, because the published install instructions pull the image untagged and only a release of that version rewrites latest. The backfill floor refuses any tag below v9.0.2, which cannot build from its own tree. The gate returned before the floor was ever consulted, so an incomplete :latest would have asked the backfill for a tag it cannot build. Both paths now ask below_floor, which also replaces the comparison the loop carried inline. The picker's own test could not have caught it: its docker stub answers tags without emitting a manifest, and architectures.sh reads an empty manifest as every architecture missing, so the gate fired on every case and printed the newest tag. The stub now serves the whole pool, which is the state the floor cases assume anyway. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/meta/resolve/missing/highest_release_tag.sh | 11 +++++++++-- .../meta/resolve/missing/test_highest_release_tag.py | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/meta/resolve/missing/highest_release_tag.sh b/scripts/meta/resolve/missing/highest_release_tag.sh index a7769f62e2..d078c8782f 100755 --- a/scripts/meta/resolve/missing/highest_release_tag.sh +++ b/scripts/meta/resolve/missing/highest_release_tag.sh @@ -15,6 +15,10 @@ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" OWNER="$("${script_dir}/../repository/owner.sh")" REPO_PREFIX="${REPO_PREFIX,,}" +below_floor() { + [[ "$(printf '%s\n' "$1" "${oldest_buildable_tag}" | sort -V | head -n 1)" != "${oldest_buildable_tag}" ]] +} + serves_pool() { local img="$1" local absent @@ -47,13 +51,16 @@ if ! serves_pool "${REGISTRY}/${OWNER}/${REPO_PREFIX}:latest"; then fi if [[ "${latest_incomplete}" == "true" ]]; then - printf '%s\n' "${tags[$((${#tags[@]} - 1))]}" + newest="${tags[$((${#tags[@]} - 1))]}" + if ! below_floor "${newest}"; then + printf '%s\n' "${newest}" + fi exit 0 fi for ((i = ${#tags[@]} - 1; i >= 0; i--)); do tag="${tags[$i]}" - if [[ "$(printf '%s\n' "${tag}" "${oldest_buildable_tag}" | sort -V | head -n 1)" != "${oldest_buildable_tag}" ]]; then + if below_floor "${tag}"; then exit 0 fi tag_missing="false" diff --git a/tests/unit/python/scripts/meta/resolve/missing/test_highest_release_tag.py b/tests/unit/python/scripts/meta/resolve/missing/test_highest_release_tag.py index c9801bb119..0af79981b9 100644 --- a/tests/unit/python/scripts/meta/resolve/missing/test_highest_release_tag.py +++ b/tests/unit/python/scripts/meta/resolve/missing/test_highest_release_tag.py @@ -17,6 +17,8 @@ STUBS = { "docker": ( "#!/usr/bin/env bash\n" 'case " ${STUB_MISSING} " in *" ${3##*:} "*) exit 1 ;; esac\n' + 'printf \'{"manifests":[{"platform":{"architecture":"amd64"}},' + '{"platform":{"architecture":"arm64"}}]}\\n\'\n' ), } @@ -24,6 +26,10 @@ STUBS = { def pick(*missing: str) -> subprocess.CompletedProcess: """Run the picker against stubbed ``git`` tags and ``docker`` manifests. + A present tag answers with a manifest index serving the whole architecture + pool, because ``architectures.sh`` parses that index and reads an empty + answer as every architecture missing. + Args: missing: tags whose images the registry does not hold. """