gabrie-allaigre / 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
713 stars 208 forks source link

sonar.gitlab.url missing port #99

Closed evbo closed 6 years ago

evbo commented 6 years ago

Hi,

I have set my sonar.gitlab.url correctly with a port (8888) In SonarQube: Administration > GitLab > GitLab url

However, the comments that are embedded in my merge request have links to the issues with the port (8888) missing. As such, all links are broken until I manually add the 8888 port back into them after clicking on them.

Is this a bug? How can I ensure the port is used for generating all links to my project source?

gabrie-allaigre commented 6 years ago

Hi, I use web_url in project api

https://mygitlab:8888/api/v4/projects/:id

replace id by id project, found in settings project in gitlab In json, I use field web_url

Have you correct url ?

Thanks

evbo commented 6 years ago

It turns out in order for this to work the external_url must have the port explicitly referenced in /etc/gitlab/gitlab.rb

I didn't originally have that set because I was accounting for it with:

##! **Override only if you use a reverse proxy**
##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html#setting-the-nginx-listen-port
nginx['listen_port'] = 8888
gabrie-allaigre commented 6 years ago

Thanks

evbo commented 6 years ago

Related to this issue with Comments is that gitlab "issues" also don't include the port. I am posting an issue separately for that here: https://gitlab.com/gitlab-org/gitlab-ce/issues/42608

So, I have the Comment that links to the source code file working, but the "Issue" links (that reference the line of code) still don't work because of this bug/misconfiguration in gitlab.