taylor / kiex

Elixir version manager
http://taylor.github.io/kiex/
MIT License
766 stars 65 forks source link

kiex and GitHub API rate limit #22

Closed BanzaiMan closed 9 years ago

BanzaiMan commented 9 years ago

Hello.

Travis CI recently started using kiex to manage multiple Elixir versions.

Currently, kiex makes anonymous GitHub API calls to get the list of known releases. If this API call fails, it simply gives up. This is a problem with popular service like Travis CI, since the rate limit of 60 per hour will be easily exceeded. This manifests in issues like https://github.com/travis-ci/travis-ci/issues/3269.

It is desirable to add a mechanism to pass the user OAuth token whenever user agent is used, so that we get a higher rate limit (5000/hour). Also, in the face of such an API call failure, kiex should fail somewhat gracefully, notifying the user that the API call failed, instead of "Unknown Elixir" (because kiex doesn't know which version is known and which is unknown).

I'm happy to work on a PR, if such a behavior is desirable.

taylor commented 9 years ago

Sounds great @BanzaiMan. Not sure how the user agent is used for the OAuth. I normally passed in environment variables.

My testing was in docker containers and never exceeded the limits so I never even went with env variables.