fix: batch review comments to avoid secondary rate limit#206
Open
Br1an67 wants to merge 1 commit intoanc95:mainfrom
Open
fix: batch review comments to avoid secondary rate limit#206Br1an67 wants to merge 1 commit intoanc95:mainfrom
Br1an67 wants to merge 1 commit intoanc95:mainfrom
Conversation
When a PR has many changed files, the review can contain hundreds of comments. Submitting them all in a single createReview call triggers GitHub's secondary rate limit. Now splits comments into configurable batches (default 40) with a delay between each batch (default 5s). New env vars (optional): - REVIEW_BATCH_SIZE: max comments per review (default: 40) - REVIEW_BATCH_DELAY_MS: delay between batches in ms (default: 5000) Small PRs (<=40 comments) are unaffected — same single-call behavior.
Open
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.
What
Split large review submissions into smaller batches to avoid GitHub's secondary rate limit.
Closes #201
Why
When a PR has many changed files (100+), the review can contain hundreds of comments. Submitting all of them in a single
createReviewcall triggers GitHub's secondary rate limit which limits content-generating requests to 80 per minute. This causes an infinite retry loop as described in #201.How
REVIEW_BATCH_SIZE(default: 40), behavior is unchanged — single API callREVIEW_BATCH_DELAY_MS, default: 5000ms)New environment variables (optional)
REVIEW_BATCH_SIZEREVIEW_BATCH_DELAY_MSTesting