ExportXMLWordPrintable

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor
    • None
    • Environment:
      Jenkins 2.555.2
      Bitbucket Branch Source Plugin 937.3.1

      Bitbucket Cloud applies rate limits to its API requests.
      When exceeded, their servers return the HTTP 429 "Rate Limit Exceeded" response.

      These limits are applied per-user and while we use separate users for some projects, there's some primary "global" user for majority of them (managing different user for each project would add an unnecesary overhead and cost).
      To overcome the rate limits issue, we however added another global user (even though it's an additional user, it's currently just 1 more instead of much more in the case of the stricter per-project approach) that some jobs are configured to use.
      However setting up different users per-job isn't also optimal. We'd like to be able to use the same congiguration for majority of jobs to keep things simple and easy to reuse.

      It would be nice to allow use of multiple credentials at once somehow. Either by leveraging Jenkins credential domains (multiple Bitbucket credentials would be configured within a single domain and the whole domain would be configured to be used by the Branch Source Plugin), or some other way that you find appropriate. In the worst case, at least being able to directly configure additional credentials in the job configuration would be better than nothing.

      The Branch Source Plugin would then use these credentials as a pool and in the case of the HTTP 429 response, switch to another one. The behavior (how the credentials are chosen - e.g. some primary-backup failover-type of approach, or randomly) could be perhaps configurable (globally) to allow some control over it.

      There could be some other configurable options such as the backoff delay, or handling the X-RateLimit-NearLimit response header if present.

      https://support.atlassian.com/bitbucket-cloud/kb/bitbucket-cloud-rate-limit-troubleshooting/

      Note: We have already applied some mitigation to reduce the amount API requests - Webhook Cache.
      There's also a configurable Bitbucket Cloud cache which looks like it could help as well, however it doesn't appear to be documented at https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/docs/USER_GUIDE.adoc

            Assignee:
            Nikolas Falco
            Reporter:
            Petr H
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: