A SLB-audit brings new issues, the analogous Main-audit doesn't bring NEW issues (only issues)

I’m using SonarQube, Enterprise Edition, Version 7.7

I did the following:

a) Audit of a sonar-Project on the Main Branch with sonar.exclusions = **/*.*, latest state on Git-branch “master”;
I got 0 issues like I wanted to.
b) Audit of the same Project on a short living branch with sonar.exclusions=gen/**/*.java (in fact nothing was excluded), Git-Tag v_00_02_69a_cd; I got 58 new Blocker issues, 27 new critcal issues and 9 new Major issues.

So far so good.

Then I did in analogy to a)-b), difference only in d):

c) Audit of a sonar-Project on the Main Branch with sonar.exclusions = **/*.*, latest state on Git-branch “master”;
I got 0 issues like I wanted to.
d) Audit of the same Project, but this time not as a SLB but on the main-Branch with sonar.exclusions=gen/**/*.java (in fact nothing was excluded), Git-Tag v_00_02_69a_cd and sonar.leak.period = previous_version; I expected to get the same result as in case b), but I got 0 new issues (I got 58 Blocker issues, 27 critcal issues and 9 Major issues, but not declared as “new”).

Why does d) bring 0 new issues as result?? The Audit in c) brought 0 issues and the Audit in d) brought 58+27+9 issues, so these issues are new, because they didn’t exist before; why aren’t they declared as new?
Background: I use a qualitygate that fails if there are any new blocker/critical/major issues; so in case b) the Qualitygate fails (as expected), but in case d) the Qualitygate does not fail/I’m told that there would be no new issues, but in my opinion there are new issues.
To make the Qualiytgate fail in case d) I could use another Qualitygate than in b), but I’d like to always use the same Qualitygate

Is there a Sonarqube-failure in the decribed case or does Sonarqube work as designed?? How can I achieve to get the issues in d) as NEW issues?

With Kind regards.

Hi,

“New” issues are issues with creation dates inside the New Code Period. Under a number of circumstances, issue creation is backdated to the date of the last change on the issue line. That’s what’s you’re encountering with scenario D.

If you really want these issues marked as new, then disable scm data collection on the first analysis (-Dsonar.scm.disabled=true) and all issues will be “created” with the timestamp of the analysis.

 
Ann

Hi,

Thank you for your answer and I tried it out (Setting sonar.scm.disabled to true) and it seems to work (now I get new issues). Thanks!

Ute