Sonar Maven 3: Version 3.2.4•Bamboo Data Center 8.0.0 - 9.0.0
Sonar for Bitbucket: 6.0.3
Bamboo: 8.2.4 build 80210
Bitbucket: 8.2.2
JaCoCo: 0.8.8
Preconditions:
New Code is configured in sonarqube as Previous version
Steps to reproduce:
Create new feature branch.
Build is triggered.
While first build is still lasting make code changes, commit and push, ideally three different commits.
Affter innitial commit is finalised socond one is triggered automaticaly/manualy.
All previously created commits are listed in Bamboo as part of second build.
Build pass sonarqube quality check.
All code changes added during execution of first build are NOT considered as New Code but as an old one and they are listed under Overall Code coverage.
Conclusion: New code will not be analyzed by sonar because it is not considered as new one.
Yes, I did it with “Reference Branch”, however in that case in second build also New Code is not considered as new one but in build after that one, third sonar check.
So in that scenario I already have two green builds passed sonar quality check and that code can be merged as already analysed by sonar, but it is not.
Feel free to add the scanner logs of the various analyses that happened when you analyzed using Reference Branch, and screenshots that demonstrate the issue.