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

Github comments are minimized even on different project keys

Open abbudao opened this issue 2 years ago • 1 comments

Hey @mc1arke, first of all, thank you for your fantastic work. The plugin works like a charm and has been a very pleasant experience! I'm unsure if my reporting is a bug or should be considered an enhancement.

Describe the bug Currently, the last comment made by the bot is being minimized regardless of the project key, so only a part of my analysis is visible.

To Reproduce Steps to reproduce the behavior: On a mono repo setup, run two Sonarqube analyses with different project keys

Expected behavior

In a mono repo setup, a branch with multiple projects affected should have the latest comment of each project visible.

Screenshots 2023_07_12_0f1_Kleki

Software Versions

  • SonarQube Version: 9.9.1.69595
  • Plugin Version: 1.14

Additional context I'm available if you need any additional context or help to reproduce. Although I'm not a Java programmer, I can contribute if you support this enhancement but don't have the time to commit to it.

abbudao avatar Jul 12 '23 12:07 abbudao

Noticed this as well for our monorepos.

hballangan-mdsol avatar Feb 06 '24 01:02 hballangan-mdsol

this drives me crazy as well 🙃

unfortunately it looks like comment's can't store metadata. so the simplest way forward would probably be to check the comment body for the project key.

basically fetch the body through the GraphQL API and filter with a string include of

**Project ID:** MyProject.Key\r\n

currently the comments are filtered here with the bot name. so it should be pretty straight forward to also add a filter with the project key in the body.

https://github.com/mc1arke/sonarqube-community-branch-plugin/blob/895a89d75176c40f95bf5c14fd238d5d3f5761b9/src/main/java/com/github/mc1arke/sonarqube/plugin/almclient/github/v4/GraphqlGithubClient.java#L137-L141

OneCyrus avatar Mar 04 '24 08:03 OneCyrus

I just implemented some additional logic which should only minimize comments with the same project key. this still needs some testing.

#884

OneCyrus avatar Mar 06 '24 19:03 OneCyrus

Released as part of 1.19.0 of the plugin (Sonarqube 10.4)

mc1arke avatar Apr 08 '24 12:04 mc1arke