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

Fix detection of previous PR annotation comments #898

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GreyTeardrop
Copy link
Contributor

Description

It seems like the #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).

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.
Copy link
Contributor

@OneCyrus OneCyrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@nklarman
Copy link

nklarman commented May 2, 2024

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

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

Successfully merging this pull request may close these issues.

None yet

3 participants