Property to set project id so that multiple SonarQube projects can comment on the same pull request.#31
Conversation
75cd8a3 to
59960f7
Compare
|
We have this exact same issue, glad that someone already proposed a fix. |
|
@henryju @piotrwach any chances of getting this in for the next version? |
|
To be honest I'm not really happy to "corrupt" comments to store a technical id. Another option would be to use a different technical account for each project, but that is also not ideal. |
|
I think it is up to the users of this plugin to decide what they prefer - the id in the comment doesn't look that bad, we use my modified version that has it all the time. I have considered having separate account per project, but this doesn't scale well. |
|
A colleague found a nice trick to hide the id: insert it as a reference at the bottom |
…mment on the same pull request.
59960f7 to
a520c41
Compare
|
@henryju good to go? |
|
@henryju @teryk Is there a chance to get this merged? Having such feature would be very useful for monorepo style projects where multiple deployables live in a single repository - for such repositories, it is not feasible to create single SonarQube project, as the SonarQube projects should belong to and expose the metrics of the individual deployable component of the repository, and a huge single SonarQube project does not provide any useful or actionable information for monorepos. If more work is needed, I can try to take this up. Do you have any extra requirements besides the format change and using project key instead of dedicated parameter? |
|
@henryju reading up on the referenced issues and PR's, is the official line of SonarSource that monorepos are not supported, and never will be? |
|
hey @henryju I've asked on the SONAR product forums and G. Ann Campbell, SONAR's Product Owner, has stated the plugin would not support monorepos. Here is the relevant thread. Seems like forking is needed if monorepo support is desired :( |
|
@ripla Never say never ;) But indeed currently we don't plan to support that. |
|
I have built this plugin myself with my changes, and this is how we are using it. So everyone who needs this functionality I suggest to do the same. It takes just few minutes to do. |
|
Yeah, that's what we did as well. |
Example:
PR changes project A and project B, Jenkins runs sonar-scanner for A, github plugin posts comments on PR, then Jenkins runs sonar-scanner for B, github plugin deletes previous comments for project A, and replaces them with comments for project B.
My solution adds unique
project idto each comment, so that only comments related to specific project get updated / deleted.