We are using Azure DevOps YAML based builds which support MultiRepo Checkout Feature. That is a single build pipeline can have sources from Multiple Repo’s.
So here is my situation, where I have a Product A which comes from RepoA, and its supporting modules B,C,D from RepoB,RepoC,RepoD. Each module is developed by separate teams. B,C,D itself does not have any build pipelines, but gets built during CI Pipeline of A is being run.
Now I have separate different stages, for checking out B,C,D modules and building those. After which Product A is also cloned and built with B,C,D modules as supporting libraries.
YAML code for this entire pipeline is saved in RepoA.
Now when I use SonarAnalysis in each stage as part of build process, its detecting the branch of RepoA (where in which YAML code is placed) but not the correct branches of other repo, even when i have seperate build stages for each Module/repo. Let’s say
ProductA->RepoA | Branch->Release-v3.0
Module B->RepoB | Branch->Master
Module C-> RepoC | Branch->Release-v2.5
Module D-> Repo D | Branch->Release-v2.7
If I configure Sonar for branch analysis during build, its taking Release-v3.0 as the branch (Where in which YAML for pipeline is kept) for all components instead of detecting their respective branches.
I tried using sonar.branch.name in each stage pointing to different branches, but its not working. Am I missing something or is it something by Design.
I am using SonarQube version 7.9 LTS Enterprise Edition. And using latest sonarqube tasks which is published in Azure DevOps Market Place