Skip to content

Commit

Permalink
github: Workaround when review is requested from a team
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaty committed Jul 2, 2024
1 parent 1ecf76f commit 8b54633
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cogite/backends/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ def _get_pull_request_status(response: dict) -> models.PullRequestStatus:
# an Author object (with only the login) in 'reviews'. We'll
# use the lowest common denominator, i.e. login only.
for request in pr_info['reviewRequests']['nodes']:
# FIXME: the "requestedReviewer" could be a team. Accessing
# the team's name requires "read:org" or "read:discussion"
# scopes. These are not scopes that are granted to our app,
# for now, and I am not willing to change that as it seems a
# bit too broad. Perhaps it could be an option?
login = request['requestedReviewer'].get("login", "team (code owner)")
user_reviews = reviews[request['requestedReviewer']['login']]
user_reviews.append(models.ReviewState.PENDING)
for review in pr_info['reviews']['nodes']:
Expand Down

0 comments on commit 8b54633

Please sign in to comment.