Template for a good new topic, formatted with Markdown:
ALM used (Bitbucket Cloud)
CI system used (Bitbucket Cloud)
Scanner command used for Pull Request Pipelines
Languages of the repository: Javascript
Steps to reproduce
Have a mono repo configured in SonarCloud and multiple projects bound to the mono repos
In bitbucket, the mono repo includes the all projects
Apply quality gate feature for the mono repo in bitbucket pipeline
When an PR pipeline of the mono repo is completed in bitbucket pipeline, the pipeline does code analysis for some projects in the mono repos and are reported in PR analysis in SonarCloud, there are 1 project failed Quality Gate and reported in SonarCloud. However, in bitbucket PR, it is reported as Quality Gate passed, and was linked to the latest analysis result (which was passed)
Question: For Quality Gate and Bitbucket PR integration, could we support Quality Gate checks for all projects analyzed in mono repository?
Hi @Colin ,
I could configure and got same result as you shared. However, it doesn’t meet my expectation. Here is the scenario:
Have a mono repo having AppA and AppB
In the PR pipeline of the mono repo, it has multiple apps that get analysis separately but still in same PR pipeline. In this case, they are AppA and AppB
After the analysis has done in SonarCloud (AppA completed the analysis first then AppB did), I could see multiple PRs report for the apps: AppA and AppB: AppA failed the Quality Gate, AppB passed the Quality Gate in SonarCloud.
However, in the Bitbucket PR of the mono repo, in Quality Gate build, it only displayed the last completed analysis at step 2 and the result. In this case, Quality Gate Build Result shown in the Bitbucket PR was green → I expected it should be failed because Quality Gate for AppA was failed.
Hi @Colin ,
Here are the screenshots for the Quality Gate Result displayed in Bitbucket PR of our mono repo. In this case, we had 2 PRs analysis result, first one got failed and the other passed. The UI only linked to the passed one because it was completed after the failed one.
I think the issue here might be that you’re providing the same project key to the scanner for each analysis. Could you share your Bitbucket Pipelines YML?
No, they are using different keys definitely. I already checked them. And in sonarcloud , I also saw 2 PRs for the 2 bound projects in sonarcloud. Could you share your check that show 2 different quality gate builds in your bitbucket PR that you shared above?