Hi,
I am having issue while generating PR decorations for one of a private project. We are using Bitbucket CI pipeline to trigger the analysis (repository in bounded with SonarCloud project).
Pipeline is correctly triggering the SonarCloud analysis step under pull request and its completing successfully but PR decoration on Bitbucket platform is not showing, after checking SonarCloud platform i found analysis is happening under development branch (Main branch) but not for Pull Request.
Any suggestion why it is happening and how to resolve it.
Yes, Instead of PR analysis it is running as branch analysis.
I am using Bitbucket CI pipeline to trigger PR analysis, and it is triggering analysis as well but on SonarCloud it is running as branch analysis rather than PR analysis.
Can you please elaborate how do I get that information ?
What I am doing is simply triggering the analysis for Pull Request from Bitbucket CI under PR step.
I was following the same steps for other projects and was working fine for them.
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
If i am not mistaken you look at line number 43, 44, 45, 88, 94, 101 etc of Log file it clearly says PR. These are not found in branch analysis logs (I have verified that with branch analysis logs).
This is my bitbucket-pipelines.yml file structure to trigger analysis.
Thanks for pointing those out. I overlooked them initially. There’s nothing in the analysis portion of the log that indicates those envvars were picked up & the analysis recognized as being for a PR.
Since it looks like you’re using the latest version of the sonarcloud-scan pipe, I’m going to flag this for more expert eyes.
From investigation, I believe you created the project anew in SonarCloud. Can you tell if you still facing the same issue in this new setup?
If so, we would like to capture more information to investigate further:
turn on the debug mode, e.g.
variables:
DEBUG: 'true'
print the values for those environment variables: CI, BITBUCKET_REPO_OWNER_UUID, BITBUCKET_REPO_UUID, BITBUCKET_BRANCH, BITBUCKET_COMMIT, BITBUCKET_PR_ID, and BITBUCKET_PR_DESTINATION_BRANCH
a reproducer repo/pipeline that we would be able to access would be even better
Both my SonarCloud project and Bitbucket repository are private. I don’t think its safe to share those information here in public platform.
Please message me privately or suggest any other way to share those information.