Skip to content

ci: request suggested reviewers from CODEOWNERS # suggest: lines - #2665

Draft
kajalj22 wants to merge 7 commits into
mainfrom
suggest-reviewers
Draft

ci: request suggested reviewers from CODEOWNERS # suggest: lines#2665
kajalj22 wants to merge 7 commits into
mainfrom
suggest-reviewers

Conversation

@kajalj22

@kajalj22 kajalj22 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • .github/CODEOWNERS gains a # suggest: <pattern> @owner ... convention layered on the existing enforced lines — same path-pattern syntax, but a comment, so GitHub's own CODEOWNERS parser ignores it and it can never become a required/blocking reviewer no matter what branch protection does
  • Seeded with the path-to-team ownership map from chore: route PR reviews to owning teams via CODEOWNERS #2439 (not merged/enforced) as suggestions only
  • .github/workflows/suggest-reviewers.yml and .github/workflows/validate-codeowners-suggestions.yml are now thin callers into reusable workflows in feat: add reusable CODEOWNERS suggested-reviewer workflows FW-CI-templates#556, so the same convention is usable by any NeMo repo with a CODEOWNERS file, not just this one

What the reusable workflows do (implemented in FW-CI-templates#556)

  • suggest-reviewers: requests reviewers on the PR (visible in the Reviewers sidebar, same UI as a real CODEOWNERS request) for every # suggest: match on the PR's changed files — works for both individual users and teams. Skips a suggestion already covered by enforcement, either textually identical or an individual already on an enforced team. On a batch request failure, warns in the job log and alerts Slack, without failing the workflow.
  • validate-codeowners-suggestions: runs the shared matcher's own unit tests, warns (non-blocking) when a rule is made redundant by an earlier one covering the same paths with the same owners, and verifies every # suggest:-referenced user — directly, or via a suggested team's full membership — is a current NVIDIA-NeMo org member. Runs on every PR unconditionally, not just ones touching CODEOWNERS.

Status

Pinned to the FW-CI-templates PR's branch SHA for now (see TODOs in both workflow files) — update to a released tag once that PR merges.

Test plan

  • Open a test PR touching docker/ and confirm @anwithk is requested as a reviewer (individual case)
  • Open a test PR touching nemo_gym/sandbox/ and confirm @nvidia-nemo/gym_core is requested (team case)
  • Confirm the PR is still mergeable without those suggested reviewers approving
  • Confirm validate-codeowners-suggestions fails if a # suggest: line references a non-org-member, and warns (non-blocking) on a redundant rule

Adds .github/CODEOWNERS_SUGGESTIONS (mirrors the ownership map from
PR #2439) and a suggest-reviewers workflow that posts suggested
reviewers as a PR comment based on changed files. Suggestion only —
does not request reviews via the API and does not gate merges.

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 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.

Replace the separate CODEOWNERS_SUGGESTIONS file with `# suggest:`
comment lines inside .github/CODEOWNERS. GitHub's CODEOWNERS parser
ignores comment lines, so these stay non-blocking, but there's now a
single file to keep enforced and advisory reviewer info in sync.

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22 kajalj22 changed the title Suggest reviewers on PRs (advisory, non-enforced) Suggest reviewers via CODEOWNERS # suggest: lines (advisory, non-enforced) Aug 21, 2026
Call the GitHub requestReviewers API for `# suggest:` entries in
CODEOWNERS so they show up in the PR's Reviewers sidebar like a real
review request, instead of a separate comment. Still non-blocking:
only the real (non-comment) CODEOWNERS lines are covered by branch
protection's required code-owner review.

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22 kajalj22 changed the title Suggest reviewers via CODEOWNERS # suggest: lines (advisory, non-enforced) Request suggested reviewers via CODEOWNERS # suggest: lines (advisory, non-enforced) Aug 21, 2026
Replace the two placeholder `# suggest:` lines with the full
path-to-team mapping proposed in PR #2439 (not merged/enforced),
tagged as advisory-only suggestions. Teams verified to exist via the
GitHub API before adding.

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22 kajalj22 changed the title Request suggested reviewers via CODEOWNERS # suggest: lines (advisory, non-enforced) ci: request suggested reviewers from CODEOWNERS # suggest: lines Aug 21, 2026
Runs on every PR (not just ones touching CODEOWNERS) so a suggested
reviewer who has since left the org is still caught. Team entries are
expanded to every current member before checking. Reuses the
check-nvidia-sso composite action and NVIDIA_MANAGEMENT_ORG_PAT
already used elsewhere in this repo (cicd-main.yml).

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
- Skip a `# suggest:` owner that's textually identical to the
  already-enforced owner for the same file (avoids relying on a
  same-event race with GitHub's own CODEOWNERS auto-request)
- Skip a suggested individual who's already a member of a team
  enforced for the same file, via NVIDIA_MANAGEMENT_ORG_PAT
- On requestReviewers batch failure, post a Slack warning
  (SLACK_TEAM_CHANNEL_WEBHOOK) instead of only logging, without
  failing the workflow
- Normalize @NVIDIA-NeMo casing to @NVIDIA-NeMo throughout, matching
  the existing enforced lines

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Replace the Gym-local implementation with thin callers into
NVIDIA-NeMo/FW-CI-templates#556 (_suggest_reviewers.yml and
_validate_codeowners_suggestions.yml), so the same CODEOWNERS
`# suggest:` convention is reusable by any NeMo repo instead of
duplicated per-repo. Pinned to that PR's branch SHA for now; update
to a released tag once it merges.

.github/CODEOWNERS itself stays in this repo, since ownership data is
repo-specific.

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant