semantic-release / gitlab

:fox_face: semantic-release plugin to publish a GitLab release
MIT License
273 stars 78 forks source link

Response code 429 (Too Many Requests) on successComment #361

Open vgropp opened 2 years ago

vgropp commented 2 years ago

We are running into the gitlab API limit on some projects when multiple semantic-releases are running at the same time from share IPs.

[8:07:42 AM] [semantic-release] › ℹ  Start step "success" of plugin "@semantic-release/gitlab"
[8:07:44 AM] [semantic-release] [@semantic-release/gitlab] › ✖  An error occurred while posting comments to related issues and merge requests:
HTTPError: Response code 429 (Too Many Requests)
    at Request.<anonymous> (/usr/local/lib/node_modules/@semantic-release/gitlab/node_modules/got/dist/source/as-promise/index.js:117:42)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  code: 'ERR_NON_2XX_3XX_RESPONSE',

As far as I understand the code https://github.com/semantic-release/gitlab/blob/3051799160efc127585d30a4ef776ccf34185fee/lib/success.js#L72 for very Commit the script is looking for a MR, with those MR the script is searching for an resolved issue. So there will be at least commits * MR Requests. As we do not use gitlab issues (but like the MR comment), what about a configuration to disable the Issue Comments and hence those requests? This will limit the requests to count of commits.

Another Option would be rate limiting the requests, but that seems like a lot more work but more sustainable solution.

fgreinacher commented 2 years ago

Thanks for reporting this @vgropp!

You can disable the new feature by setting the successComment option to false.

Other than that I think it would make sense to add proper handling of such cases to this plugin.

fgreinacher commented 1 month ago

@vgropp Have you seen this behavior recently? In https://github.com/semantic-release/gitlab/pull/728 we learned that the underlying HTTP library does actually have a quite powerful retry logic. I'd like to understand why this is not enough in your case. 🙇