Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Proper rate limit error #20

Closed
guybedford opened this issue Jan 7, 2015 · 17 comments
Closed

Proper rate limit error #20

guybedford opened this issue Jan 7, 2015 · 17 comments

Comments

@guybedford
Copy link
Member

The rate limit response looks like:

{
  "server": "GitHub.com",
  "date": "Wed, 07 Jan 2015 14:55:25 GMT",
  "content-type": "application/json; charset=utf-8",
  "status": "403 Forbidden",
  "x-ratelimit-limit": "60",
  "x-ratelimit-remaining": "0",
  "x-ratelimit-reset": "1420644334",
  "x-github-media-type": "unknown",
  "x-xss-protection": "1; mode=block",
  "x-frame-options": "deny",
  "content-security-policy": "default-src 'none'",
  "content-length": "246",
  "access-control-allow-credentials": "true",
  "access-control-expose-headers": "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval",
  "access-control-allow-origin": "*",
  "x-github-request-id": "C59B0418:6AE3:7AA50:54AD48DC",
  "strict-transport-security": "max-age=31536000; includeSubdomains; preload",
  "x-content-type-options": "nosniff"
}
@EisenbergEffect
Copy link

It would be cool to prompt the user with an option to set up credentials at this point and retry the install. Something like “Request for package X failed due to a GitHub API rate limit. To fix this issue, configure jspm with your GitHub credentials. Would you like to do this now and retry the install?"

@guybedford
Copy link
Member Author

This has been included in f783961.

A workflow to immediately correct and resume isn't currently possible with the existing endpoint API, since global configuration changes (saving the new auth) are not currently permitted by endpoints at any time during operation.

This works well as a first implementation though.

@guybedford
Copy link
Member Author

To clarify, it looks something like this -

     Updating registry cache...
     Looking up github:twbs/bootstrap
     Downloading github:twbs/bootstrap@3.3.1

err  Error downloading github:twbs/bootstrap

     GitHub rate limit reached. To increase the limit use GitHub authentication.
     Run jspm endpoint config github to set this up.

warn Installation changes not saved.

If the user is already authenticated it looks like:

     Updating registry cache...
     Looking up github:twbs/bootstrap
     Downloading github:twbs/bootstrap@3.3.1

err  Error downloading github:twbs/bootstrap

     GitHub rate limit reached, with authentication enabled.
     The rate limit will reset in 19 minutes.

warn Installation changes not saved.

@SteveEdson
Copy link

Is it possible to save a authentication token in the config, so that it can be used in CI builds?

My CI stuff is failing occasionally because of Github rate limits.

@guybedford
Copy link
Member Author

@SteveEdson there's some docs on this in https://github.com/jspm/jspm-cli/wiki/Endpoints#auto-configuring-endpoints. Allowing a local config file for it is also being tracked as a feature.

@SteveEdson
Copy link

Sorry if I have misunderstood, but where do I get the auth_token from? I'm assuming it is different to a access token?

Is there not a way to run jspm endpoint config github with parameters for the username and access token?

Thanks,

Steve

@guybedford
Copy link
Member Author

If you read that section, it shows how jspm endpoint export github will export the auth token.

TravisCI instructions have also now been included in https://github.com/jspm/jspm-cli/wiki/Endpoints#travis-ci.

@mryellow
Copy link

On the UX.

Would you like to set up your GitHub credentials? [yes]: no
ok   Endpoint github configured successfully.

What does this mean?

@guybedford
Copy link
Member Author

It means you've set up your GitHub endpoint without credentials or with whatever credentials were already configured.

@mryellow
Copy link

Yeah seemed like it was telling me it had done something, but still had rate errors after that.

@kkruit
Copy link

kkruit commented Jul 1, 2015

All the pages refrenceing Endpoint "Endpoints" to "Registries" https://github.com/jspm/jspm-cli/wiki/Registries

@kudos
Copy link
Contributor

kudos commented Jul 7, 2015

I haven't been able to find evidence of it in the docs or code, but is it possible to configure this from the environment?

@guybedford
Copy link
Member Author

@kudos not sure exactly what you mean by configure this from the environment? Have you followed https://github.com/jspm/jspm-cli/wiki/Registries#auto-configuring-registries?

@kudos
Copy link
Contributor

kudos commented Jul 8, 2015

It's probably because I was super tired when trying to figure it out, but the first time I read that page I couldn't see how I could apply the same to Circle CI. Mind if I add a section for Circle there?

Also, it could be nice if it passively read that key from the environment instead of needing explicitly passed. Happy to work on a PR for that too if it would be welcome.

@guybedford
Copy link
Member Author

@kudos a documentation PR is welcome. Perhaps we should include links to these sections at the top of the page as well so it's easier to find as many seem to miss it.

Supporting an environment variable fallback for the GitHub registry auth token could certainly be an option as well here.

@trusktr
Copy link

trusktr commented Jan 5, 2016

Post deleted, redirected to: aurelia/skeleton-navigation#38 (comment)

@guybedford
Copy link
Member Author

@trusktr posting this comment once was more than enough. My response is at aurelia/skeleton-navigation#38 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants