From 706b68740409701fb105916ce2cd7e2b4b456089 Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 18 May 2026 13:51:19 +0200 Subject: [PATCH] Skip missing upstream branches instead of failing the scheduled build When a branch listed in branches.yaml doesn't exist on the upstream repository (e.g. geth/bal-devnet-7 before it lands), process_commits already detects it and skips writing a commit hash. The Docker Hub existence check and config-generation loop still iterated over those entries though, ended up querying for a malformed "-" image, found it "missing", and queued a build that immediately failed at actions/checkout. Every hourly cron then produced a red run and a Discord ping despite there being nothing actionable. Skip empty-hash configs in both loops. For the build-generation loop, emit a ::warning:: and a job-summary table so the missing branches are visible on the run page without failing the workflow. Self-healing: the moment the branch lands, the API returns a SHA and the next run builds it normally. --- .github/workflows/scheduled.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 2e9b54c..5d5fe33 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -166,6 +166,11 @@ jobs: while IFS=$'\t' read -r LINE SOURCE_REPOSITORY SOURCE_REF TARGET_REPOSITORY TARGET_TAG; do # get the image commit hash from LINE COMMIT_HASH=$(echo "$COMMITS" | jq -r --arg LINE "$LINE" '.[] | select(.line == $LINE) | .commit_hash') + # Skip configs whose upstream ref couldn't be resolved (process_commits already logged the cause); + # otherwise we'd query Docker Hub for a malformed "-" image and queue a build that has no source. + if [[ -z "$COMMIT_HASH" || "$COMMIT_HASH" == "null" ]]; then + continue + fi IMAGE_TAG="${TARGET_TAG}-${COMMIT_HASH}" IMAGE="${TARGET_REPOSITORY}:${IMAGE_TAG}" URL="https://hub.docker.com/v2/repositories/${TARGET_REPOSITORY}/tags?page_size=25&page=1&ordering=&name=${IMAGE_TAG}" @@ -195,12 +200,30 @@ jobs: done CONFIGS="configs=[" + SKIPPED_HEADER_WRITTEN=0 echo "Generating configuration files..." while IFS=$'\t' read -r LINE SOURCE_REPOSITORY SOURCE_REF SOURCE_PATCH TARGET_REPOSITORY TARGET_TAG; do # get the image commit hash from LINE COMMIT_HASH=$(echo "$COMMITS" | jq -r --arg LINE "$LINE" '.[] | select(.line == $LINE) | .commit_hash') COMMIT_HASH_FULL=$(echo "$COMMITS" | jq -r --arg LINE "$LINE" '.[] | select(.line == $LINE) | .commit_hash_full') + # Missing upstream ref: emit a workflow warning + run-summary entry instead of letting + # the deploy step fail on `actions/checkout`. Self-healing — once the branch lands upstream, + # process_commits gets a SHA and the next run builds it normally. + if [[ -z "$COMMIT_HASH" || "$COMMIT_HASH" == "null" ]]; then + echo "::warning::Skipping ${SOURCE_REPOSITORY}#${SOURCE_REF} -> ${TARGET_REPOSITORY}:${TARGET_TAG}: upstream ref not found" + if [ "$SKIPPED_HEADER_WRITTEN" = "0" ]; then + { + echo "## Skipped builds (upstream ref missing)" + echo "" + echo "| Source | Target |" + echo "| --- | --- |" + } >> "$GITHUB_STEP_SUMMARY" + SKIPPED_HEADER_WRITTEN=1 + fi + echo "| \`${SOURCE_REPOSITORY}#${SOURCE_REF}\` | \`${TARGET_REPOSITORY}:${TARGET_TAG}\` |" >> "$GITHUB_STEP_SUMMARY" + continue + fi IMAGE_TAG="${TARGET_TAG}-${COMMIT_HASH}" IMAGE="${TARGET_REPOSITORY}:${IMAGE_TAG}" CLIENT="${TARGET_REPOSITORY#*/}"