sonarqube-community-branch-plugin icon indicating copy to clipboard operation
sonarqube-community-branch-plugin copied to clipboard

Fix detection of previous PR annotation comments

Open GreyTeardrop opened this issue 1 year ago • 1 comments

Description

It seems like the https://github.com/mc1arke/sonarqube-community-branch-plugin/pull/884 change has affected minimization of comments for SonarQube instances that run on Linux or macOS.

The root cause is that MarkdownFormatterFactory uses System.lineSeparator() as the end-of-line character for annotation comments. GraphqlGithubClient.postSummaryComment(), however, uses hardcoded \r\n as end-of-line character, so it isn't able to match legitimate comments if SonarQube is not running on Windows.

This change updates GraphqlGithubClient to also use system end-of-line char.

(It also moves String.format call out of the comment iteration logic to avoid making multiple identical calls).

GreyTeardrop avatar Apr 17 '24 23:04 GreyTeardrop

Thank you @GreyTeardrop , @mc1arke is it possible to merge this one soon please? it's very annoying to have spam of comments on PRs.

nklarman avatar May 02 '24 12:05 nklarman

Merged, thanks for the contribution

mc1arke avatar Aug 11 '24 07:08 mc1arke