Skip to content

Commit dde9a45

Browse files
authored
Merge pull request #853 from Kobzol/review-queue-tracking
Document triagebot review queue tracking
2 parents 1c0cc60 + 9791019 commit dde9a45

File tree

4 files changed

+67
-26
lines changed

4 files changed

+67
-26
lines changed

src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- [Agenda Generator](./triagebot/agenda.md)
1616
- [Issue Assignment](./triagebot/issue-assignment.md)
1717
- [PR Assignment](./triagebot/pr-assignment.md)
18-
- [Tracking PR assignment](./triagebot/pr-assignment-tracking.md)
18+
- [Review queue tracking](triagebot/review-queue-tracking.md)
1919
- [Autolabels](./triagebot/autolabels.md)
2020
- [Behind Upstream](./triagebot/behind-upstream.md)
2121
- [Canonicalize Issue Links](./triagebot/canonicalize-issue-links.md)

src/triagebot/pr-assignment-tracking.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/triagebot/pr-assignment.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
Triagebot handles automatic and manual assignment of GitHub PRs.
44
It also handles welcoming new users when they post a PR.
55

6-
Rust contributors can track and manage their own work queue using the Zulipchat integration. See [Tracking PR assignment](/triagebot/pr-assignment-tracking.md).
6+
Contributors to the `rust-lang/rust` repository can track and manage their own work queue using Zulip integration. See [Review queue tracking](review-queue-tracking.md).
7+
8+
You can check which pull requests in the `rust-lang` organization are assigned to you at this [GitHub URL](https://github.com/pulls?q=org%3Arust-lang+is%3Aopen+is%3Apr+assignee%3A%40me+archived%3Afalse).
79

810
## Usage
911

@@ -85,6 +87,8 @@ If a reviewer wants to temporarily prevent themselves from being assigned (autom
8587
users_on_vacation = ["jyn514", "ChrisDenton"]
8688
```
8789

90+
On `rust-lang/rust`, you can also configure vacation using [Zulip integration](review-queue-tracking.md#usage).
91+
8892
### Additional new PR trigger options
8993

9094
Triagebot will also post a welcome message to the user.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Review queue tracking
2+
3+
Triagebot supports more advanced tracking of reviewers' workload in the `rust-lang/rust` repository. It tracks how many "relevant" pull requests are assigned to each reviewer, and allows reviewers to configure maximum capacity of such PRs, and also if they want to be automatically assigned or not.
4+
5+
This page describes how the review queue works and how you can interact with `triagebot` on Zulip to configure and examine the review queue.
6+
7+
## Configuration
8+
9+
To enable review queue tracking for a repository, include `[pr-tracking]` table in its `triagebot.toml`.
10+
11+
To take the review queue into account when assigning reviewers on PRs, add a `[assign.review_prefs]` table to `triagebot.toml`.
12+
13+
> Note that this functionality currently only works for the `rust-lang/rust` repository (it is hardcoded in `triagebot`). Enabling it for more repositories requires additional design and implementation work.
14+
15+
## Review queue design
16+
17+
The review queue remembers how many "relevant" `rust-lang/rust` PRs are assigned to each reviewer at any given point in time.
18+
Currently, the heuristic for what makes a PR "relevant" works as follows:
19+
- The PR must not be blocked (it must not have the `S-blocked` or `S-inactive` labels).
20+
- The PR must not be a rollup.
21+
- The PR must be waiting for a reviewer (must have the `S-waiting-on-review` label).
22+
- The PR must be assigned to someone else than the PR author.
23+
- The PR must be open and not a draft.
24+
25+
If a PR passes all these checks and it is assigned to reviewer `R`, it will be considered to be in `R`'s review queue.
26+
27+
See the implementation of the [`waits_for_a_review`](https://github.com/rust-lang/triagebot/blob/7044e5449aaf29eea939bc7db81c63b7c872b9b8/src/handlers/pr_tracking.rs#L277-L304) function in triagebot for more details.
28+
29+
## Review preferences
30+
31+
Reviewers can configure *review preferences* that are taken into account when determining who to assign on a PR:
32+
- Review queue capacity (`C`) --- if the number of PRs in your review queue is at (or above) `C`, `triagebot` will not assign new pull requests to you.
33+
- Rotation mode (`on` or `off` rotation) --- if you set your rotation mode to be `off`, `triagebot` will not assign new pull requests to you.
34+
- This is an alternative to setting yourself as being ["on vacation"](pr-assignment.md#vacation) which does not require sending a pull request to modify the `triagebot.toml` file. `triagebot` takes both `users_on_vacation` in `triagebot.toml` and the rotation mode into account; if you are marked as being on vacation in either of them, it will not assign PRs to you.
35+
36+
Note that the review preferences only affect assignment based on adhoc groups or teams. If someone directly requests your review (`r? <user>`), triagebot will currently always assign you. If you are off rotation or at your maximum review capacity, triagebot will send a comment to the PR where you were directly assigned to let the PR author know that you might not be available for a timely review.
37+
38+
## Usage
39+
40+
You can examine your review queue and configure your review preferences by sending a DM (Direct Message) to the `triagebot` bot account on the [Zulip chat](../platforms/zulip.md). You can open a DM session with the `triagebot` bot by clicking on [this link](https://rust-lang.zulipchat.com/#narrow/dm/261224-triagebot) (requires Zulip login).
41+
42+
You can send a message with one of these commands to `triagebot`:
43+
44+
- `work help` --- Show the available commands.
45+
- `work show` --- Show the contents of your review queue (in the `rust-lang/rust` repository) and your review preferences.
46+
- `work set-pr-limit <number>|unlimited` --- Set your review capacity to `<number>` or remove the capacity limit (`unlimited`).
47+
- `work set-rotation-mode off|on` --- Set your rotation mode to be `on` or `off`.
48+
49+
You can also run the above commands on behalf of other GitHub users with the following message:
50+
51+
```
52+
as <github-username> <command>
53+
# e.g.
54+
as MyFavouriteGitHubUser work show
55+
```
56+
57+
`triagebot` will notify the user that you have executed a command on their behalf. Note that this functionality is intended for rare occasions or debugging, please do not use it often.
58+
59+
## Implementation
60+
61+
See [`src/handlers/pr_tracking.rs`](https://github.com/rust-lang/triagebot/blob/HEAD/src/handlers/pr_tracking.rs).

0 commit comments

Comments
 (0)