Skip to content

ci: set the CI label automatically; only maintainers can override it - #5345

Merged
terrykong merged 7 commits into
mainfrom
terryk/auto-ci-label
Nov 21, 2026
Merged

terrykong merged 7 commits into
mainfrom
terryk/auto-ci-label

Conversation

@terrykong

@terrykong terrykong commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator
  • I, the PR author, have personally reviewed every line of this PR.

What and why

Authors (and their agents) often pick the wrong CI:* label: recipe changes marked CI:docs skip the config checks, and dependency bumps run at CI:Lfast. This PR sets the label automatically, and only maintainers can override it.

A new Set CI label workflow picks the label from the changed files on every PR event. First match wins:

Changed files Label
any pyproject.toml, uv.lock, Dockerfile*, docker/**.sh, docker/**.py, 3rdparty/** CI:L1
only *.md, docs/**, skills/**, or .github/** files the main CI run doesn't read CI:docs
anything else, including the .github/ files the main CI run reads (MAIN_CI_FILES) CI:Lfast
  • A CI:* or Skip CICD label set by a repo maintainer (admin or maintain role) stays until a push changes the bot's own pick.
  • A label anyone else sets is replaced. The bot explains in one PR comment that it edits in place.
  • The bot never picks CI:L0 or CI:L2. A maintainer sets those, and CI:L1 for broad core changes.

It runs on pull_request_target from the default branch, reads the script from that same commit, and never checks out the PR's code. The rules live in .github/scripts/ci_label.py (stdlib only), so other CI systems can reuse them. skills/cicd and CONTRIBUTING.md now say the label is automatic.

Issues

None

Convergence / perf / functionality proof

N/A: CI only; no training code changes.

  • Backtest on the 261 PRs merged since 2026-10-20: the rules agree with the human-chosen label on 190. Most misses are labels set too low (see What and why). The 22 broad core changes that humans sent to CI:L1 still need a maintainer.
  • tests/unit/test_ci_label.py: 20 passed.
  • Tried on a fork with real PRs (trigger switched to pull_request there, since pull_request_target reads the default branch). Docs-only got CI:docs, code got CI:Lfast, a push adding uv.lock switched to CI:L1. A maintainer's CI:L1 survived a docs-only push and was replaced after a push that changed the pick. No run failed. Not tried live: a non-maintainer's label (only one account on the fork); unit tests cover it.

Needs upstream changes

None

PR commands and CI
  • /ok to test <full-commit-sha>: start CI for that commit. Post again after each push.
  • /review: automated review comments. Add mode=strict for a stricter review, reset=true for a fresh full review.
  • /resolve-conflict: Autobot merges main into this PR and resolves the conflicts.

🤖 Generated with Claude Code

A new "Set CI label" workflow picks the CI:* label from the changed
files on every PR event (first match wins): dependency, container or
3rdparty/ submodule changes -> CI:L1; only docs, skills, Autobot config
or the PR template -> CI:docs; anything else -> CI:Lfast.

A CI:* or "Skip CICD" label set by a repo maintainer (admin or maintain
role) is kept until a push changes the bot's own pick. A label anyone
else sets is replaced, and the bot explains in one PR comment that it
edits in place. The workflow runs on pull_request_target from the base
branch and never checks out PR code.

The rules live in .github/scripts/ci_label.py (stdlib only) so other CI
systems can reuse them.

Signed-off-by: Terry Kong <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the CI Relating to CI label Nov 21, 2026
@terrykong
terrykong marked this pull request as ready for review November 21, 2026 00:41
@terrykong terrykong added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Nov 21, 2026
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test a29d183

@terrykong

Copy link
Copy Markdown
Collaborator Author

/review-approve

@terrykong
terrykong enabled auto-merge (squash) November 21, 2026 00:44
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 21, 2026 00:44

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

I reviewed all five changed files and traced label selection through the affected CI jobs and quality check. The findings below cover override handling, stale reconciliation state, and missed container validation.

This was a static review. I did not execute tests or lint, and live CI results were not available. All acceptance checks below are proposed, not run. Three delegated inspections reached completion, but only one substantive report was delivered; I inspected the other two assignments directly before finishing.

Generated by Codex

Review generated by codex. This was a full review. Request a full review with /review reset=true.

Comment thread .github/scripts/ci_label.py Resolved
Comment thread .github/scripts/ci_label.py Resolved
Comment thread .github/scripts/ci_label.py Resolved
Comment thread .github/scripts/ci_label.py Resolved
Comment thread .github/scripts/ci_label.py Resolved
Comment thread .github/scripts/ci_label.py Resolved
Comment thread skills/cicd/SKILL.md Resolved
@terrykong terrykong added CI:docs Run doctest and removed CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) labels Nov 21, 2026
Workflow and script files only need CI:Lfast when the main CI run reads
them. Every other .github/ file now counts like docs. The files the main
run reads are listed in MAIN_CI_FILES.

Signed-off-by: Terry Kong <[email protected]>
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test be752a8

@terrykong

Copy link
Copy Markdown
Collaborator Author

/review-approve

@terrykong

Copy link
Copy Markdown
Collaborator Author

/resolve-conflict

terrykong and others added 2 commits November 20, 2026 17:45
- A maintainer's Skip CICD now expires on a push that changes the pick, like a CI:* override.
- With several maintainer CI:* labels, the newest one stays.
- Read labels live instead of from the event payload, and do not expire labels a maintainer set after the push.
- Edit only the bot's own marked comment, and show the kept override in it.
- Docs and the cp-to-main skill no longer tell people to set CI labels by hand on main.

Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: svcnemo-autobot <[email protected]>
@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the CI:docs Run doctest label Nov 21, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Nov 21, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/ok to test 47d14d4

@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Nov 21, 2026
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test 5b90648

@terrykong

Copy link
Copy Markdown
Collaborator Author

/review-approve

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

I checked all seven prior findings against the current source and compared the subsequent changes with the previous reviewed tree. The fixes address the earlier override-handling, reconciliation, comment-ownership and explanation failures. The updated procedures also resolve the conflicting label instructions, with an explicit release-branch exception.

One prior correctness issue is still unresolved: image-installer changes select a tier that skips rebuilding the image (C8, previously C4).

Three delegated inspections completed. I verified the remaining finding through the current classifier, container-build conditions and test action. This was a static review; I did not execute tests, lint or builds, and live CI results were unavailable. Release-branch trees were not supplied, so their workflow availability was not independently verified.

Generated by Codex

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

Comment thread .github/scripts/ci_label.py Resolved
The image build runs docker/*.sh and docker/*.py (Apptainer, Mooncake and Dynamo installers, uv cache helpers), so changing one must rebuild the image.

Signed-off-by: Terry Kong <[email protected]>
@terrykong terrykong added the CI:docs Run doctest label Nov 21, 2026
@terrykong terrykong removed the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Nov 21, 2026
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test 53379a1

@terrykong

Copy link
Copy Markdown
Collaborator Author

/review-approve

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

C8 is addressed in the current source. The updated classifier rules select CI:L1 for Docker shell and Python helpers, including the Apptainer and nested Dynamo installers. That tier enables the container-build path instead of reusing the Lfast image. The regression cases cover the added helper rules while keeping Docker documentation at CI:docs and retaining neighboring classification assertions.

I compared the subsequent changes with the previous reviewed tree and verified their affected CI paths. Three delegated inspections completed. I found no unresolved prior finding or eligible new regression within this follow-up scope.

This was a static review. I did not execute tests, lint or builds, and live CI results were unavailable.

Generated by Codex

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

@terrykong
terrykong merged commit df37d47 into main Nov 21, 2026
50 checks passed
@terrykong
terrykong deleted the terryk/auto-ci-label branch November 21, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:docs Run doctest CI Relating to CI Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants