From 6a6307d8318bcf3e226f014c829e73424046fff9 Mon Sep 17 00:00:00 2001 From: t Date: Tue, 27 Oct 2026 07:12:01 +0100 Subject: [PATCH] ci: check_runner_labels.sh ignores a trailing comment on runs-on, with a must-fail case table (Refs #6433) PMAT-Ticket: PMAT-6433 Co-Authored-By: Claude Sonnet 5.5 --- Makefile | 1 + docs/roadmaps/entries/PMAT-6433.yaml | 20 ++++++++++++++++++++ docs/roadmaps/roadmap.yaml | 20 ++++++++++++++++++++ scripts/check_runner_labels.sh | 26 +++++++++++++++++++++++++- 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 docs/roadmaps/entries/PMAT-6433.yaml diff --git a/Makefile b/Makefile index 4058d06cd9..0ea95e00f7 100644 --- a/Makefile +++ b/Makefile @@ -255,6 +255,7 @@ tier3: @echo "Checking build.rs crate-root escapes (v0.31.1 yank class)..." @bash scripts/check_build_rs_paths.sh @echo "Checking self-hosted CI jobs pin a discriminating runner label..." + @bash scripts/check_runner_labels.sh --self-test @bash scripts/check_runner_labels.sh @echo "Checking the toolchain-ceiling guard's comparator (aprender#2370)..." @bash scripts/check_clippy_current_stable.sh --self-test diff --git a/docs/roadmaps/entries/PMAT-6433.yaml b/docs/roadmaps/entries/PMAT-6433.yaml new file mode 100644 index 0000000000..3c9bd452b7 --- /dev/null +++ b/docs/roadmaps/entries/PMAT-6433.yaml @@ -0,0 +1,20 @@ +- id: PMAT-6433 + github_issue: 6433 + item_type: task + title: 'check_runner_labels.sh judges the runs-on value, not its trailing comment' + status: in_progress + priority: medium + assigned_to: aprender-wsweep + created: 2026-10-27T06:20:00Z + updated: 2026-10-27T06:20:00Z + spec: null + acceptance_criteria: + - 'a runs-on line whose only discriminating label is inside a trailing # comment fails check_runner_labels.sh' + - 'check_runner_labels.sh --self-test has must-fail rows for comment-only labels, and make runs it' + phases: [] + subtasks: [] + estimated_effort: null + labels: + - kind:code + notes: null + epic: 4741 diff --git a/docs/roadmaps/roadmap.yaml b/docs/roadmaps/roadmap.yaml index 01a0f13d67..b8800ebe8a 100644 --- a/docs/roadmaps/roadmap.yaml +++ b/docs/roadmaps/roadmap.yaml @@ -26535,3 +26535,23 @@ Not done, pending the ruling: moving the 31 fixture files to an obviously synthe - kind:code notes: null epic: 6390 +- id: PMAT-6433 + github_issue: 6433 + item_type: task + title: 'check_runner_labels.sh judges the runs-on value, not its trailing comment' + status: in_progress + priority: medium + assigned_to: aprender-wsweep + created: 2026-10-27T06:20:00Z + updated: 2026-10-27T06:20:00Z + spec: null + acceptance_criteria: + - 'a runs-on line whose only discriminating label is inside a trailing # comment fails check_runner_labels.sh' + - 'check_runner_labels.sh --self-test has must-fail rows for comment-only labels, and make runs it' + phases: [] + subtasks: [] + estimated_effort: null + labels: + - kind:code + notes: null + epic: 4741 diff --git a/scripts/check_runner_labels.sh b/scripts/check_runner_labels.sh index 67fa1cd144..8ff5fc9d46 100755 --- a/scripts/check_runner_labels.sh +++ b/scripts/check_runner_labels.sh @@ -28,10 +28,34 @@ cd "$(dirname "$0")/.." DISCRIM='clean-room|cuda|gpu|rtx4090|ada|blackwell|gb10|apple-silicon|m4|perf-solo|mini-builder|review-light|kfocus' fail=0 +# A selector is judged on its YAML value only: a trailing `# comment` must not +# supply the label (#6433: `[self-hosted, X64, Linux, intel] # perf-solo` passed). +pinned() { # $1 = text after `runs-on:`; true when it carries a discriminating label + local sel=${1%%#*} + grep -qE "$DISCRIM" <<< "$sel" +} + +if [ "${1:-}" = "--self-test" ]; then + bad=0 + expect() { # $1 = want (ok|bad), $2 = selector line + local got=bad + if pinned "$2"; then got=ok; fi + if [ "$got" != "$1" ]; then echo "FAIL self-test: want $1, got $got: $2" >&2; bad=1; fi + } + expect ok '[self-hosted, Linux, X64, clean-room]' + expect ok '[self-hosted, X64, Linux, intel, perf-solo] # one box' + expect bad '[self-hosted, X64, Linux]' + expect bad '[self-hosted, X64, Linux, intel] # perf-solo' + expect bad '[self-hosted, X64, Linux] # clean-room' + [ "$bad" -eq 0 ] || exit 1 + echo "✓ check_runner_labels --self-test: 5 rows (2 pass, 3 must-fail incl. comment-only labels)" + exit 0 +fi + while IFS=: read -r file line sel; do # Only inline self-hosted selectors. grep -q 'self-hosted' <<< "$sel" || continue - if ! grep -qE "$DISCRIM" <<< "$sel" ; then + if ! pinned "$sel"; then echo "::error file=${file},line=${line}::self-hosted job lacks a discriminating runner label (need clean-room or a GPU/macOS label): ${sel# }" fail=1 fi