[JIRA] (JENKINS-62157) GitHub Enterprise rate limiting no longer working

0 views
Skip to first unread message

bfarrell@us.ibm.com (JIRA)

unread,
May 4, 2020, 10:11:04 AM5/4/20
to jenkinsc...@googlegroups.com
Brian Farrell created an issue
 
Jenkins / Bug JENKINS-62157
GitHub Enterprise rate limiting no longer working
Issue Type: Bug Bug
Assignee: Unassigned
Components: github-branch-source-plugin
Created: 2020-05-04 14:10
Environment: github-branch-source v2.6.0
Priority: Major Major
Reporter: Brian Farrell

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?

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

bitwiseman@gmail.com (JIRA)

unread,
May 5, 2020, 3:47:53 PM5/5/20
to jenkinsc...@googlegroups.com
Liam Newman commented on Bug JENKINS-62157
 
Re: GitHub Enterprise rate limiting no longer working

The problem is that org.kohsuke.github.GitHub#rateLimit may be stale and then throttling still doesn't work.

The correct solution is to update getRateLimit() to handle this case, specifically to use the header rate limit information if it is present even on a 404 of the /ratelimit endpoint. Please file an issue with the github-api project - https://github.com/github-api/github-api

bfarrell@us.ibm.com (JIRA)

unread,
May 5, 2020, 6:32:05 PM5/5/20
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
May 5, 2020, 7:02:03 PM5/5/20
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
 
Change By: Liam Newman
Component/s: github-api-plugin
Reply all
Reply to author
Forward
0 new messages