Files
computer-playbook/scripts/meta/wait/ci_images.sh
kevinveenbirkenbachandClaude Opus 5 329f43097c fix(ci): make the image job prove the images exist before it reports success
For a fork PR the build step is skipped -- the images come from the
privileged run -- so the job went green in 29 seconds while that run was
still pushing. Everything gated on it inherited the lie: the DNS test
pulled arch 3m30s too early on one run and 53s too early on the next,
both times 'manifest unknown', and the four deploy chunks were spared
only by starting later.

The job now polls until every distro image for its tag is in the
registry. It runs unconditionally: where the job built the images itself
the first poll passes, and a push that silently failed is caught too.

The poll drives scripts/meta/resolve/missing/ci_images.sh, which already
owned that check for the release workflow, so the ref shape is not
written a fourth time. A resolver that cannot run aborts with 2 rather
than reading as 'not yet pushed' and hiding behind the full budget.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 00:31:33 +02:00

35 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Env:
# REGISTRY, OWNER, REPO_PREFIX, CI_TAG, INFINITO_DISTROS
# image coordinates, as scripts/meta/resolve/missing/ci_images.sh reads them
# WAIT_ATTEMPTS polls before giving up (default 60)
# WAIT_SLEEP_SECONDS seconds between polls (default 10)
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
resolver="${script_dir}/../resolve/missing/ci_images.sh"
wait_attempts="${WAIT_ATTEMPTS:-60}"
wait_sleep_seconds="${WAIT_SLEEP_SECONDS:-10}"
echo "⏳ Waiting for the CI images tagged ${CI_TAG:?}"
for attempt in $(seq 1 "${wait_attempts}"); do
if ! still_missing="$(bash "${resolver}")"; then
echo "❌ Could not check the CI images; see the resolver's output above." >&2
exit 2
fi
if [[ "${still_missing}" == "false" ]]; then
echo "✅ Every CI image is available."
exit 0
fi
echo " attempt ${attempt}/${wait_attempts}: still incomplete"
sleep "${wait_sleep_seconds}"
done
echo "❌ Gave up after ${wait_attempts} attempts." >&2
exit 1