Skip to content
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

Rate limit when creating review reply comments #775

Open
mschoettle opened this issue Mar 3, 2025 · 1 comment
Open

Rate limit when creating review reply comments #775

mschoettle opened this issue Mar 3, 2025 · 1 comment

Comments

@mschoettle
Copy link

mschoettle commented Mar 3, 2025

I run a script to migrate pull requests which includes the creation of PR reviews and their comments.

I started receiving a validation error with code abuse which I believe is some kind of exceeding the rate limit

POST /repos/<owner>/<repo>/pulls/201/comments/<comment_id>/replies - 422 with id EB8A:37B3E7:1CAFC40:398B982:67C5DC77 in 264ms
RequestError [HttpError]: Validation Failed: {"resource":"PullRequestReview","code":"abuse","field":"base"} - https://docs.github.com/rest/pulls/comments#create-a-reply-for-a-review-comment
    at fetchWrapper (file:///app/node_modules/@octokit/request/dist-bundle/index.js:122:11)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Job.doExecute (/app/node_modules/bottleneck/light.js:405:18) {
  status: 422,
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/<owner>/<repo>pulls/201/comments/<comment_id>replies',

Would it be possible to catch that and retry later like the rest?

Might be related to #667. It's not totally clear how to avoid it in the first place. Should I add more "waits" in my script?

@mschoettle
Copy link
Author

Here are the relevant x-rate-limit headers from the response:

'x-ratelimit-limit': '5000',
'x-ratelimit-remaining': '4456',
'x-ratelimit-reset': '1741034079',
'x-ratelimit-resource': 'core',
'x-ratelimit-used': '544',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant