Skip to content

PR review bot#3326

Open
souvikghosh04 wants to merge 18 commits intomainfrom
Usr/sogh/prreviewbot
Open

PR review bot#3326
souvikghosh04 wants to merge 18 commits intomainfrom
Usr/sogh/prreviewbot

Conversation

@souvikghosh04
Copy link
Copy Markdown
Contributor

@souvikghosh04 souvikghosh04 commented Mar 26, 2026

Why make this change?

Automate PR reviewer assignment to distribute review workload evenly across the team instead of relying on manual assignment or CODEOWNERS (which adds all owners).

What is this change?

Adds auto-assign-reviewers.yml, a label-driven GitHub Actions workflow that assigns exactly 2 reviewers per PR using load-balanced selection.

High-level workflow steps-

  1. Fetches all open PRs → filters to eligible ones (label + non-draft + fresh)
  2. Reads pr.assignees for each PR → determines who's already assigned
  3. Calls listReviews for PRs with assignees → determines who's actively reviewing vs freed
  4. Builds load map from scratch → sums active review weights per reviewer
  5. Assigns based on current state

How is this tested?

  • Tested with DRY_RUN and non-DRY_RUN mode and validated the assigned reviewers.

@souvikghosh04 souvikghosh04 self-assigned this Mar 26, 2026
@souvikghosh04 souvikghosh04 marked this pull request as ready for review March 26, 2026 17:38
Copilot AI review requested due to automatic review settings March 26, 2026 17:38
@souvikghosh04 souvikghosh04 added this to the April 2026 milestone Mar 26, 2026
@souvikghosh04 souvikghosh04 linked an issue Mar 26, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a GitHub Actions workflow intended to automatically assign reviewers to PRs based on labels and a simple load-balancing heuristic.

Changes:

  • Introduces .github/workflows/auto-assign-reviewers.yml to select and request reviewers when PRs are opened/updated/labeled.
  • Implements label-based eligibility (assign-for-review) and weighting (size-*, priority-high) to prioritize larger/higher priority PRs.
  • Tracks current reviewer “load” across open PRs to pick the least-loaded candidates.

@souvikghosh04 souvikghosh04 moved this from Todo to In Progress in Data API builder Mar 27, 2026
@aaronburtle aaronburtle self-assigned this Mar 28, 2026
@aaronburtle aaronburtle moved this from In Progress to Review In Progress in Data API builder Mar 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


---

## Team Communication
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Team Communication need not be checked in


| # | Item | Owner | Status |
|---|---|---|---|
| 1 | **Decide on Aniruddh's inclusion** — remove to reduce his load, or keep as equal | Team | Pending |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Keep me included in the reviewers section, this way I can help distribute the load of reviewing as per the bot.


---

## Open Items
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This Open Items should not be checked in


---

## Changelog
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ChangeLog neednot be checked in

pull_request_target:
types: [opened, reopened, labeled]

# TODO: Remove before merging — temporary trigger for testing from PR branch.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This TO DO comment needs to be removed. Even if I approve now, and this merges, it will not trigger the workflow even if folks add the label to their PRs.

Copy link
Copy Markdown
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

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

This workflow is getting triggered only on pushing to the Usr/sogh/prreviewbot branch, so none of us could test it while you were away,

Better would have been to merge it in without that condition so it could become LIVE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review In Progress

Development

Successfully merging this pull request may close these issues.

Automated PR review assignment bot

5 participants