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

Support GitHub API Token #18

Closed
dflems opened this issue Jan 2, 2019 · 4 comments · Fixed by #62
Closed

Support GitHub API Token #18

dflems opened this issue Jan 2, 2019 · 4 comments · Fixed by #62

Comments

@dflems
Copy link

dflems commented Jan 2, 2019

If you're on a shared network, you can sometimes see messages like this from the API:

$ curl https://api.github.com/repos/bazelbuild/bazel/releases
{
  "message": "API rate limit exceeded for 123.45.67.89. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
  "documentation_url": "https://developer.github.com/v3/#rate-limiting"
}

Homebrew (for instance) has support for supplying a token via HOMEBREW_GITHUB_API_TOKEN, making it more likely that the API request won't get rate limited. It would be nice for bazelisk to support this as well, perhaps via a similar convention (BAZELISK_GITHUB_API_TOKEN) to perform authenticated requests instead.

@dflems
Copy link
Author

dflems commented Jan 2, 2019

Ah I just noticed bazelisk only pulls the releases list from github.com and nothing else. Maybe it would be easier to publish something like https://releases.bazel.build/latest-version.txt on your end and pull that down instead :)

@keith
Copy link
Member

keith commented May 20, 2019

@philwo any ideas on a solution for this? I could dedicate some time to this if we had a clear path

@philwo
Copy link
Member

philwo commented May 21, 2019

Both ideas sound good - using a GitHub token (if available) and storing that information on our own host. I can handle the latter part, but integrating it into our release pipeline will take some time.

@keith do you want to look into using a GitHub token? Sounds like a good and quick fix for this. I'm not sure where people would usually store these tokens - environment variable? If that's the usual way, sure, why not. :)

@keith
Copy link
Member

keith commented May 29, 2019

I've submitted an attempt at this here #62

@philwo philwo closed this as completed in #62 Jun 4, 2019
philwo pushed a commit that referenced this issue Jun 4, 2019
This adds support for BAZELISK_GITHUB_TOKEN which is a GitHub token used
for API requests when it is set. This fixes the issue of being on a
shared network and getting rate limited when using bazelisk.

Fixes #18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants