Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions docs/roadmaps/entries/PMAT-6433.yaml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions docs/roadmaps/roadmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
26 changes: 25 additions & 1 deletion scripts/check_runner_labels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down