- SonarQube Version: 8.5
- Get only the appropriate comments (enabled PR decoration feature)
- SonarQube Developer edition.
Problem Statement: When someone merges the code into master (from pull request say PR1) and right after that if a gated build triggers on other PR (let’s say PR2); after PR analysis as part of PR decoration, we get some additional comments in PR2 (about SonarQube reported bugs, code smell, etc.) for source code changes merged to master in PR1.
Information:
We have enabled the below features on Azure DevOps and SonarQube instance:
- In ADO, the gated commit branch policy is enabled for the pull requests (the CI build executes on a merged snapshot of pull request changes on top of the latest master code).
Refer: https://devblogs.microsoft.com/buckh/gated-checkin-for-git-using-branch-policies-to-run-a-build-in-vsts-and-tfs/ - Integrated SonarQube with our ADO CI pipeline to get the Quality gate status of the pull request.
- In SonarQube instance, PR decoration feature is enabled to get the comments in case SonarQube finds bugs or code smell, etc.
We have also configured a full SonarQube scan on the master branch and it gets triggered whenever something gets merged to the master.
Can you please look into the issue and provide us the solution asap?
Thanks,
Sandy