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).
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
usesSystem.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).