Hi,
Pull Request reviews is a very nice feature! Thank you so much.
Problem is the “Code” tab is always empty on my Pull Request reviews.
Example : https://sonarcloud.io/code?id=monica&pullRequest=1553
The only message is “No results”, but I added some code (and bugs) in this PR to test Sonar.
The consequence is all PR reviews are always OK, even if there is a new bug … which reduce the interest of PR review!
I’ve just made a test on my side to replicate your use case, and I do get issues on the PHP file. There must be a problem somewhere on CI side. Which CI service/software are you relying on? Can we get access to the logs?
Hi Fabrice.
We use CircleCI and sonarscanner 3.2.0.1227
See this build: https://circleci.com/gh/monicahq/monica/6214 (“Run sonnar scanner” step).
The report is done (EXECUTION SUCCESS)
INFO: Calculating CPD for 263 files
INFO: CPD calculation finished
INFO: Analysis report generated in 748ms, dir size=3 MB
INFO: Analysis reports compressed in 2106ms, zip size=1 MB
INFO: Analysis report uploaded in 964ms
On the branch/PR, it looks like:
INFO: Skipping CPD calculation for short living branch and pull request
INFO: Analysis report generated in 132ms, dir size=55 KB
INFO: Analysis reports compressed in 11ms, zip size=16 KB
INFO: Analysis report uploaded in 382ms
I ran a scan with verbose option, see https://circleci.com/gh/monicahq/monica/6298
I also removed sonar.pullrequest.github.id option, and installed the Sonarcloud application. This is great !
Hi @asbin,
Could you please try to restart the build and the analysis with SonarCloud of the PR?
We can’t reproduce the problem and we just want to exclude the possibility that the problem is no longer happening due to the changes that were done meanwhile in master.
Thanks.
So the only thing we can think of is that the clone of the git repository in circleci has some references that are no longer valid.
Could you please add, to the P/R, the following to the runsonar.sh (in the method gitFetch, for example):
This looks buggy to me. It’s pointing master to the the commit being built (which in this case is HEAD of test-sonar), then it checks out the branch (test-sonar) and points it as well to the same sha1. As a result, the local reference to master is wrong (pointing to the test-sonar instead of master).
If it’s the same issue, the posts above should answer your question. There is a workaround available - fixing the underlying issue depends on circleci.
A fix was deployed today. The bug should now be fixed without having to override the checkout task provided by CircleCI.
Please reach us if you still have troubles. Thanks.
cc @asbin@timols