oxsecurity / megalinter

🦙 MegaLinter analyzes 50 languages, 22 formats, 21 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
https://ox.security
GNU Affero General Public License v3.0
1.97k stars 238 forks source link

AzureCommentReporter create active PR comment #4152

Closed lukelloydagi closed 1 month ago

lukelloydagi commented 1 month ago

Describe the solution you'd like AzureCommentReporter currently creates the PR comment as resolved, however it would be more useful to have the comment created as active. This allows for branch policies requiring comments to be resolved to be blocked until the MegaLinter output has been reviewed / alongside a peer review.

Would it be better to have the active vs resolved status as a toggle/environment variable to allow users to select what works for them?

Additional context https://learn.microsoft.com/en-us/azure/devops/repos/git/review-pull-requests?view=azure-devops&tabs=browser#change-comment-status

https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-request-threads/create?view=azure-devops-rest-7.1&tabs=HTTP#commentthreadstatus

nvuillam commented 1 month ago

If i'm not mistaken, the comment is created as resolved if there are no MegaLinter errors, but as Active if there are errors :)

nvuillam commented 1 month ago

image

lukelloyd1985 commented 1 month ago

so it does 👏🏻

nvuillam commented 1 month ago

so it does 👏🏻

this code looks strange with "fixed" or 1 as status, but it seems to work 🤣