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>
This commit is contained in:
parent
80b3f15a03
commit
fec3cee0bb
|
@ -191,8 +191,14 @@ def process_pr(gh, maintainer_file, number):
|
||||||
for collaborator in collab:
|
for collaborator in collab:
|
||||||
try:
|
try:
|
||||||
gh_user = gh.get_user(collaborator)
|
gh_user = gh.get_user(collaborator)
|
||||||
if pr.user != gh_user and gh_repo.has_in_collaborators(gh_user):
|
if pr.user == gh_user or gh_user in existing_reviewers:
|
||||||
if gh_user not in existing_reviewers and gh_user not in self_removal:
|
continue
|
||||||
|
if not gh_repo.has_in_collaborators(gh_user):
|
||||||
|
log(f"Skip '{collaborator}': not in collaborators")
|
||||||
|
continue
|
||||||
|
if gh_user in self_removal:
|
||||||
|
log(f"Skip '{collaborator}': self removed")
|
||||||
|
continue
|
||||||
reviewers.append(collaborator)
|
reviewers.append(collaborator)
|
||||||
except UnknownObjectException as e:
|
except UnknownObjectException as e:
|
||||||
log(f"Can't get user '{collaborator}', account does not exist anymore? ({e})")
|
log(f"Can't get user '{collaborator}', account does not exist anymore? ({e})")
|
||||||
|
|
Loading…
Reference in a new issue