We are integrating Pull Request in Github and always return no issues:
In SonarCloud the PR appears but don’t show any code:
I’m revising all the documentation and I can’t see what’s wrong…
Thanks!
We are integrating Pull Request in Github and always return no issues:
In SonarCloud the PR appears but don’t show any code:
I’m revising all the documentation and I can’t see what’s wrong…
Thanks!
Can you please clarify your context?
Interestingly we have the same behaviour since about 2 days ago.
We are using Sonarcloud and the Bitbucket Pipeline Integration. While this is not Github, which Miquel Labòria is using, we do have the same result. The Sonar call creates an analysis reports and pushes the information succesfully to sonarcloud (the report processing task is successful). But there are simply no code changes to be found in the analysis linked to the Pull Request.
The call is done like this:
mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.projectKey=... -Dsonar.organization=... -Dsonar.login=$SONAR_TOKEN
Interestingly the code changes for the short lived branches are still recognized correctly until a Pull Request is created.
If I trigger a code analysis manually via
mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.projectKey=... -Dsonar.organization=... -Dsonar.login=... -Dsonar.pullrequest.base=develop -Dsonar.verbose=true -Dsonar.pullrequest.branch=... -Dsonar.pullrequest.key=671 -Dsonar.pullrequest.provider=bitbucketcloud -Dsonar.pullrequest.bitbucketcloud.owner=... -Dsonar.pullrequest.bitbucketcloud.repository=...
it is added correctly to the Pull Request and we can see code changes. But while doing so I do get a warning
This does not make sense, as the SonarCloud application is already correctly bound. (I can’t attach a screen of this unfortunately as I am not allowed to do so)
There are multiple languages used including Java, Kotlin, Typescript.
PS: If this should be in a different ticket, I gladly create a separate one. Nonetheless the error behaviour is so similar so I added this her for now.
Edit: We no longer see code changes while triggering it manually, yet the warning remains and the activity is still updated.
We use:
We trigger the analysis via Bitrise.io and use an script with the parameters
Hi @Fabrice_Bellingard Did you have time to look into this? Is there any information you are still missing?
@hauke Can you please open a new thread? The behaviour might look the same but the environments are different. Thanks.
@miquellaboria Thanks for the answer. Since you see the PR inside SonarCloud, and you see the “Successful” status at the bottom of the GitHub PR, this tends to show that the analyses are correctly configured.
Now, can you create a PR with just a very simple issue, like for instance adding a TODO in a file:
func doSomething() {
// TODO
}
Finally we solved.
The problem was Bitrise make the git clone on the base branch and do a merge in it. Sonar then can find any differences between branches and can’t check code.
Now we do the checkout manually and the validation works fine.
Thank you!
Thanks for explaining the situation @miquellaboria!
Hi having some problems with this also. I understand the problem but not the solution. So did you add a script step in the Bitrise workflow to checkout back your pull request branch? Before running the sonar scanner?
From what I can tell, we’re running into the same issue on Bitrise for an iOS project. It would be super useful if someone can post a step-by-step solution.
Can you please explain how you solved this
How did you integrate bitrise to post the sonar results as a comment in the Pull request?
I’m aiming to do the same but no luck so far.