No metrics available on short living branches not branched from master


(Semjon Krolzik) #1

We are using SonarQube 7.5 developer edition with the Scanner and analysing java projects.

If we analyse a short living branch branched from master we can see under “Measures” the interesting points like new code smells and coverage on new code (with sonar.branch.target=master).
But we are using the normal git branching model, so development as long living branch is branched from master and the short living branches are branched from development.
In this branches we see under “Measures” in the topic “Coverage” only one point “Estimated after merge”, missing issues, code smells and coverage on new code (with sonar.branch.target=development).
What should we do to see the metrics on SLBs not branched from master?


(G Ann Campbell) #2

Hi,

Is your target in this case a non-master Long Lived Branch, or a Short-Lived Branch (SLB)? I ask because we don’t support (yet) SLBs as targets.

 
Ann


(Semjon Krolzik) #3

Hi,
it’s a long living branch.
Semjon


(G Ann Campbell) #4

Hi Semjon,

Is there anything relevant-seeming in your analysis logs? Could we have a screenshot? Also, is this relevant: https://jira.sonarsource.com/browse/SONARSCGIT-35?

 
Ann


(Semjon Krolzik) #5

I tried following:
mvn sonar:sonar –Dsonar.branch.name=feature/5 –Dsonar.branch.target=development. This leads to following picture:


As you can see it’s stated green with no code smells.

After this i used the same source but choose master as target
mvn sonar:sonar –Dsonar.branch.name=feature/5 –Dsonar.branch.target=master. This leads to following picture:


Here you see the code smells, but it’s the same code.

BTW: master and development has the same source.


(Duarte Meneses) #7

Hi @skrolzik,

Does feature/5 actually forked from development at some point (i.e. do they have a commit in common?)
When using development as the target, do you get any warnings in the scanner logs?
Could you perhaps send us the logs (privately)?