Github Enterprise PR Decoration with SonarQube Developer Edition

Version used: Github Enterprise Version 2.16.4, SonarQube Developer EditionVersion 8.0

Trying To achieve: PR decoration as per this link. This is where developers can have an auto trigger of checks on Github as per PR.

Tried so far: Have a repo with master and feature branch. Already did configuration as per this link and this link Ran analysis on master branch using below:
mvn sonar:sonar -Dsonar.projectKey=sonarqube-pr-sample -Dsonar.host.url=http://xxxxxxxx -Dsonar.login=xxxxxx

After this ran analysis on feature branch as per below:
mvn sonar:sonar -Dsonar.projectKey=sonarqube-pr-sample -Dsonar.host.url=http://51.137.207.209 -Dsonar.login=fdad66234ae884919aa9912f91234d435334f5ce -Dsonar.pullrequest.branch=sample-feature -Dsonar.pullrequest.key=1

Got the results as per below screenshots

Looking for a solution to enable Github PR checks

Hi @Deepak_Dinakaran, and welcome to this forum !

As you can see in your screenshot, in the Background Tasks page the last analysis of the PR (demo / 1) has failed.
You need to check content of the error logs by clicking on the wheel on the right of the task.

Regards

Hi @julienlancelot,

Thanks for the reply. I agree. But what I am trying to achieve is as per this link(https://github.com/SonarSource/sonar-training-examples/pull/56) Please see the screenshot below. The query is how and what should I configure for Pull Request Analysis with PR Decoration on Github.

Hope this clarifies the query.

I totally understand your query, and what I’m trying to tell you is that the PR decoration is not working because the PR analysis made by SonarQube is failing in your Background Tasks.

In order to solve this issue you need to check which error is reported in the task.

Hi @julienlancelot,

Apologies. Please see attached log file.
sonarqube.txt (4.6 KB)

Please advice.

Thanks
Deepak Dinakaran

So, as you can see in the file, the error is :

Caused by: java.lang.IllegalStateException: The property ‘sonar.alm.github.app.id’ is not an long value: For input string: “Iv1.5467be83b3be01b6”

Hi @julienlancelot,

All good now. Thanks. Post scan I have some missing icons. Is there a fix for the below. On copying the image address I got this http://127.0.0.1:9000/static/developer-server/checks/QualityGateBadge/failed.svg

Please advise
Deepak Dinakaran

You need to specify the public URL of your SonarQube instance by setting it in Administration > Configuration > General Settings > Server base URL.

Hi @julienlancelot,

Thank you. This partially fixed it. Presently the Server base URL is updated. The link does work. However the images on the screenshot sent earlier is not updated and are still shown in github as broken images. On extracting of the image URL it works successfully.

Is there a fix or suggestion for this.

Thanks
Deepak Dinakaran

It may be a caching issue of your browser.
Please on another internet browser or in a private session.