feat: add Octokit retry and throttling plugins for resilient API calls#11
Merged
feat: add Octokit retry and throttling plugins for resilient API calls#11
Conversation
- Add @octokit/plugin-retry for automatic retries on 5xx errors and network failures - Add @octokit/plugin-throttling for graceful rate limit handling - Configure retry to skip 400, 401, 403, 404, 422 errors (non-retryable) - Configure throttling to retry up to 3 times on rate limits - Configure throttling to retry once on secondary rate limits - Log rate limit events for visibility This uses battle-tested official Octokit plugins instead of custom retry logic, providing better compatibility and maintenance.
- Use integers instead of strings for doNotRetry status codes - Add 409 (Conflict) and 410 (Gone) to doNotRetry list - Preserve calling context in error stack traces through plugin layers - Remove explicit type annotations from throttle handlers (let TS infer) All 1063 tests now pass.
- Node 18 reached EOL in April 2025 - Update CI matrix to test Node 20 and 22 - Fix deprecated npm flag (--production → --omit=dev) - Update actions/setup-node to v4
abvthecity
approved these changes
Jan 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds official Octokit plugins for automatic retry and rate limit handling, making our GitHub API interactions more resilient to transient failures.
Changes
Dependencies
@octokit/plugin-retry(^6.0.0) - Automatic retries for 5xx errors and network failures@octokit/plugin-throttling(^8.0.0) - Graceful rate limit handlingConfiguration
Retry Plugin:
Throttling Plugin:
Retry-Afterheader from GitHubWhy Official Plugins?
Instead of implementing custom retry logic, we chose to use Octokit's official plugins because:
Testing
Potential Future Improvements