mitchspano/sfdx-scan-pull-request

Apex class with many lines of code is updating code violation comments for few errrors remaining comments have 422 httperror

Closed this issue · 1 comments

I have formatted a big class with 2000 lines of code. few violations are updated with review comments in github remaining issues are getting 422 error.

Error when writing comments: {
"name": "HttpError",
"status": 422,
"response": {"status": 422,
"headers": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
"connection": "close",
"content-length": "221",
"content-security-policy": "default-src 'none'",
"content-type": "application/json; charset=utf-8",
"date": "Thu, 30 Nov 2023 08:31:44 GMT",
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"server": "GitHub.com",
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
"vary": "Accept-Encoding, Accept, X-Requested-With",
"x-accepted-github-permissions": "pull_requests=write",
"x-content-type-options": "nosniff",
"x-frame-options": "deny",
"x-github-api-version-selected": "2022-11-28",
"x-github-media-type": "github.v3; format=json",
"x-github-request-id": "8C16:433A:1DA2FAA:1EB76F6:6568486F",
"x-ratelimit-limit": "15000",
"x-ratelimit-remaining": "14957",
"x-ratelimit-reset": "1701336653",
"x-ratelimit-resource": "core",
"x-ratelimit-used": "43",
"x-xss-protection": "0"

"data": {
"message": "Validation Failed",
"errors": [
{
"resource": "PullRequestReviewComment",
"code": "abuse",
"field": "base"
}
],
"documentation_url": "https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request"
}
},

This is a duplicate of known issue #6. I will be marking this as closed and updates will be tracked on the canonical issue.

In the meantime, I would recommend keeping your changes smaller (see this documentation from Google CL is an internal term for Pull Request) and/or limiting the branches on which the scan is executed to keep its scope relatively well defined.