mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
.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 <michael.kubacki@microsoft.com>
This commit is contained in:
parent
4411321f70
commit
43e86ce5d5
1 changed files with 7 additions and 2 deletions
9
.github/scripts/GitHub.py
vendored
9
.github/scripts/GitHub.py
vendored
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue