Skip to content

Commit

Permalink
github: Don't crash if a team is a reviewer
Browse files Browse the repository at this point in the history
Adding full team support looks like a medium task,
but for now we can at least not crash.

Topic: teams
Reviewers: brian-k
closes #73
  • Loading branch information
jerry-skydio committed Oct 14, 2022
1 parent d932439 commit 33f503c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions revup/github_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ async def query_everything(
login
id
}}
... on Team {{
name
id
}}
}}
}}
}}
Expand Down Expand Up @@ -298,8 +302,11 @@ async def query_everything(
pr_labels.add(label["name"])
pr_label_ids.add(label["id"])
for revs in this_node["reviewRequests"]["nodes"]:
reviewers.add(revs["requestedReviewer"]["login"])
reviewer_ids.add(revs["requestedReviewer"]["id"])
if not revs["requestedReviewer"]:
continue
elif "login" in revs["requestedReviewer"]:
reviewers.add(revs["requestedReviewer"]["login"])
reviewer_ids.add(revs["requestedReviewer"]["id"])
for revs in this_node["latestReviews"]["nodes"]:
if not revs["viewerDidAuthor"]:
reviewers.add(revs["author"]["login"])
Expand Down

0 comments on commit 33f503c

Please sign in to comment.