pint icon indicating copy to clipboard operation
pint copied to clipboard

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

Open pauloborges opened this issue 1 year ago • 1 comments

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

pauloborges avatar Aug 14 '23 07:08 pauloborges