Skip to content

Add support for @bot claim @user to assign to another user - #2456

Merged
Urgau merged 4 commits into
rust-lang:masterfrom
DanielEScherzer:claim-another
Jul 14, 2026
Merged

Add support for @bot claim @user to assign to another user#2456
Urgau merged 4 commits into
rust-lang:masterfrom
DanielEScherzer:claim-another

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Contributor

Fixes #2451

So that when this command works to assign another user the difference is clear
in tests.
…n-user

So that when we add support for `@bot claim @user` we don't accidentally
introduce errors when `@bot claim` is followed by a non-username.

@Kobzol Kobzol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi, thanks for the PR. Left one question.

View changes since this review

Comment thread parser/src/command/assign.rs Outdated
impl AssignCommand {
pub fn parse<'a>(input: &mut Tokenizer<'a>) -> Result<Option<Self>, Error<'a>> {
pub fn parse<'a>(
bots: &Vec<&'a str>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do you filter out bots? I don't think we do that elsewhere, or do we?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not aware either of any other place where we stop parsing at a bot handle. Generally, when we want to stop parsing we look for a punctuation like ..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wanted to ensure commands like @rustbot claim @rustbot label +bug continued to be parsed as two different commands rather than assigning the bot itself

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's not consistent with what we do for other commands here, I think. bors does stop at @ to let other bots handle the rest of the line, but triagebot AFAIK doesn't, and to add insult to injury, it actually requires @ to be present before usernames for the assign (and now claim) commands, which is IMO unnecessary.

Please remove the bot handling, we don't do it elsewhere in triagebot.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, removed - it turns out that the bot still handles the labeling after the assignment, see the changes in test_follow_commands()

@Kobzol Kobzol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks fine to me, I'll leave @Urgau to take a look if you want.

View changes since this review

@Urgau Urgau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me as well. Thanks.

View changes since this review

@Urgau
Urgau added this pull request to the merge queue Jul 14, 2026
Merged via the queue into rust-lang:master with commit 714dd19 Jul 14, 2026
3 checks passed
@DanielEScherzer
DanielEScherzer deleted the claim-another branch July 14, 2026 19:19
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.

@rustbot claim @user should assign to @user

3 participants