We just integrated SonarQube in our Gradle build using plugin “org.sonarqube” version “2.7”.
Our project is hosted on GitHub with sonarqube app installed and privileges granted on our project.
While sonarcloud.io is reporting all builds correctly with findings and green/red status GitHub is randomly not updated when the build finishes but keeps showing “SonarCloud Code Analysis Expected — Waiting for status to be reported”.
Sonarcloud and Github are linked correctly (i.e. the organisation, for a paid plan).
The sonarqube gradle task finishes as follows:
> Task :sonarqube
> 1012 files had no CPD blocks
> Calculating CPD for 1898 files
> SCM writing changed lines
> SCM writing changed lines (done) | time=49ms
> Analysis report generated in 279ms, dir size=3 MB
> Analysis report compressed in 1170ms, zip size=2 MB
> Analysis report uploaded in 1219ms
> ANALYSIS SUCCESSFUL, you can browse https://sonarcloud.io/project/issues?id=XXX&pullRequest=215&resolved=false
> Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
> More about the report processing at https://sonarcloud.io/api/ce/task?id=xxxxx
> Analysis total time: 3:54.203 s
> :sonarqube (Thread[Execution worker for ‘:’ Thread 2,5,main]) completed. Took 4 mins 20.742 secs.
How can we dig deeper to find the cause of the intermittent status update failures?
And when this happens, if you trigger the same build without any changes, does it get the status update? I’m asking to make sure it’s really an intermittent failure, and not specific to the content of the PR. Can you please confirm?
Retriggering doesn’t help - did so multiple times with and w/o new commits.
The output is saying everything is fine (as shown above) and SonarQube portal shows green build without warnings or error. Following details also do not reflect any obvious issues afaiks:
Is there flags we can add to get more information or do you see any issues in the above status?
Looking at our currently open PRs none actually got updated by SonarQube. Did something change? A few days ago at least some got updated…
Maybe one additional note: we had issues linking SonarCloud and GitHub and tried it multiple with different accounts until it finally succeeded - not sure if that has any impact…
It’s been awhile since this thread was updated last. I’d be glad to support by e.g. providing further details. Please let me know if you need anything or have any updates to share.
the sha1 of the head of the pull request on GitHub
the sha1 in the working tree where the scanner runs (see the logs on your CI system)
If they don’t match, that will explain why decoration appears to be missing: SonarCloud decorates the sha1 of the working tree.
If the above still doesn’t help understand the issue, then please:
Which CI system are you using?
When you open the pull request on SonarCloud, do you see a link in the top-right corner labeled “See the PR”, and does it point to the correct PR on GitHub?
Hey!
Yes, I did check the SHA on Github and Jenkins ci both are equal. We currently disabled sonarcloud dependency github, as it doesn’t work reliable (in our case). Will try with latest plugin.
Is the project on SonarCloud public? If yes please tell me which one. And then, also some pull request numbers that were not integrated properly. (I would need something recent, because we currently don’t keep logs older than 30 days.)
It’s been a while and we haven’t worked on this issue - but something changed so I at least want to give some feedback to close this issue:
I’m not sure what did the trick and if it is actually the fact that we synced GitHub with SonarCloud instead of just connecting them from SonarCloud. Now the PRs get annotated correctly it seems. I still need to check whether there is any exceptions to this - but I haven’t seen any PR lacking the annotation so far.