Skip to content

Commit b6a25cd

Browse files
authored
Merge pull request #877 from Kobzol/zulip-commands
Document Zulip commands
2 parents 63f601c + 5e4a798 commit b6a25cd

File tree

4 files changed

+54
-22
lines changed

4 files changed

+54
-22
lines changed

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
- [Rustc Commit Tracking](./triagebot/rustc-commit-list.md)
4343
- [Shortcuts](./triagebot/shortcuts.md)
4444
- [Triagebot Dashboard](./triagebot/triage-dashboard.md)
45+
- [Zulip Commands](./triagebot/zulip-commands.md)
4546
- [Zulip Meeting Management](./triagebot/zulip-meeting.md)
4647
- [Zulip Notifications](./triagebot/zulip-notifications.md)
4748
- [GitHub Actions created PR open/closer](./triagebot/bot-pull-requests.md)

src/triagebot/notifications.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Each registered team member has a notifications page at:
1010

1111
Whenever you are mentioned on GitHub with a direct mention (`@user`) or via a team mention (`@rust-lang/libs`) anywhere in the rust-lang organization, this will add an entry to the notifications list.
1212

13-
The notifications list can also be edited via Zulip by [private-messaging triagebot](https://rust-lang.zulipchat.com/#narrow/pm-with/261224-triage-rust-lang-bot).
13+
The notifications list can also be edited via Zulip by [private-messaging triagebot](zulip-commands.md#direct-message-commands).
1414
Any Rust organization member can edit their notifications page, or pages of other Rust organization team members.
1515
To do so, the editor must have a `zulip-id` listed in their `people/username.toml` file in the [team repository](https://github.com/rust-lang/team/).
1616
The bot will tell you which ID to use when talking to it for the first time; please `r? @Mark-Simulacrum` on PRs adding Zulip IDs.
@@ -38,10 +38,6 @@ This moves the notification at index `from` to the index `to`.
3838

3939
This adds some text as a sub-bullet to the notification at `idx`. If the metadata is empty, the text is removed.
4040

41-
* `as <github username> <command...>`
42-
43-
This executes any of the above commands as if you were the other GitHub user.
44-
4541
## Configuration
4642

4743
There is no configuration for this feature.

src/triagebot/review-queue-tracking.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,11 @@ Note that the review preferences only affect assignment based on adhoc groups or
3737

3838
## Usage
3939

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).
40+
You can examine your review queue and configure your review preferences by sending a [Direct Message command](zulip-commands.md#direct-message-commands) to `triagebot`:
4141

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.
42+
- `work show`: Show the contents of your review queue (in the `rust-lang/rust` repository) and your review preferences.
43+
- `work set-pr-limit <number>|unlimited`: Set your review capacity to `<number>` or remove the capacity limit (`unlimited`).
44+
- `work set-rotation-mode off|on`: Set your rotation mode to be `on` or `off`.
5845

5946
## Implementation
6047

src/triagebot/zulip-commands.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Triagebot Zulip commands
2+
3+
You can send commands to triagebot on the [Rust Zulip](https://rust-lang.zulipchat.com) server using two separate mechanisms:
4+
5+
- Sending a direct message (DM) to the [triagebot][triagebot-dm] account.
6+
- Sending a message in some stream by tagging `@triagebot`, followed by a command (e.g. `@triagebot end-meeting`).
7+
8+
Triagebot commands can only be sent by users that are in the [team](https://github.com/rust-lang/team) database.
9+
10+
## Direct message commands
11+
12+
You can send these commands as a direct message to the [triagebot][triagebot-dm] account.
13+
14+
- `whoami`: shows the Rust teams that you are a part of
15+
- `lookup github <zulip-name>`: lookup the GitHub username of a user by their Zulip name
16+
- `lookup zulip <github-username>`: lookup the Zulip name of a user by their GitHub username
17+
- `team-stats <team-name>`: show the review workqueue statistics of all members of the given team
18+
- Reviewer workqueue commands, which are documented [here](review-queue-tracking.md#usage).
19+
- Notification commands, which are documented [here](notifications.md#usage).
20+
21+
You can use the `--help` flag or a `help` subcommand for any of these commands to find out more about their parameters.
22+
23+
### Impersonation
24+
25+
You can also run the above commands on behalf of other GitHub users with the following message:
26+
27+
```text
28+
as <github-username> <command>
29+
# e.g.
30+
as MyFavouriteGitHubUser work show
31+
```
32+
33+
If you execute a "sensitive" command in this way (i.e. a command that modifies something), `triagebot` will notify the user that you have impersonated via a direct message.
34+
35+
Note that the impersonation functionality is intended for inspecting the status (e.g. the reviewer workqueue or Rust teams) of other users or occasional debugging. Please do not use it maliciously.
36+
37+
## Stream commands
38+
39+
- *Meeting* commands serve for controlling the flow of Zulip meetings. They are documented [here](zulip-meeting.md).
40+
- *Rust Project Goals* commands serve for controlling Rust Project Goal tracking.
41+
- `@triagebot ping-goals <threshold> <next-update>`: For use by the goals team to ping goal owners on Zulip to give an update on their goal. Will not ping if there has been a comment in `<threshold>` days. `<next-update>` is a string to say when the next blog update will start.
42+
- `@triagebot docs-update`: Generates a Pull Request ([example](https://github.com/rust-lang/rust/pull/141923)) to update the documentation submodules. See [Documentation Updates](doc-updates.md).
43+
44+
## Implementation
45+
46+
See [`src/zulip.rs`](https://github.com/rust-lang/triagebot/blob/HEAD/src/zulip.rs).
47+
48+
[triagebot-dm]: https://rust-lang.zulipchat.com/#narrow/dm/261224-triagebot

0 commit comments

Comments
 (0)