Skip to content
This repository was archived by the owner on Apr 2, 2019. It is now read-only.

Property to set project id so that multiple SonarQube projects can comment on the same pull request.#31

Closed
piotrwach wants to merge 1 commit intoSonarSource:masterfrom
piotrwach:dev/flag-to-set-project-id
Closed

Property to set project id so that multiple SonarQube projects can comment on the same pull request.#31
piotrwach wants to merge 1 commit intoSonarSource:masterfrom
piotrwach:dev/flag-to-set-project-id

Conversation

@piotrwach
Copy link
Copy Markdown

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 id to each comment, so that only comments related to specific project get updated / deleted.

@piotrwach piotrwach force-pushed the dev/flag-to-set-project-id branch from 75cd8a3 to 59960f7 Compare March 23, 2017 16:14
@ripla
Copy link
Copy Markdown

ripla commented Mar 30, 2017

We have this exact same issue, glad that someone already proposed a fix.

@ripla
Copy link
Copy Markdown

ripla commented May 29, 2017

@henryju @piotrwach any chances of getting this in for the next version?

@henryju
Copy link
Copy Markdown
Member

henryju commented May 29, 2017

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.

@piotrwach
Copy link
Copy Markdown
Author

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.

@henryju
Copy link
Copy Markdown
Member

henryju commented May 30, 2017

A colleague found a nice trick to hide the id: insert it as a reference at the bottom [project-id]: the_id. Then, instead of asking users to manually configure a project id, we could use the project key. That would solve all my concerns (bad rendering, extra configuration). WDTY?

@piotrwach piotrwach force-pushed the dev/flag-to-set-project-id branch from 59960f7 to a520c41 Compare May 31, 2017 07:57
@ripla
Copy link
Copy Markdown

ripla commented Jul 5, 2017

@henryju good to go?

@mszabo-wikia
Copy link
Copy Markdown

mszabo-wikia commented Oct 20, 2017

@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?

@ripla
Copy link
Copy Markdown

ripla commented Nov 13, 2017

@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?

@mszabo-wikia
Copy link
Copy Markdown

mszabo-wikia commented Nov 13, 2017

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 :(

@henryju
Copy link
Copy Markdown
Member

henryju commented Nov 13, 2017

@ripla Never say never ;) But indeed currently we don't plan to support that.

@henryju henryju closed this Nov 13, 2017
@gosuwachu
Copy link
Copy Markdown

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.

@mszabo-wikia
Copy link
Copy Markdown

Yeah, that's what we did as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants