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

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

Open
pauloborges opened this issue Aug 14, 2023 · 1 comment
Open

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

pauloborges opened this issue Aug 14, 2023 · 1 comment
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.

@prymitive prymitive self-assigned this Jun 4, 2024
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

2 participants