ci: prevent rate limiting in release-commenter action #15298
Merged
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.
Overview
Fixes GitHub secondary rate limit errors in the
release-commenteraction when processing releases with many PRs.Key Changes
Sequential processing for comment creation
Promise.allwith sequential processing and 1s delay between each PRProcessing issue/PR 1/20: #123Updated tests for async timing
Design Decisions
GitHub's secondary rate limits restrict content creation to 80 requests/minute and penalize burst patterns regardless of total volume. The previous implementation fired all comment/label requests in parallel, triggering the "content creation" throttle even when under primary rate limits.
Sequential processing with a 1s delay trades speed for reliability. For a release with 20 PRs, processing takes ~20s instead of ~2s—an acceptable tradeoff given releases are infrequent and reliability matters more than speed.
GraphQL queries (read operations) remain parallel since they're less likely to trigger secondary limits.
Overall Flow
sequenceDiagram participant Action participant GitHub API Action->>GitHub API: Get releases (parallel) Action->>GitHub API: Compare commits (parallel) Action->>GitHub API: GraphQL queries for PRs (parallel) loop For each linked issue/PR Action->>GitHub API: Get issue state Action->>GitHub API: Create comment (+ unlock/lock if needed) Action->>GitHub API: Add labels (if configured) Note over Action: Wait 1s before next endReferences / Links