Skip to content

Commit 7fd2d25

Browse files
committed
Document triagebot review queue tracking
1 parent 4356ba9 commit 7fd2d25

File tree

4 files changed

+55
-26
lines changed

4 files changed

+55
-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: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Review queue tracking
2+
3+
Triagebot supports more advanced tracking of reviewers' workload in the `rust-lang` 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 pages 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 only 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/HEAD/src/handlers/pr_tracking.rs#L289) 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. It will also not be possible to `r?` 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. It will also not be possible to `r?` 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+
## Usage
37+
38+
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).
39+
40+
You can send a message with one of these commands to `triagebot`:
41+
42+
- `work help` --- Show the available commands.
43+
- `work show` --- Show the contents of your review queue (in the `rust-lang/rust` repository) and your review preferences.
44+
- `work set-pr-limit <number>|unlimited` --- Set your review capacity to `<number>` or remove the capacity limit (`unlimited`).
45+
- `work set-rotation-mode off|on` --- Set your rotation mode to be `on` or `off`.
46+
47+
## Implementation
48+
49+
See [`src/handlers/pr_tracking.rs`](https://github.com/rust-lang/triagebot/blob/HEAD/src/handlers/pr_tracking.rs).

0 commit comments

Comments
 (0)