Skip to content

[pr-review] Flag CI runner labels that break the runner naming standard - #199315

Closed
jeanschmidt wants to merge 1 commit into
mainfrom
jeanschmidt/pr_review_runner_name_pattern
Closed

jeanschmidt wants to merge 1 commit into
mainfrom
jeanschmidt/pr_review_runner_name_pattern

Conversation

@jeanschmidt

@jeanschmidt jeanschmidt commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Impact: pr-review skill
Risk: low

What

Adds ci-runner-naming.md to the pr-review skill. It checks every self-hosted runner label that a PR adds or changes against the runner naming standard from pytorch/ci-infra. A non-conforming label that no other CI in this repo uses gets Request Changes. A non-conforming label that other CI already uses gets a short, non-blocking heads-up. GitHub-hosted runners are exempt.

Why

New runners keep landing with labels outside the standard (legacy linux.* style, wrong field order, missing features and similar mistakes). Today we only catch these by hand at review time. Tooling depends on the label structure: the rel- marker controls access to the protected release runner group, ARC rejects names over 45 characters, and HUD queue-time queries and queue alerts rely on the l- segment. Putting the rule in the pr-review skill means both AI reviewers enforce it from trusted main.

Most of the file is a procedure, not just the grammar, because the hard part is resolving the label a job actually runs on. That covers prefixes from the runner determinator or runner_prefix:, reusable-workflow defaults, test-matrix rows, ternaries and templates. The procedure then decides whether the label is new to this repo, so existing labels don't block unrelated PRs.

The other files are wiring:

  • review-checklist.md gets a "CI Runner Labels" item that links the new file.
  • pr-review-readiness/SKILL.md links the new file and maps blocker/heads-up to major/minor, so the readiness rubric doesn't drop the finding as a "naming preference".
  • The new file is added to the prompt_hash list in hardened-pr-review-run.yml and to the pinned sets in test_workflow_contract.py.

**Impact:** AI PR reviewers that use the pr-review skill (@claude and the In Progress PR Review). CI and dev tooling only, no runtime code.
**Risk:** low

## What
Adds `ci-runner-naming.md` to the pr-review skill. It checks every self-hosted runner label that a PR adds or changes against the runner naming standard from pytorch/ci-infra. A non-conforming label that no other CI in this repo uses gets Request Changes. A non-conforming label that other CI already uses gets a short, non-blocking heads-up. GitHub-hosted runners are exempt.

## Why
New runners keep landing with labels outside the standard (legacy `linux.*` style, wrong field order, missing features and similar mistakes). Today we only catch these by hand at review time. Tooling depends on the label structure: the `rel-` marker controls access to the protected release runner group, ARC rejects names over 45 characters, and HUD queue-time queries and queue alerts rely on the `l-` segment. Putting the rule in the pr-review skill means both AI reviewers enforce it from trusted `main`.

Most of the file is a procedure, not just the grammar, because the hard part is resolving the label a job actually runs on. That covers prefixes from the runner determinator or `runner_prefix:`, reusable-workflow defaults, test-matrix rows, ternaries and templates. The procedure then decides whether the label is new to this repo, so existing labels don't block unrelated PRs.

The other files are wiring:
- `review-checklist.md` gets a "CI Runner Labels" item that links the new file.
- `pr-review-readiness/SKILL.md` links the new file and maps blocker/heads-up to `major`/`minor`, so the readiness rubric doesn't drop the finding as a "naming preference".
- The new file is added to the `prompt_hash` list in `hardened-pr-review-run.yml` and to the pinned sets in `test_workflow_contract.py`.

# Notes
- The grammar is copied from ci-infra `osdc/docs/runner_naming_convention.md` at commit ca6864a9. If the canonical doc changes, this copy has to be updated by hand.
- Some hardware can't be expressed in the standard: ROCm/XPU, TPU, Grace, Apple Silicon and the `-fab` H100 variant. A new label for that hardware gets a finding saying the canonical doc must be extended first.
- This is guidance for the AI reviewers, not a deterministic lint, so PRs that no AI reviews are not covered.

Signed-off-by: Jean Schmidt <[email protected]>
@jeanschmidt
jeanschmidt requested a review from a team as a code owner October 1, 2026 16:28
@pytorch-bot

pytorch-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/199315

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 11f24c6 with merge base 38cca96 (image):
💚 Looks good so far! There are no failures yet. 💚

🟡 GREEN LIGHT - PR requires human review:

  • Never trivial: edits pytorch's own .claude/ skills tree
    • Adds .claude/skills/pr-review/ci-runner-naming.md and edits pr-review/review-checklist.md and pr-review-readiness/SKILL.md
    • Those files are restored from main as trusted steering for later AI reviewers, so this rewrites their instructions
  • Policy change
    • New rule makes a non-conforming new runner label always Request Changes, a project-level restriction a human should approve
  • CI plumbing
    • Extends the prompt_hash input list in .github/workflows/hardened-pr-review-run.yml and pinned sets in scripts/pr_review/test_workflow_contract.py

reason: not_trivial
Reviewed commit: 11f24c6

Inference job

🐛 Report a wrong verdict

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label Oct 1, 2026
@jeanschmidt
jeanschmidt requested a review from huydhn October 1, 2026 16:31

@huydhn huydhn left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I was thinking how to enforce the new runner label the other day, and was considering between this or a new linter. This is probably neater.

@jeanschmidt

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 1, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

This PR (#199315) was merged in ec7e3c0 but it is still open, likely due to a Github bug, so mergebot is closing it manually. If you think this is a mistake, please feel free to reopen and contact Dev Infra.

nkhasbag-nv pushed a commit to nkhasbag-nv/pytorch that referenced this pull request Oct 1, 2026
…rd (pytorch#199315)

**Impact:** pr-review skill
**Risk:** low

## What
Adds `ci-runner-naming.md` to the pr-review skill. It checks every self-hosted runner label that a PR adds or changes against the runner naming standard from pytorch/ci-infra. A non-conforming label that no other CI in this repo uses gets Request Changes. A non-conforming label that other CI already uses gets a short, non-blocking heads-up. GitHub-hosted runners are exempt.

## Why
New runners keep landing with labels outside the standard (legacy `linux.*` style, wrong field order, missing features and similar mistakes). Today we only catch these by hand at review time. Tooling depends on the label structure: the `rel-` marker controls access to the protected release runner group, ARC rejects names over 45 characters, and HUD queue-time queries and queue alerts rely on the `l-` segment. Putting the rule in the pr-review skill means both AI reviewers enforce it from trusted `main`.

Most of the file is a procedure, not just the grammar, because the hard part is resolving the label a job actually runs on. That covers prefixes from the runner determinator or `runner_prefix:`, reusable-workflow defaults, test-matrix rows, ternaries and templates. The procedure then decides whether the label is new to this repo, so existing labels don't block unrelated PRs.

The other files are wiring:
- `review-checklist.md` gets a "CI Runner Labels" item that links the new file.
- `pr-review-readiness/SKILL.md` links the new file and maps blocker/heads-up to `major`/`minor`, so the readiness rubric doesn't drop the finding as a "naming preference".
- The new file is added to the `prompt_hash` list in `hardened-pr-review-run.yml` and to the pinned sets in `test_workflow_contract.py`.
Pull Request resolved: pytorch#199315
Approved by: https://github.com/huydhn
cyyever pushed a commit to BakeLab/pytorch that referenced this pull request Oct 11, 2026
…rd (pytorch#199315)

**Impact:** pr-review skill
**Risk:** low

## What
Adds `ci-runner-naming.md` to the pr-review skill. It checks every self-hosted runner label that a PR adds or changes against the runner naming standard from pytorch/ci-infra. A non-conforming label that no other CI in this repo uses gets Request Changes. A non-conforming label that other CI already uses gets a short, non-blocking heads-up. GitHub-hosted runners are exempt.

## Why
New runners keep landing with labels outside the standard (legacy `linux.*` style, wrong field order, missing features and similar mistakes). Today we only catch these by hand at review time. Tooling depends on the label structure: the `rel-` marker controls access to the protected release runner group, ARC rejects names over 45 characters, and HUD queue-time queries and queue alerts rely on the `l-` segment. Putting the rule in the pr-review skill means both AI reviewers enforce it from trusted `main`.

Most of the file is a procedure, not just the grammar, because the hard part is resolving the label a job actually runs on. That covers prefixes from the runner determinator or `runner_prefix:`, reusable-workflow defaults, test-matrix rows, ternaries and templates. The procedure then decides whether the label is new to this repo, so existing labels don't block unrelated PRs.

The other files are wiring:
- `review-checklist.md` gets a "CI Runner Labels" item that links the new file.
- `pr-review-readiness/SKILL.md` links the new file and maps blocker/heads-up to `major`/`minor`, so the readiness rubric doesn't drop the finding as a "naming preference".
- The new file is added to the `prompt_hash` list in `hardened-pr-review-run.yml` and to the pinned sets in `test_workflow_contract.py`.
Pull Request resolved: pytorch#199315
Approved by: https://github.com/huydhn
pytorchmergebot pushed a commit that referenced this pull request Oct 23, 2026
…naming check (#201579)

The pr-review runner naming check (`.agents/skills/pr-review/ci-runner-naming.md`, from #199315) flags every new self-hosted macOS label as a blocker. That's how `macos-m2-27` was flagged on #201517. But these runners aren't OSDC runners, and their `macos-m*` labels follow their own convention.

This PR keeps them in scope and accepts their form. It matches how the runner install playbook in pytorch-gha-infra builds the label on each Mac:

```
^macos-m[1-9][0-9]*-([1-9][0-9]|stable)$      # macos-<chip>-<macOS major>, plus a per-chip -stable alias
```

- New section "Self-Hosted macOS Labels" with the form
- "Checking a Label", step 3: validate `macos-m*` labels against that form, not the OSDC full form or length rule
- "What to Report": for a malformed `macos-m*` label, suggest a name in the macOS form (these runners are set up by pytorch-gha-infra, not ci-infra), and scope the Apple Silicon entry in "Hardware the Standard Cannot Express" to OSDC-form labels

New chips and macOS releases pass with no further edits, and malformed macOS labels are still flagged. Every `macos-m*` label in `.github` today (`macos-m1-15`, `macos-m1-stable`, `macos-m2-26`, `macos-m2-27`) matches.

The reviewer loads this file from `main`, so the change applies to reviews after it lands. No test changes are needed: `test_workflow_contract.py` pins which files are hashed, not what they contain.

Pull Request resolved: #201579
Approved by: https://github.com/izaitsevfb, https://github.com/jeanschmidt
@github-actions
github-actions Bot deleted the jeanschmidt/pr_review_runner_name_pattern branch December 3, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants