javamachr / sonar-gitlab-plugin

Add to each commit GitLab in a global commentary on the new anomalies added by this commit and add comment lines of modified files
GNU Lesser General Public License v3.0
121 stars 21 forks source link

Link to SonarQube on comment. #7

Open stevehipwell opened 3 years ago

stevehipwell commented 3 years ago

It would be great if there was a link back to SonarQube from the GitLab comment on the default template.

xkx commented 3 years ago

We consider to change the template manually. What variable should I use?

stevehipwell commented 3 years ago

@xkx there is a section at the bottom of the README showing the template language and variables.

xkx commented 3 years ago

@stevehipwell Thank you for your reply. I have read the document but didn't find it...(searched for 'url', 'link' and something else)

I want to get the exact url for certain issue, for example http://sonarqube.somesite.com/issues?id=proj&issues=123 or the exact url for the code http://sonarqube.somesite.com/code?id=proj&path=file_path

It's useful. Especialy when we are facing some duplicated code blocks.

'sonarUrl'? It's url of the global SonarQube site, I think. Maybe I can join this URL and 'Issue.key'/'Issue.src' to get the right url? I need to have a try but not yet do that, so probably I'm totally wrong.

stevehipwell commented 3 years ago

@xkx that's our thinking if we can't get a PR to add it by default. It looks like the templating language has a way to URL encoded (my colleague did the work on this so I'm just going from memory).

xkx commented 3 years ago

@stevehipwell I will give it a try. Thank you very much.