From 5e14585146dc3130a0088a4d68013162978182bc Mon Sep 17 00:00:00 2001 From: JojoFlex1 Date: Sat, 11 Apr 2026 06:59:49 +0300 Subject: [PATCH 1/3] Fix case label removal --- src/github/issue.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/github/issue.rs b/src/github/issue.rs index 43984342..9f80aad4 100644 --- a/src/github/issue.rs +++ b/src/github/issue.rs @@ -267,11 +267,16 @@ impl Issue { log::info!("remove_labels from {}: {:?}", self.global_id(), labels); // Don't try to remove labels not already present on this issue. + // Use case-insensitive comparison to match GitHub's behavior when adding labels. let labels = labels .into_iter() - .filter(|l| self.labels().contains(l)) + .filter_map(|l| { + self.labels() + .iter() + .find(|existing| existing.name.to_lowercase() == l.name.to_lowercase()) + .cloned() + }) .collect::>(); - log::info!( "remove_labels: {} filtered to {:?}", self.global_id(), From 3bf10eced52f4bc34687c2d7fb685e2d510ec1ef Mon Sep 17 00:00:00 2001 From: JojoFlex1 Date: Sat, 11 Apr 2026 17:41:25 +0300 Subject: [PATCH 2/3] Add test for case-insensitive label removal --- src/github/issue.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/github/issue.rs b/src/github/issue.rs index 9f80aad4..a8c93e7e 100644 --- a/src/github/issue.rs +++ b/src/github/issue.rs @@ -964,3 +964,34 @@ impl IssueRepository { Ok(permission) } } + + +#[cfg(test)] +mod tests { + use super::Label; + + #[test] + fn test_case_insensitive_label_matching() { + let issue_labels = vec![ + Label { name: "E-needs-mcve".to_string() }, + Label { name: "T-compiler".to_string() }, + ]; + + // Simulate what remove_labels does with the fix + let to_remove = vec![ + Label { name: "e-needs-mcve".to_string() }, // lowercase version + ]; + + let matched: Vec