Fundamentals: Automatically request reviewers - #375
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds automation to request a predefined set of reviewers when a pull request is opened (or marked ready for review), aiming to broaden reviewer coverage for PRs in this repository.
Changes:
- Updates
CODEOWNERSto change the default owners for all paths. - Adds a GitHub Actions workflow that requests a specific list of reviewers on PR open / ready-for-review.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
CODEOWNERS |
Adjusts global code owner assignments (default * pattern). |
.github/workflows/auto-request-reviewers.yml |
Introduces an action to auto-request reviewers on PR lifecycle events. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #375 +/- ##
=======================================
Coverage 94.69% 94.69%
=======================================
Files 111 111
Lines 20860 20860
=======================================
Hits 19753 19753
Misses 1107 1107
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (3)
CODEOWNERS:1
- The PR description says this change is to add a larger reviewer group, but this CODEOWNERS update removes
@najams(reducing the default reviewer/owner set). If that removal is not intentional, add them back; otherwise, update the PR description to reflect that CODEOWNERS is being narrowed while a workflow handles broader review requests.
* @kjohn-msft @rane-rajasi
.github/workflows/auto-request-reviewers.yml:14
- This workflow will still run on PRs opened as drafts (because
openedfires for draft PRs) and will also fail for PRs from forks becausepull_requestworkflows get a read-only GITHUB_TOKEN even ifpull-requests: writeis requested. Add a job-levelif:to skip draft-on-open and skip fork PRs (or switch topull_request_targetwith appropriate hardening).
jobs:
request-reviewers:
.github/workflows/auto-request-reviewers.yml:27
- Reviewers are hard-coded as individual usernames; this is brittle (renames/offboarding cause failures) and requires a code change for routine updates. If possible, prefer requesting a GitHub team via
team_reviewers(or sourcing the list from a single maintained place).
const reviewers = [
'GAURAVRAMRAWOCHYANI',
'kjohn-msft',
'michellemcdeniel',
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (4)
CODEOWNERS:1
- This change removes
@najamsfrom CODEOWNERS, which reduces the default reviewer/owner coverage and seems to conflict with the PR goal of adding a larger reviewer group. If this removal isn’t intentional, revert it (or update the PR description to match the intent).
* @kjohn-msft @rane-rajasi
.github/workflows/auto-request-reviewers.yml:16
- The workflow triggers on
pull_request: opened, which also fires for draft PRs. As written, reviewers will be requested even when the PR is still a draft; the usual intent is to wait until it’s ready_for_review.
jobs:
request-reviewers:
runs-on: ubuntu-latest
.github/workflows/auto-request-reviewers.yml:8
- Including the
synchronizeevent will re-run this job on every push to the PR and re-callpulls.requestReviewers, creating redundant API calls and potentially repeated notifications. If re-requesting isn’t required, dropsynchronize(or add logic to only request reviewers who aren’t already requested).
pull_request:
types:
- opened
- ready_for_review
- synchronize
.github/workflows/auto-request-reviewers.yml:33
- The reviewer set is hard-coded in the workflow. To avoid code changes whenever membership changes, consider requesting a GitHub team via
team_reviewers(or sourcing the list from a versioned config) so the reviewer group can be managed centrally.
const reviewers = [
'GAURAVRAMRAWOCHYANI',
'kjohn-msft',
'michellemcdeniel',
'mirichno',
'nikhim-um',
'rane-rajasi',
'SathishMSFT',
'yashnap'
];
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/auto-request-reviewers.yml:15
- This workflow will fail for pull requests opened from forks because the
pull_requestevent uses a read-onlyGITHUB_TOKENin that scenario, sopulls.requestReviewerscannot write reviewer requests. Add a job-level condition to skip forked PRs (or switch topull_request_targetwith appropriate hardening).
request-reviewers:
runs-on: ubuntu-latest
CODEOWNERS:1
- The PR description only mentions adding an auto-reviewer workflow, but this change also removes
@najamsfrom CODEOWNERS, which will reduce automatic code-owner review requests. If this removal isn't intentional, restore the entry; otherwise update/split the PR so the ownership change is explicitly documented.
* @kjohn-msft @rane-rajasi
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
CODEOWNERS:3
CODEOWNERScurrently includes extra trailing blank/whitespace-only lines. This can create noisy diffs and may confuse tooling that validates CODEOWNERS formatting.
Rajasi Rane (rane-rajasi)
left a comment
There was a problem hiding this comment.
One comment
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
CODEOWNERS:3
CODEOWNERScurrently ends with extra blank/whitespace-only lines. While GitHub typically ignores blank lines, keeping the file to only meaningful entries avoids accidental whitespace-only lines and reduces churn in future edits.
* @kjohn-msft @rane-rajasi @mirichmo
This is to incorporate a workflow to automatically add a larger reviewer group to PRs.
Adds backup org owner due to org changes.