auto: In a repo that hasn't published in a bit, search api rate limits are exceeded

Describe the bug

If a project has many PRs with skip release labels then auto quickly starts triggering GitHub’s search API rate limit. Even with Octokit’s rate limiting protection enabled we’re still seeing cases where the rate limits are being exceeded.

See this log as an example: https://circleci.com/gh/artsy/renovate-config/2739

To Reproduce

A repo must have many >20ish unpublished PRs to trigger this effect.

Expected behavior

Process should gracefully recover if rate limits are exceeded. Ideally the search endpoint is called less individual times.

Additional Context

The particular endpoint being hit is

GET https://api.github.com/search/issues?q=repo:artsy/renovate-config 2868a054c07dc4fd36d53a3df1bcc11cbf45e9f4

Where the thing at the end is some commit hash.

I believe this is where the search call is happening:

https://github.com/intuit/auto/blob/221b2931c93859711f8bed5a20f9b572a9ae3054/src/release.ts#L200

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17

Most upvoted comments

Oh, yeah! I think this will totally work.

Use this to see the current rate limit status of the query:

{
rateLimit {
    limit
    cost
    remaining
    resetAt
  }
}

What would be really awesome is a new API endpoint to match an arbitrary commit to a PR. Then we wouldn’t have to search at all