Skip to content

Add alias for compound labels - #2172

Merged
Urgau merged 1 commit into
rust-lang:masterfrom
apiraino:alias-for-compound-labels
Oct 21, 2025
Merged

Urgau merged 1 commit into
rust-lang:masterfrom
apiraino:alias-for-compound-labels

Conversation

@apiraino

@apiraino apiraino commented Sep 3, 2025 •

Copy link
Copy Markdown
Contributor

Discussion on #triagebot > Generic shorcut handler @ 💬).

WIP, currently blocked on a lifetime issue

Closes #1634 and #2002

@apiraino
apiraino force-pushed the alias-for-compound-labels branch 12 times, most recently from 6483af4 to fd2c1cb Compare September 5, 2025 16:09
Comment thread src/handlers/relabel.rs Outdated
@apiraino
apiraino marked this pull request as ready for review September 5, 2025 16:18
@apiraino

apiraino commented Sep 5, 2025

Copy link
Copy Markdown
Contributor Author

I think now it's ready for review. I've tested this patch on my test repository

r? triagebot

Comment thread src/handlers/relabel.rs Outdated
Comment thread src/config.rs Outdated
Comment thread src/config.rs
@apiraino

Copy link
Copy Markdown
Contributor Author

r? @Urgau when you have time, thanks.

(will rebase before merge)

@rustbot rustbot assigned Urgau and unassigned ehuss Oct 17, 2025

@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 pretty good to me. Mainly some small nits.

View changes since this review

Comment thread src/config.rs Outdated
Comment thread src/config.rs Outdated
Comment thread src/config.rs Outdated
Comment thread src/config.rs Outdated
Comment thread src/github.rs
Comment thread src/config.rs Outdated
@apiraino
apiraino force-pushed the alias-for-compound-labels branch 3 times, most recently from 7cf67bc to a38ad42 Compare October 20, 2025 12:26
@apiraino
apiraino requested a review from Urgau October 20, 2025 13:07
@apiraino
apiraino force-pushed the alias-for-compound-labels branch 4 times, most recently from 50c0ff1 to 31f0e2f Compare October 21, 2025 10:51
Comment thread src/config.rs Outdated
@apiraino
apiraino force-pushed the alias-for-compound-labels branch from 3da8091 to 8192865 Compare October 21, 2025 11:03
@apiraino

Copy link
Copy Markdown
Contributor Author

@Urgau hopefully it should be ready to merge

@apiraino
apiraino force-pushed the alias-for-compound-labels branch 2 times, most recently from 2b06b8a to c82efd6 Compare October 21, 2025 14:16

@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, modulo the unnecessary exposure of the parser internals.

View changes since this review

Comment thread src/config.rs Outdated
Comment thread src/config.rs Outdated
Comment thread src/config.rs Outdated
Comment thread parser/src/lib.rs Outdated
Comment thread src/config.rs Outdated
Configure relabel command aliases from the `triagebot.toml`.
When a valid alias is parsed, it will be replaced with the labels configured.

Example configuration:
```
[relabel.cmd-alias]
add-labels = ["Foo", "Bar"]
rem-labels = ["Baz"]
```

The command `@rustbot label cmd-alias` translates to:
```
@rustbot label +Foo +Bar -Baz
```

The command `@rustbot label -cmd-alias` translates to:
```
@rustbot label +Baz -Foo -Bar
```

Note: self-canceling labels will be omitted.
The command `@rustbot label cmd-alias +Baz` translates to:
```
@rustbot label +Foo +Bar
```
@apiraino
apiraino force-pushed the alias-for-compound-labels branch from c82efd6 to 154a7e7 Compare October 21, 2025 16:49

@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.

@Urgau
Urgau added this pull request to the merge queue Oct 21, 2025
Merged via the queue into rust-lang:master with commit 1d62ded Oct 21, 2025
3 checks passed
@apiraino
apiraino deleted the alias-for-compound-labels branch October 21, 2025 18:47
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 31, 2025
…rgau

Enable regression labeling aliases

Enabling label aliases when regressions bleed into the next release channel (nightly -> beta, beta -> stable).

This configuration enables these two aliases:
- ``@rustbot` label to-beta` (switch regression label <anything> -> beta)
- ``@rustbot` label to-stable` (switch regression label <anything> -> beta)

Pending merge of [triagebot#2172](rust-lang/triagebot#2172)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 31, 2025
…rgau

Enable regression labeling aliases

Enabling label aliases when regressions bleed into the next release channel (nightly -> beta, beta -> stable).

This configuration enables these two aliases:
- ```@rustbot`` label to-beta` (switch regression label <anything> -> beta)
- ```@rustbot`` label to-stable` (switch regression label <anything> -> beta)

Pending merge of [triagebot#2172](rust-lang/triagebot#2172)
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 1, 2025
…rgau

Enable regression labeling aliases

Enabling label aliases when regressions bleed into the next release channel (nightly -> beta, beta -> stable).

This configuration enables these two aliases:
- ````@rustbot``` label to-beta` (switch regression label <anything> -> beta)
- ````@rustbot``` label to-stable` (switch regression label <anything> -> beta)

Pending merge of [triagebot#2172](rust-lang/triagebot#2172)
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 1, 2025
…rgau

Enable regression labeling aliases

Enabling label aliases when regressions bleed into the next release channel (nightly -> beta, beta -> stable).

This configuration enables these two aliases:
- `````@rustbot```` label to-beta` (switch regression label <anything> -> beta)
- `````@rustbot```` label to-stable` (switch regression label <anything> -> beta)

Pending merge of [triagebot#2172](rust-lang/triagebot#2172)
rust-timer added a commit to rust-lang/rust that referenced this pull request Nov 1, 2025
Rollup merge of #147942 - apiraino:enable-label-aliases, r=Urgau

Enable regression labeling aliases

Enabling label aliases when regressions bleed into the next release channel (nightly -> beta, beta -> stable).

This configuration enables these two aliases:
- ```@rustbot`` label to-beta` (switch regression label <anything> -> beta)
- ```@rustbot`` label to-stable` (switch regression label <anything> -> beta)

Pending merge of [triagebot#2172](rust-lang/triagebot#2172)
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.

label names handled by the shortcut command should be configurable

3 participants