Skip to content

Commit fec3cee

Browse files
committed
scripts: set_maintainer: add log messages for skipped collabs
Refactor the skip collaborator logic to add log messages when a collaborator is skipped because they self removed of not part of the org. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
1 parent 80b3f15 commit fec3cee

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/set_assignees.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,15 @@ def process_pr(gh, maintainer_file, number):
191191
for collaborator in collab:
192192
try:
193193
gh_user = gh.get_user(collaborator)
194-
if pr.user != gh_user and gh_repo.has_in_collaborators(gh_user):
195-
if gh_user not in existing_reviewers and gh_user not in self_removal:
196-
reviewers.append(collaborator)
194+
if pr.user == gh_user or gh_user in existing_reviewers:
195+
continue
196+
if not gh_repo.has_in_collaborators(gh_user):
197+
log(f"Skip '{collaborator}': not in collaborators")
198+
continue
199+
if gh_user in self_removal:
200+
log(f"Skip '{collaborator}': self removed")
201+
continue
202+
reviewers.append(collaborator)
197203
except UnknownObjectException as e:
198204
log(f"Can't get user '{collaborator}', account does not exist anymore? ({e})")
199205

0 commit comments

Comments
 (0)