You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
handoff_dir="$(python3 .github/scripts/handoff.py dir comment "$handoff_id" --root "$handoff_root")"
771
792
mkdir -p "$handoff_dir"
772
-
marker="<!-- merge-queue-needs-validation -->"
773
793
# Markdown code spans are intentionally literal in these single-quoted strings.
774
794
# shellcheck disable=SC2016
775
795
{
776
796
printf '%s\n' "$marker"
777
-
# Markdown code spans are intentional literal text.
778
-
# shellcheck disable=SC2016
779
-
printf 'Ejected from the merge queue: this PR still carries the `needs-validation` label.\n\n'
797
+
printf 'Ejected from the merge queue: this PR still carries the `%s` label.\n\n' "$blocking_label"
780
798
printf 'The merge queue gate ([run %s](%s/%s/actions/runs/%s)) blocked the queued group because of the label. That failure runs on the queue'"'"'s transient ref, so it never appears in this PR'"'"'s own checks — they stay green, and this notice is the only visible trace on the PR.\n\n' "$RUN_ID" "$GITHUB_SERVER_URL" "$REPO" "$RUN_ID"
781
-
# shellcheck disable=SC2016
782
-
printf 'To land this PR: complete the QA pass the label is tracking, remove the `needs-validation` label, then add the PR back to the merge queue.\n'
799
+
printf '%s\n' "$next_step"
783
800
} > "$handoff_dir/body.md"
784
801
jq -n \
785
802
--arg kind "comment" \
@@ -843,31 +860,37 @@ jobs:
843
860
fi
844
861
covered=1
845
862
case " $checked " in *" $pr "*) ;; *) checked="$checked $pr";; esac
846
-
if printf '%s\n' "$labels" | grep -qx 'needs-validation'; then
847
-
echo "::error::PR #$pr still has 'needs-validation' — blocking merge."
863
+
blocking_label=""
864
+
if printf '%s\n' "$labels" | grep -qx 'needs-maintainer-check'; then
865
+
blocking_label="needs-maintainer-check"
866
+
elif printf '%s\n' "$labels" | grep -qx 'needs-validation'; then
867
+
blocking_label="needs-validation"
868
+
fi
869
+
if [ -n "$blocking_label" ]; then
870
+
echo "::error::PR #$pr still has '$blocking_label' — blocking merge."
848
871
# Fail-fast keeps this per-run notice on the FIRST labeled PR found; every
849
872
# labeled entry also fails its own queue run, so each still gets its own notice.
850
-
emit_ejection_notice "$pr" || echo "::warning::could not produce the ejection-notice handoff for PR #$pr; the block itself still stands."
873
+
emit_ejection_notice "$pr" "$blocking_label" || echo "::warning::could not produce the ejection-notice handoff for PR #$pr; the block itself still stands."
851
874
exit 1
852
875
fi
853
-
echo "PR #$pr: no needs-validation label."
876
+
echo "PR #$pr: no merge-blocking label."
854
877
done
855
878
if [ "$covered" -eq 0 ]; then
856
-
echo "::error::merge-group commit $sha resolved to no pull request (candidates: ${candidates:-none}) — cannot verify needs-validation; blocking merge (fail closed)."
879
+
echo "::error::merge-group commit $sha resolved to no pull request (candidates: ${candidates:-none}) — cannot verify merge-blocking labels; blocking merge (fail closed)."
857
880
exit 1
858
881
fi
859
882
done
860
-
echo "No 'needs-validation' label in the queued group ($checked ) — clear to merge."
883
+
echo "No merge-blocking label in the queued group ($checked ) — clear to merge."
861
884
fi
862
885
863
886
# `failure()` is required: the gate exits 1 on the very path that produces the handoff,
864
887
# and the default `success()` condition would skip this upload exactly when it matters.
0 commit comments