Skip to content

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Sep 30, 2025

As we discussed in #2172 and in #t-compiler/contrib-private > RFC: triagebot parsing command aliases the way labels are applied in relabel is weird when the same label is used multiple times.

This PR makes the behavior more user friendly by pre-computing a "final state" where all the label deltas are applied from left to right, meaning that +label -label/-label +label would cancel each other instead of using the issue state.

Best reviewed commit by commit.

@Urgau Urgau requested a review from Kobzol September 30, 2025 12:43
let mut add = BTreeSet::new();
let mut remove = BTreeSet::new();

for delta in deltas {
Copy link
Member

Choose a reason for hiding this comment

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

Just a note to myself: this implementation means that doing +foo -foo -foo will actually remove foo from the issue. This is probably useful for something like alias -foo, where alias does +foo -foo.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, and it also means that +foo +foo -foo does nothing (+foo +foo -> +foo and +foo -foo cancels each other out).

@Urgau Urgau added this pull request to the merge queue Sep 30, 2025
Merged via the queue into rust-lang:master with commit a46114b Sep 30, 2025
3 checks passed
@Urgau Urgau deleted the relabel-deltas-left-right branch September 30, 2025 13:09
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