From 0c1953d95f639c1ef66ff6f79b7e17ffcec837fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 29 May 2025 10:41:07 +0200 Subject: [PATCH 1/3] Document Zulip commands --- src/SUMMARY.md | 1 + src/triagebot/notifications.md | 6 +--- src/triagebot/review-queue-tracking.md | 21 +++-------- src/triagebot/zulip-commands.md | 48 ++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 22 deletions(-) create mode 100644 src/triagebot/zulip-commands.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 7b069575e..cb082964e 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -42,6 +42,7 @@ - [Rustc Commit Tracking](./triagebot/rustc-commit-list.md) - [Shortcuts](./triagebot/shortcuts.md) - [Triagebot Dashboard](./triagebot/triage-dashboard.md) + - [Zulip Commands](./triagebot/zulip-commands.md) - [Zulip Meeting Management](./triagebot/zulip-meeting.md) - [Zulip Notifications](./triagebot/zulip-notifications.md) - [GitHub Actions created PR open/closer](./triagebot/bot-pull-requests.md) diff --git a/src/triagebot/notifications.md b/src/triagebot/notifications.md index 71f51f2b5..cfc78558a 100644 --- a/src/triagebot/notifications.md +++ b/src/triagebot/notifications.md @@ -10,7 +10,7 @@ Each registered team member has a notifications page at: 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. -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). +The notifications list can also be edited via Zulip by [private-messaging triagebot](zulip-commands.md#direct-message-commands). Any Rust organization member can edit their notifications page, or pages of other Rust organization team members. 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/). 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`. This adds some text as a sub-bullet to the notification at `idx`. If the metadata is empty, the text is removed. - * `as ` - -This executes any of the above commands as if you were the other GitHub user. - ## Configuration There is no configuration for this feature. diff --git a/src/triagebot/review-queue-tracking.md b/src/triagebot/review-queue-tracking.md index 050d3f4c9..788c99751 100644 --- a/src/triagebot/review-queue-tracking.md +++ b/src/triagebot/review-queue-tracking.md @@ -37,24 +37,11 @@ Note that the review preferences only affect assignment based on adhoc groups or ## Usage -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). +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`: -You can send a message with one of these commands to `triagebot`: - -- `work help` --- Show the available commands. -- `work show` --- Show the contents of your review queue (in the `rust-lang/rust` repository) and your review preferences. -- `work set-pr-limit |unlimited` --- Set your review capacity to `` or remove the capacity limit (`unlimited`). -- `work set-rotation-mode off|on` --- Set your rotation mode to be `on` or `off`. - -You can also run the above commands on behalf of other GitHub users with the following message: - -``` -as -# e.g. -as MyFavouriteGitHubUser work show -``` - -`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. +- `work show`: Show the contents of your review queue (in the `rust-lang/rust` repository) and your review preferences. +- `work set-pr-limit |unlimited`: Set your review capacity to `` or remove the capacity limit (`unlimited`). +- `work set-rotation-mode off|on`: Set your rotation mode to be `on` or `off`. ## Implementation diff --git a/src/triagebot/zulip-commands.md b/src/triagebot/zulip-commands.md new file mode 100644 index 000000000..3f402b51a --- /dev/null +++ b/src/triagebot/zulip-commands.md @@ -0,0 +1,48 @@ +# Triagebot Zulip commands + +You can send commands to triagebot on the [Rust Zulip](https://rust-lang.zulipchat.com) server using two separate mechanisms: + +- Sending a direct message (DM) to the [triagebot][triagebot-dm] account. +- Sending a message in some stream by tagging `@triagebot`, followed by a command (e.g. `@triagebot end-meeting`). + +Triagebot commands can only be sent by users that are in the [team](https://github.com/rust-lang/team) database. + +## Direct message commands + +You can send these commands as a direct message to the [triagebot][triagebot-dm] account. + +- `whoami`: shows the Rust teams that you are a part of +- `lookup github `: lookup the GitHub username of a user by their Zulip name +- `lookup zulip `: lookup the Zulip name of a user by their GitHub username +- Reviewer workqueue commands, which are documented [here](review-queue-tracking.md#usage). +- Notification commands, which are documented [here](notifications.md#usage). + +You can use the `--help` flag or a `help` subcommand for any of these commands to find out more about their parameters. + +### Impersonation + +You can also run the above commands on behalf of other GitHub users with the following message: + +```text +as +# e.g. +as MyFavouriteGitHubUser work show +``` + +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. + +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. + +## Stream commands + +- *Meeting* commands serve for controlling the flow of Zulip meetings. They are documented [here](zulip-meeting.md). +- *Rust Project Goals* commands serve for controlling Rust Project Goal tracking. + - `@triagebot ping-goals `: TODO +- *Docs update* commands serve for updating documentation + - `@triagebot docs-update`: TODO + +## Implementation + +See [`src/zulip.rs`](https://github.com/rust-lang/triagebot/blob/HEAD/src/zulip.rs). + +[triagebot-dm]: https://rust-lang.zulipchat.com/#narrow/dm/261224-triagebot From 3d26724d5de80d05524c8662a557ee8afa5051f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 6 Jun 2025 16:40:05 +0200 Subject: [PATCH 2/3] Add explanation of docs update and ping goals Co-authored-by: Eric Huss --- src/triagebot/zulip-commands.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/triagebot/zulip-commands.md b/src/triagebot/zulip-commands.md index 3f402b51a..7dce26468 100644 --- a/src/triagebot/zulip-commands.md +++ b/src/triagebot/zulip-commands.md @@ -37,9 +37,8 @@ Note that the impersonation functionality is intended for inspecting the status - *Meeting* commands serve for controlling the flow of Zulip meetings. They are documented [here](zulip-meeting.md). - *Rust Project Goals* commands serve for controlling Rust Project Goal tracking. - - `@triagebot ping-goals `: TODO -- *Docs update* commands serve for updating documentation - - `@triagebot docs-update`: TODO + - `@triagebot ping-goals `: 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 `` days. `` is a string to say when the next blog update will start. +- `@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). ## Implementation From 5e4a7986aba4da4181f3d49760b616074ff79fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 10 Jun 2025 12:26:21 +0200 Subject: [PATCH 3/3] Document `team-stats` --- src/triagebot/zulip-commands.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/triagebot/zulip-commands.md b/src/triagebot/zulip-commands.md index 7dce26468..d4f038780 100644 --- a/src/triagebot/zulip-commands.md +++ b/src/triagebot/zulip-commands.md @@ -14,6 +14,7 @@ You can send these commands as a direct message to the [triagebot][triagebot-dm] - `whoami`: shows the Rust teams that you are a part of - `lookup github `: lookup the GitHub username of a user by their Zulip name - `lookup zulip `: lookup the Zulip name of a user by their GitHub username +- `team-stats `: show the review workqueue statistics of all members of the given team - Reviewer workqueue commands, which are documented [here](review-queue-tracking.md#usage). - Notification commands, which are documented [here](notifications.md#usage).