ci: request suggested reviewers from CODEOWNERS # suggest: lines - #2665
Draft
kajalj22 wants to merge 7 commits into
Draft
ci: request suggested reviewers from CODEOWNERS # suggest: lines#2665kajalj22 wants to merge 7 commits into
# suggest: lines#2665kajalj22 wants to merge 7 commits into
Conversation
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>
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>
# suggest: lines (advisory, non-enforced)
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>
# suggest: lines (advisory, non-enforced)# suggest: lines (advisory, non-enforced)
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>
# suggest: lines (advisory, non-enforced)# suggest: lines
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/CODEOWNERSgains 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.github/workflows/suggest-reviewers.ymland.github/workflows/validate-codeowners-suggestions.ymlare 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 oneWhat the reusable workflows do (implemented in FW-CI-templates#556)
# 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.# 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
docker/and confirm@anwithkis requested as a reviewer (individual case)nemo_gym/sandbox/and confirm@nvidia-nemo/gym_coreis requested (team case)# suggest:line references a non-org-member, and warns (non-blocking) on a redundant rule