Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62157

GitHub Enterprise rate limiting no longer working

XMLWordPrintable

      The changes in JENKINS-59039 have broken rate limiting on our GitHub Enterprise instance.

      This GHE instance does not return rate limit information via theĀ /rate_limit endpoint

      {
        "message": "Rate limiting is not enabled.",
        "documentation_url": "https://developer.github.com/enterprise/2.19/v3/rate_limit/#get-your-current-rate-limit-status"
      }
      

      but does return X-RateLimit headers on every request:

      < X-RateLimit-Limit: 5000
      < X-RateLimit-Reset: 1588603124
      < X-RateLimit-Remaining: 4999
      

      Before JENKINS-59039, it looks like the code called org.kohsuke.github.GitHub#rateLimit, which will return header-based rate limit info if it exists. Now the code calls org.kohsuke.github.GitHub#getRateLimit, which exclusively uses the /rate_limit endpoint.

      The end result is that the plugin does not throttle itself during organization/repository scanning and for repositories with large numbers of branches, the scan ends up failing when the rate limit is exceeded.

      Unfortunately I don't think modifying the response of the /rate_limit endpoint is an option. Any chance the plugin can be modified to call org.kohsuke.github.GitHub#rateLimit like it used to?

            Unassigned Unassigned
            bfarrell Brian Farrell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: