Skip to content

Commit aa6184e

Browse files
committed
docs: add detailed auto-assign PR reviewer documentation
Add comprehensive documentation about the GitHub action for automatic PR reviewer assignment, including its behavior with CODEOWNERS, module-based assignment, and existing reviewer respect.
1 parent 3187182 commit aa6184e

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,27 @@ Developer workflow for code contributions is as follows:
9393
3. Once the code changes are staged on the fork and ready for review, a [Pull Request](https://help.github.com/en/articles/about-pull-requests) (PR) can be [requested](https://help.github.com/en/articles/creating-a-pull-request) to merge the changes from a branch of the fork into a selected branch of upstream. PRs should typically target the `main` branch.
9494
* Creation of a PR creation kicks off the code review process.
9595
* At least one TensorRT-LLM engineer will be assigned for the review. When the PR is under review, the label `Pending Review` will be added to the PR.
96-
* Reviewers are automatically requested based on the modules affected in the PR. Module paths are defined in `.github/module-paths.json` and ownership in `.github/workflows/module-owners.json`.
97-
* You can test the assignment script locally with the `--dry-run` flag:
98-
```bash
99-
GH_TOKEN=<token> BASE_SHA=<base> HEAD_SHA=<head> PR_NUMBER=<pr> \
100-
PR_AUTHOR=<username> \
101-
python3 .github/scripts/assign_reviewers.py --dry-run
102-
```
96+
97+
### Automatic Reviewer Assignment
98+
99+
Reviewers are automatically assigned to PRs through a GitHub Action that:
100+
101+
* **Triggers**: Runs automatically when PRs are opened, synchronized, or reopened
102+
* **Module-based assignment**: Maps changed files to modules using `.github/module-paths.json` and assigns reviewers based on module ownership defined in `.github/workflows/module-owners.json`
103+
* **Respects existing assignments**: Won't assign additional reviewers if any reviewers are already assigned (unless forced)
104+
* **Excludes PR author**: Automatically excludes the PR author from reviewer assignments
105+
* **Limits reviewer count**: Randomly samples up to 3 reviewers if more are eligible (configurable via `REVIEWER_LIMIT`)
106+
* **Coexists with CODEOWNERS**: Works alongside GitHub's CODEOWNERS file (`.github/CODEOWNERS`) which enforces mandatory approvals for specific paths (e.g., API stability tests, release branches)
107+
108+
The auto-assignment system analyzes all files changed in your PR, maps them to the appropriate code modules, and assigns reviewers from the module owner lists. This ensures domain experts review relevant changes while avoiding over-assignment.
109+
110+
**Testing the assignment locally**: You can test reviewer assignment with the `--dry-run` flag:
111+
```bash
112+
GH_TOKEN=<token> PR_NUMBER=<pr> PR_AUTHOR=<username> \
113+
python3 .github/scripts/assign_reviewers.py --dry-run
114+
```
115+
116+
**Manual assignment**: You can also manually trigger reviewer assignment via GitHub's workflow dispatch with options for dry-run mode and force-assignment.
103117
* If changes are requested, then the reviewer will add the label `Changes Requested` to the PR.
104118
* Once changes are approved, CI will be launched to validate the change. When CI passes, the reviewer will merge the PR.
105119
* If CI reports any failures, it's up to the requester to fix any CI failures before requesting another review.

0 commit comments

Comments
 (0)