From 43e86ce5d5fcca1c4b6b45067ccd8a6cfab0e2b5 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Tue, 25 Nov 2025 20:22:17 -0500 Subject: [PATCH] .github/scripts: Make reviewer filtering case insensitive The `add_reviewers_to_pr()` function in GitHub.py did not compare all usernames without case sensitivity which could cause a reviewer that has already reviewed a pull request to be re-requested. The occurred under the following conditions: - GetMaintainer.py returns usernames from Maintainers.txt (e.g. "user") - GitHub API returns usernames in their actual case (e.g. "User") - The exclusion filter used case-sensitive comparison so the match is not detected Fixed by converting the exclusion set to lowercase and performing case-insensitive comparison when filtering for new reviewers. Signed-off-by: Michael Kubacki --- .github/scripts/GitHub.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/scripts/GitHub.py b/.github/scripts/GitHub.py index 5c0709e777..3268a81178 100644 --- a/.github/scripts/GitHub.py +++ b/.github/scripts/GitHub.py @@ -232,8 +232,13 @@ def add_reviewers_to_pr( repo_collaborators = [c.login.strip().lower() for c in repo_gh.get_collaborators() if c] non_collaborators = [u for u in user_names if u.lower() not in repo_collaborators] - excluded_pr_reviewers = [pr_author] + current_pr_reviewers + non_collaborators - new_pr_reviewers = [u for u in user_names if u not in excluded_pr_reviewers] + excluded_pr_reviewers = { + e.lower() + for e in [pr_author] + current_pr_reviewers + non_collaborators + } + new_pr_reviewers = [ + u for u in user_names if u.lower() not in excluded_pr_reviewers + ] # Notify the admins of the repository if non-collaborators are requested. if non_collaborators: