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

Too many calls to the GitHub API cause throttling

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins 2.289
      GitHub Api 1.117
      GitHub Branch Source 2.9.3

      We have a multibranch pipeline configured with a GitHub App credential. We use the SSH checkout trait with another ssh credential to perform the checkout.

      For one repository only, we hit about 1000 calls, excluding our shared library, to the github API with our GitHub App token. Here is the details of these calls for 1h in a single repository. We can see that there is quite a high amount of calls to the /repos/{owner}/{repository}/git/refs/heads/{branch} and /repos/{owner}/{repository} endpoints.

      The high amount of calls cause our builds to sleep so we avoid being rate limited by GitHub. I believe Github branch source plugin is making most of these calls. The repo is not configured for polling and it is configured with the Discover All branches strategy.

       

      Our Shared Library is also configured to use the GitHub SCM with a GitHub App and checkout over SSH, but we only have 1 call to /repos/{owner}/{repository} and 1 to /repos/{owner}/{repository}/branches/{branch} per build which seems normal. Although, some caching could be done there as well to further reduce the amount of calls.

            Unassigned Unassigned
            agaudreault Alexandre Gaudreault
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: