GitHub importer fails to handle rate limits when importing note attachments
What does this MR do and why?
This MR adds rate limit handling to AttachmentsDownloader during GitHub imports.
Problem
When importing GitHub repositories with many note attachments, the importer can hit GitHub's rate limits. The AttachmentsDownloader makes direct HTTP requests to download attachments, bypassing the Client#with_rate_limit mechanism that handles rate limiting for API calls. This causes imports to fail with unhandled errors.
Solution
- Detect rate limit responses (HTTP 429 and 403) in
AttachmentsDownloader - Raise
RateLimitErrorwhen rate limited - The existing
ReschedulingMethodsinfrastructure catches this error and reschedules the job after the rate limit resets
GitHub can return either 429 or 403 for rate limiting, so we check for both status codes.
References
How to set up and validate locally
This change is covered by unit tests. No manual validation is required.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #581751 (closed)