September 16, 2022, 1:58pm
Must-share information (formatted with
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
what are you trying to achieve
what have you tried so far to achieve this
SonarQube: Developer EditionVersion 9.4 (build 54424)
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
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.
September 16, 2022, 2:01pm
You would want to use the “Reference Branch”
New Code Period so that changes from before the first build are taken into account.
September 16, 2022, 2:07pm
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.
September 16, 2022, 2:11pm
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.
September 16, 2022, 3:06pm
Here it is logs and Bamboo screenshots. I have cleaned some log data.
SONAR4BAMBOO_logs.txt (12.1 KB)
September 16, 2022, 3:18pm
I’m more interesting in the logs from the scanner itself
INFO: Project root configuration file: NONE
INFO: SonarScanner 126.96.36.19947
INFO: Java 188.8.131.52 Eclipse Adoptium (64-bit)
INFO: Mac OS X 12.6 x86_64
September 20, 2022, 12:01pm
except logs I have added I can’t find any other sonar related logs in bamboo job logs. Can you advise me where else to look?