Analyzing branch off of a long lived branch

Which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube version 7.9.3
TeamCity SonarQube Scanner Plugin version 3.0.3.778

What are you trying to achieve
We have a main branch named develop and we also have a release branch named release-4.6. The release branch is marked as a long lived branch. If we create a branch (call it d-1) off of the develop branch and run an analysis on d-1 everything works fine. The d-1 branch shows up as a branch under develop. The changes in the d-1 branch is marked as new code and the analysis works as expected.

Next a branch is created off of the release-4.6 branch (call it r-1) and run an analysis, the r-1 branch is showing up under the develop branch when looking at the branches into branch pull down in the GUI. The analysis is failing because it looks like the changes are being compared against develop instead of release-4.6. Since this branch is created from release-.4.6 not develop I was expecting it to show up under the release-4.6 long lived branch. How do we get a branch created off of a long lived branch to show up under the long lived branch instead of the main branch?

Hi,

It sounds like your r-1 branch analysis was missing the sonar.branch.target parameter. That has changed since 7.9, so you won’t find it in the latest/current documentation; you need to reference the docs for your version to see it.

 
HTH,
Ann

Yes, I do not have that specified. I will give that a try.
Thanks
Mark

Following up…Adding the sonar.branch.target parameter resolved my issue.

Thanks again
Mark

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.