Skip to content

Conversation

apiraino
Copy link
Contributor

@apiraino apiraino commented Aug 13, 2025

This patch adds a new Zulip command:
@triagebot backport <channel> <action> <PR>

Example:

  • @triagebot backport stable accept 123456
  • @triagebot backport beta decline 654321

This can be used to post on GitHub a comment like this one when T-compiler accepts/decline to backport a patch that fixes a regression.

Limitations:

  • This command assumes that the PR is from rust-lang/rust, I am not aware of other git repos having this workflow. If we want, maybe in the future we can extend to other repos using our custom Zulip linkfiers
  • There is no check on the PR number (so if someone mistypes, the comment will go elsewhere 😅 )

Tested on a custom Zulip instance.

TODO:

  • update docs on the forge
  • Could be interesting a shorter variant of this command (f.e. backport accept or even accept) to be used from #t-compiler/backports (topics contain all necessary info to build the command parameters)

@apiraino apiraino changed the title Accept backports from zulip Accept/decline backports from zulip Aug 13, 2025
@apiraino apiraino changed the title Accept/decline backports from zulip Accept/decline T-compiler backports from zulip Aug 13, 2025
@apiraino apiraino force-pushed the accept-backports-from-zulip branch from a42cf9d to b265ac9 Compare August 13, 2025 10:58
@apiraino apiraino changed the title Accept/decline T-compiler backports from zulip Accept/decline T-compiler backports from Zulip Aug 13, 2025
@apiraino apiraino marked this pull request as ready for review August 13, 2025 11:17
},
content: "",
};
let zulip_link = zulip_send_req.url(zulip_client);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: for how the Message API works today, we can't pin exactly a single message so the link in the GitHub comment will be to the whole topic, which is a bit inconvenient but hopefully will be solved by Zulip. I'd rather wait on them for a correct fix rather us add hacks to make it work.

@apiraino apiraino force-pushed the accept-backports-from-zulip branch from b265ac9 to 80d4110 Compare August 19, 2025 15:12
@apiraino
Copy link
Contributor Author

apiraino commented Sep 6, 2025

I guess this patch went under the radar because I didn't request a review

r? triagebot

Copy link
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds pretty useful!

View changes since this review

#[derive(clap::Parser, Debug, PartialEq, Clone)]
pub struct BackportArgs {
/// Release channel this backport is pointing to. Allowed: "beta" or "stable".
pub channel: String,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use an enum here for the channel and the verb, and either generate the parser with #[derive(clap::ValueEnum)], or write it manually with FromStr? That way we won't have to check for invalid data in the backport handler, and we'll get a nice error message and a hint (in case of misspelling) for free.

@apiraino apiraino force-pushed the accept-backports-from-zulip branch 4 times, most recently from 05aa91f to 6d99fff Compare September 19, 2025 19:05
@apiraino apiraino force-pushed the accept-backports-from-zulip branch 3 times, most recently from 5861437 to f32c8db Compare September 19, 2025 19:19
@apiraino apiraino force-pushed the accept-backports-from-zulip branch from f32c8db to f373c3c Compare September 19, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants