GitHub Pull Request Decoration images are broken

SonarQube:
Version: 7.9.1.27448
Developer Edition
Offline Distribution

Sonar Scanner Windows:
Version: 4.0.0.1744

Git Plugin:
Version: 1.8 (build 1574)

GitHub Authentication for SonarQube:
Version: 1.5 (build 870)

I am currently trying to automatically analyze pull requests in GitHub from my Jenkins environment. I have this mostly working, so far the following works correctly:

  1. Pull Request Analysis in SonarQube is automatically kicked off when a Pull Request is opened.
  2. Pull Request Analysis is successful and is uploaded to SonarQube
  3. SonarQube decorates the PR in the checks tab in GitHub.
  4. The links in the PR decoration link back to our SonarQube server.

The issue I am stuck on is that all of the images in the PR Decoration are broken links because they point to “localhost” instead of pointing to my server’s address. See below picture to see what I am seeing.

I have set the “Administration -> General -> Server base URL” to my server’s address and this is what resolved a similar issue I had with the links. It seems the images do not respect that setting though. Is there a setting I am missing?

Hi,

You’re not the only one to notice this! :wink:

It’ll be fixed in 8.0:

SONAR-12329 - Missing icons in GitHub Enterprise PR decoration

 
Ann

Thanks I thought I read the other posts and saw people saying it was already resolved so figured I was missing something. Any idea when that fix would be coming? I am currently in the evaluation period for the Developer Edition and need to prepare an analysis of the features for my organization to decide if we are going to purchase it. Would be helpful if I could highlight that it would be fixed around a certain date.

Hi Daniel,
The issue is fixed in 8.x but there is a workaround for 7.9.x so you don’t have to wait. Restarting SonarQube instance after setting a proper sonar.core.serverBaseURL should fix the problem.

1 Like

Hi,

and the current target release date for 8.0 is the end of Sept.

 
:slight_smile:
Ann

Thank you both for your help. Restarting the server worked and the icons appeared after I reran my Jenkins job.

2 Likes

Hi,
I’m using the developer edition 8.1 and I have the images broken in my PR Decoration. The links to Sonarqube are pointing to the right place as I set the Server Base URL parameter but the icons are still broken.

As a detail, I run my Sonarqube instance in a VPN protected URL but I’m logged in my VPN when accessing the PR decoration page in GitHub.

When inspecting the page, l see this code:

<img src="https://camo.githubusercontent.com/1855cf7b0d7929b021203c76fa13f4ae866a9614/68747470733a2f2f736f6e6172717562652e746f6f6c732d6b38732e68656c6c6f66726573682e696f2f7374617469632f646576656c6f7065722d7365727665722f636865636b732f436f76657261676543686172742f4e6f436f766572616765496e666f2e737" alt="No Coverage information" title="No Coverage information" data-canonical-src="https://MY SERVER URL/static/developer-server/checks/CoverageChart/NoCoverageInfo.svg" style="max-width:100%;">

Accessing https://MY SERVER URL/static/developer-server/checks/CoverageChart/NoCoverageInfo.svg displays the image successfully.

Any thoughts?

2 Likes

Hi,

I have same setup, and exactly same issue,
I’m using 8.2.0.32929 and developer edition,
the server url is only accessible via VPN and the images are not loaded on the client.
Let me know please if there’s a workaround or solution to it.

Thanks

2 Likes

@Fernando_Torres Did you get any workaround for the same ? As I am using internal server images are not loading.
If there is some option to change url only the static content’s that would have been great

This is how I solved it,
I ran a service which proxy passes all /static URL and redirect everything else to the internal host of sonarqube.
Then I enabled this service for external network and used this as base-url in sonar settings.
The PR icons shows up properly and all links also works.

@Fernando_Torres, @abhishektaneja, @Tibin_George_Kuriyan Are you using github.com or an on-premise version of GitHub?

Blockquote Are you using github.com or an on-premise version of GitHub?

we are using http://github.com

1 Like

It looks like there is a ticket to address this problem: SONAR-13106. Feel free to upvote.

Hi Michael, I’m using github.com

Any progress on this https://jira.sonarsource.com/browse/SONAR-13106. ?
–cc @Michal_Duda

Hi All,

I am also facing the same issue, and I am using the Gitlab.
We are using the SonarQube Developer edition 8.4.1. And we also add the url in the sonar.core.serverBaseURL (After that restarted the server).

Still the all the links/images points to the localhost.

http://localhost:9000/dashboard?

Could you please help on this.

Regards,
Nagaraj