If I set New Code > Project Settings to “Previous version” the first push of a branch always comes up green (but no analysis done), subsequent pushes “do the right thing” as long as the developer doesn’t rebase their branch. If they rebase all sorts of non-branch code starts showing up in the “new code” analysis.
If I change that and for New Code > Project Settings I set “Reference Branch: Main”:
… and for New Code > main branch I set “Previous version”.
I would expect that every branch would be compared against the main branch, what happens is that the New Code analysis comes up blank, with the message:
This branch could not be compared to its reference branch. See the SCM or analysis report for more details.
No matter how many times a branch is revised and pushed the same message appears.
Thanks for you reply, Ann! we just use sonar-scanner-cli:4.6 in docker image, and add some parameters in sonar-project.properties, then just check results on SonarQube dashboard, where can I upgrade version?