-
Notifications
You must be signed in to change notification settings - Fork 119
Handle Secondary Rate Limit Errors in CLI #1426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: begonaguereca <[email protected]>
Co-authored-by: begonaguereca <[email protected]>
Unit Test Results 1 files 1 suites 10m 25s ⏱️ Results for commit 514da55. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements secondary rate limit handling in the GitHub CLI to improve reliability when running concurrent migrations by adding retry logic with exponential backoff for 403/429 HTTP responses.
- Adds detection and handling for secondary rate limits (HTTP 403/429) with automatic retry logic
- Implements exponential backoff strategy when retry headers are not present
- Provides clear warning messages and error handling after maximum retries are reached
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/Octoshift/Services/GithubClient.cs | Core implementation of secondary rate limit detection and retry logic with exponential backoff |
src/OctoshiftCLI.Tests/Octoshift/Services/GithubClientTests.cs | Comprehensive test coverage for various secondary rate limit scenarios including 429/403 responses and retry behavior |
RELEASENOTES.md | User-facing documentation of the new secondary rate limit handling feature |
Co-authored-by: Copilot <[email protected]>
|
This PR implements secondary rate limit handling in the GitHub CLI to gracefully handle 403/429 responses with proper retry logic, exponential backoff, and clear error messaging, improving reliability when running multiple concurrent migrations.
Background
Recent GraphQL database rate limiting changes now count Octoshift backend operations against the PAT, causing failures when migrations run in parallel. Previously, the CLI would fail immediately on secondary rate limit errors (HTTP 403/429) without any retry logic, making it brittle in both CI and customer environments.
Key Changes
The implementation makes minimal surgical changes to the
GithubClient.SendAsync
method:IsSecondaryRateLimit
method to detect secondary rate limit responsesHandleSecondaryRateLimit
method to implement retry logic with proper header handlingSendAsync
method with retry count parameter and secondary rate limit handlingCloses #1425
Closes https://github.ghe.com/github/octoshift/issues/11153