Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github api proxy: use for 'next' links #63

Merged
merged 1 commit into from Jan 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions validate.py
Expand Up @@ -62,7 +62,8 @@ def get_reviews():
target_commit = get_commit()
print('Considering reviews at commit %s' % target_commit)

url = '%s/reviews' % base_pr_url()
base_url = '%s/reviews' % base_pr_url()
url = base_url
reviews = {}

while True:
Expand Down Expand Up @@ -91,7 +92,12 @@ def get_reviews():
reviews[user] = state

if 'next' in response.links:
url = response.links['next']['url']
# This unfortunately points to GitHub, and not to the rate-limit-avoiding
# proxy. Pull off the query string (ex: "?page=3") and append that to
# our url that goes via the proxy.
next_url = response.links['next']['url']
github_api_path, query_string = next_url.split('?')
url = '%s?%s' % (base_url, query_string)
else:
return reviews

Expand Down