From 2f55ef0c7c14642f646d64e8db9da5f314c97784 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Wed, 11 Nov 2026 02:21:40 +0100 Subject: [PATCH] fix(ci): say which state the deployed-PR queue check timed out in The queue-state check that decides whether to restore main ends in one of two states when it runs out of reads: this group's own entry is still queued, or the PR has left and the check is waiting for the queue to drain. The failure now names which one, with the queued count it last read, and says when main was not restored. Part of #5014 Co-Authored-By: Claude Opus 5.5 --- scripts/merge-group-evicted.sh | 13 +++++++++++-- scripts/tests/test-merge-group-evicted.sh | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/scripts/merge-group-evicted.sh b/scripts/merge-group-evicted.sh index e38936d1c4..a5726ecc01 100755 --- a/scripts/merge-group-evicted.sh +++ b/scripts/merge-group-evicted.sh @@ -119,7 +119,16 @@ while :; do exit 0 fi - [ "$polls" -lt "$max_polls" ] || - fail "#${number} had not merged, or the queue had not drained, after ${max_polls} reads; its outcome is unknown" + # The bound ends in one of two different states (#5014), and the failure names which, + # with the queued count it last read: this group's own entry may still be queued, or + # the PR has left and the answer is waiting for the queue to drain. In the second + # case main is NOT restored, so production can keep the unmerged artifact until a + # later deploy replaces it. + if [ "$polls" -ge "$max_polls" ]; then + if [ -z "$left" ]; then + fail "#${number}: this merge group's own queue entry was still queued after ${max_polls} reads (last read: ${queued} entries queued); it had neither merged nor left, so its outcome is unknown" + fi + fail "#${number} left the merge queue (${left}), but the queue had not drained after ${max_polls} reads (last read: ${queued} entries queued); main was not restored, so production may still run this PR's unmerged artifact until a later deploy replaces it" + fi sleep "$poll_seconds" done diff --git a/scripts/tests/test-merge-group-evicted.sh b/scripts/tests/test-merge-group-evicted.sh index 512a12b457..c005eed0ba 100755 --- a/scripts/tests/test-merge-group-evicted.sh +++ b/scripts/tests/test-merge-group-evicted.sh @@ -54,6 +54,7 @@ run_case() { STUB_CALLS="$scratch/calls" STUB_RC="$stub_rc" EVICTED_POLL_SECONDS=0 EVICTED_MAX_POLLS=5 \ EVICTED_REPOSITORY=devantler-tech/platform EVICTED_HEAD_REF="$ref" EVICTED_GROUP_CREATED_AT="$at" \ GITHUB_OUTPUT="$scratch/output" "$script" 2>&1)"; then rc=0; else rc=$?; fi + printf "%s\n" "$out" >"$scratch/stdout" got_output="$(cat "$scratch/output")" reads="$(cat "$scratch/calls")" @@ -79,6 +80,17 @@ logged() { fi } +#