Skip to content

Commit

Permalink
scripts: set_maintainer: add log messages for skipped collabs
Browse files Browse the repository at this point in the history
Refactor the skip collaborator logic to add log messages when a
collaborator is skipped because they self removed of not part of the
org.

(cherry picked from commit fec3cee)

Original-Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
GitOrigin-RevId: fec3cee
Change-Id: Ia1cb46186ece08a00457e4b1df9f24c7dd215b92
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5423769
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Tested-by: Tristan Honscheid <honscheid@google.com>
Commit-Queue: Tristan Honscheid <honscheid@google.com>
  • Loading branch information
fabiobaltieri authored and Chromeos LUCI committed Apr 4, 2024
1 parent 3ed7a43 commit fc0e298
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/set_assignees.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,15 @@ def process_pr(gh, maintainer_file, number):
for collaborator in collab:
try:
gh_user = gh.get_user(collaborator)
if pr.user != gh_user and gh_repo.has_in_collaborators(gh_user):
if gh_user not in existing_reviewers and gh_user not in self_removal:
reviewers.append(collaborator)
if pr.user == gh_user or gh_user in existing_reviewers:
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)
except UnknownObjectException as e:
log(f"Can't get user '{collaborator}', account does not exist anymore? ({e})")

Expand Down

0 comments on commit fc0e298

Please sign in to comment.