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
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? |