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

[feature request] Gracefully handle when GH API rate limits are applied #27

Open
greglockwood opened this issue Jan 6, 2021 · 0 comments

Comments

@greglockwood
Copy link
Contributor

greglockwood commented Jan 6, 2021

Context

I was trying to create 29 PRs in a train using this tool. After successfully creating 17, the 18th one got rejected due to the automatic abuse detection mechanism.

The error response was as follows:

{
  "message": "You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.",
  "statusCode": 403,
  "headers": {
    "date": "Wed, 06 Jan 2021 06:07:58 GMT",
    "content-type": "application/json; charset=utf-8",
    "content-length": "225",
    "connection": "close",
    "server": "GitHub.com",
    "status": "403 Forbidden",
    "x-oauth-scopes": "repo, workflow",
    "x-accepted-oauth-scopes": "",
    "x-github-media-type": "github.v3; format=json",
    "x-ratelimit-limit": "5000",
    "x-ratelimit-remaining": "4866",
    "x-ratelimit-reset": "1609914188",
    "x-ratelimit-used": "134",
    "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
    "access-control-allow-origin": "*",
    "strict-transport-security": "max-age=31536000; includeSubdomains; preload",
    "x-frame-options": "deny",
    "x-content-type-options": "nosniff",
    "x-xss-protection": "1; mode=block",
    "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
    "content-security-policy": "default-src 'none'",
    "vary": "Accept-Encoding, Accept, X-Requested-With",
    "x-github-request-id": "DA2B:0222:4BEA2F1:557888F:5FF553BE"
  },
  "body": {
    "message": "You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.",
    "documentation_url": "https://docs.github.com/v3/#abuse-rate-limits"
  }
}

Feature Request

Gracefully handle when the rate limit is exceeded. This might mean:

  1. Waiting an appropriate amount of time in-between requests to avoid the rate limit; or
  2. Letting the user know and asking them to try again later; or
  3. A combination of the above. Prompting the user to ask if they want to wait until the rate limitation has been lifted or if they want to try it again themselves later. For extra points, add a command-line flag (e.g. --silent, -s) that automatically agrees to wait.
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

No branches or pull requests

1 participant