Skip to content

Apply scope fix for throttling project export downloads to the API

What does this MR do and why?

!82925 (merged) recently fixed the scope for throttling project export downloads. However, this fix was only applied to the web controller and not to the API. This MR aims to apply the same fix to the API endpoint, too.

Please see !82925 (merged) for details about this change.

How to set up and validate locally

  1. Create exports of multiple different projects (e.g. two personal projects, two projects of group-1, two projects of group-2)
  2. Wait until all exports are ready for download
  3. Try to download all the exports back-to-back within the span of one minute via API (api/v4/projects/{id}/export/download)
  4. Note that only the first download within a namespace succeeds, while others are throttled

Doing these steps on the current version would not result in any throttling at all, unless it gets tried to download one export twice.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #323637 (closed)

Merge request reports