Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

pint ci spams GitHub's API which replies with status code 422 #699

Closed
pauloborges opened this issue Aug 14, 2023 · 1 comment · Fixed by #1051
Closed

pint ci spams GitHub's API which replies with status code 422 #699

pauloborges opened this issue Aug 14, 2023 · 1 comment · Fixed by #1051
Assignees

Comments

@pauloborges
Copy link

pauloborges commented Aug 14, 2023

Hello! It seems pint ci is spamming GitHub's API to post inline comments about the rules.

I have a set of 60+ rules, and Pint manages to post 50-ish comments before being rate-limited. Here's an excerpt of the output:

level=info msg="Pull request review created" status="200 OK"
level=info msg="Creating review comments"
level=fatal msg="Execution completed with error(s)" error="submitting reports: POST https://api.github.com/repos/xxx/xxx/pulls/xxx/comments: 422 Validation Failed [{Resource:PullRequestReviewComment Field:base Code:abuse Message:}]"

And here is the documentation that tells GitHub may return 422 on this endpoint if the caller is spamming it: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request--status-codes

@prymitive
Copy link
Collaborator

There's a maxComment option to limit the number of comments - https://cloudflare.github.io/pint/configuration.html#github-options but 422s could be handled explicitly here too.

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

Successfully merging a pull request may close this issue.

2 participants