Conversation
|
Error: Label E-needs-mcve can only be set by Rust team members Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
|
@JojoFlex1 did you (or could you) test this change? Self-assigning for review. thanks |
|
@apiraino at first i ran cargo build and cargo test relabel and all 7 tests passed. So now i added a unit test specifically for the case-insensitive matching in src/github/issue.rs. |
| .find(|existing| existing.name.to_lowercase() == l.name.to_lowercase()) | ||
| .cloned() | ||
| }) | ||
| .collect(); |
There was a problem hiding this comment.
this isn't a unit test because you aren't testing you code. I.e. you aren't calling a function of your code.
|
@marcoieni I extracted the filtering logic into a helper function find_label_case_insensitive and updated the test to call it directly. |
@JojoFlex1 End-to-end testing is detailed in the README. If you find yourself not being able to do that, I'll get around to it (but not immediately). |
|
@apiraino okay sure |
So like when removing labels using @rustbot label -E-needs-mcve, the removal fails for labels with capital letters. This is cause the comparison in remove_labels was case-sensitive so -e-needs-mcve wouldn't match E-needs-mcve on the issue.
Adding labels works fine because GitHub's API handles case-insensitivity on their end. But removing requires an exact match with the label name as it exists on GitHub.
Now
Changed filter and contains to filter_map + find with a case-insensitive comparison. This also ensures we use the actual label name from the issue in the DELETE request, not the user-typed version.
#2214