which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) --> Developer Edition Version 8.6 (build 39681) and GitHub Enterprise version --> GitHub Enterprise Server 2.20.9
what are you trying to achieve --> Pull request decoration
what have you tried so far to achieve this --> followed the documentation and successfully created ALM integration but not showing comments and checks in Github.
You’ve enabled the ALM configuration at the project level (under Project Settings / General Settings / Pull Request Decoration)
You’re including appropriate parameters to identify the Pull Request during analysis - please attach a full log of the analysis starting from the invocation of the sonar-scanner
Aha! I think I see the problem. In the project settings, the “Repository identifier” should be the org/repo name, not the full URL. So just aarewar/MyRepoOrigin in your case.
Try a fresh analysis after changing that and see if it fixes the issue.
@Jeff_Zapotoczny I tried as per above but still It didn’t worked and under checks tab in github show same (Waiting for checks information…) and no comment section too.
is there any way we can sync up on call? or what other details you need please let me know
Could you please specify the log file name? SonarScannerLogs.txt (54.9 KB)
Please check the attached a logs if not works then please specify the log file name.
Thank you. I don’t see any evidence in those logs that you’ve actually directed the scanner to do a pull request analysis. The required parameters are missing.
I have tried with the analysis parameter please check log file once With analysis parameter.txt (34.0 KB)
Good new is now I can see the checks in GitHub now but with broken images.
The broken images are almost certainly happening because your SonarQube server’s base URL isn’t set to something reachable by GitHub. You can configure it via Administration / General / Server base URL. The decorated markup added to GitHub includes references back to your SonarQube server to load the images.
@Jeff_Zapotoczny Firstly Thank you so much for your help in whole process much appreciated
Regarding broken image I have already configured Administration / General / Server base URL
Try removing the trailing slash from your URL; this has sometimes caused problems. And it will require a fresh PR decoration to test if this fixes things – the new URL value must be communicated fresh to GitHub.
If that somehow doesn’t resolve it, you’ll need to use your browser dev tools when loading the GitHub checks page to see what the true cause of the problem is. There could be other network-related issues at play.
Ok I will try with above solution.
One more thing wanted to check my sonar server is not accessible from other system.
I can only access it from localhost machine and not from any other machine.
How I can access it from other machine?
That’s more of a general networking question, not a SonarQube problem. It’s up to you to expose a port on your SQ server, possibly set up a reverse proxy, set up DNS if desired, etc. In cases where GitHub Enterprise (and not github.com in the cloud) is used, we assume bi-directional communication between SQ and GitHub should be possible.
The approach we’d recommend to have analysis for all users is to perform the analysis centrally, preferably automated as part of a CI system like Jenkins. This way you don’t have to worry about every individual developer needing to run parameterized scans and getting it correct each time; analyzing the same project from multiple different workstations can also lead to issues if the project parameters aren’t set consistently.
I’m not clear what you’re asking regarding the pom.xml? You can add sonar analysis parameters directly in the pom.xml, however for dynamic parameters like PR I would instead recommend to pass them on the command line.
Do you have any sample example for analysis parameter?
How do I get pull request key at run time and without executing in command line?
Currently I am executing command line after pull request is generated.
But wanted to execute PR Decoration as soon as I create pull request without hitting command line?