scripts: set_assignee: set reviewers for modules
Add support for setting reviewers as well for module PRs, in addition to
the assignees.
Note that this still only works on repositories with an assignee on
record since it does not seem to be possible to query for PRs that have
no reviewers.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
diff --git a/scripts/set_assignees.py b/scripts/set_assignees.py
index 2a4575e..fb1987c 100755
--- a/scripts/set_assignees.py
+++ b/scripts/set_assignees.py
@@ -286,7 +286,10 @@
log(f"No maintainers for: {area}")
continue
- log(f"Found {area}, maintainers={maintainers}")
+ collaborators = maintainers_file.areas[area].collaborators
+
+ log(f"Found {area}, maintainers={maintainers}, collaborators={collaborators}")
+
repo_name = f"{args.org}/{project.name}"
repos[repo_name] = maintainers_file.areas[area]
@@ -309,9 +312,15 @@
area = repos[repo_name]
for maintainer in area.maintainers:
- log(f"Adding {maintainer} to {pull.html_url}")
+ log(f"Assigning {maintainer} to {pull.html_url}")
if not args.dry_run:
pull.add_to_assignees(maintainer)
+ pull.create_review_request(maintainer)
+
+ for collaborator in area.collaborators:
+ log(f"Adding {collaborator} to {pull.html_url}")
+ if not args.dry_run:
+ pull.create_review_request(collaborator)
def main():