Must-share information:
- SonarQube Developer Edition Version 10.3 (build 82913), deployed via zip
- what are you trying to achieve?
That only errors in the new code are detected in the build process - what have you tried so far to achieve this
- Disabled shallow clone
- Tell Bamboo to fetch the entire repository
- Make sure that new code is defined as “Previous version” in both Global and Project settings
- Make sure that there are no errors in the logs. These are the warnings found:
[WARNING] 07:35:04.473 SonarScanner will require Java 17 to run, starting in SonarQube 10.4
[WARNING] 07:35:08.127 The property ‘sonar.login’ is deprecated and will be removed in the future. Please use the ‘sonar.token’ property instead when passing a token.
Hi,
I’m struggling to get SonarQube to get the analysis only on the new code. We use SonarQube in conjunction with BitBucket and Bamboo Data Center versions. In Bitbucket, during the PR, SonarQube shows to developers all problems.
But when the branch is merged to the main branch and Sonar runs inside of Bamboo, it is triggering errors from very old code as new code. How do I make sure that the Bamboo Sonar Maven 3 task only fails if there are errors in the new code.
Example:
This PR merge only changed some XML configurations, but it flags 3.56% duplication (I had to increase the threshold and run the build again, but it was originally 3%).
The Sonar analysis shows duplications and code smells in java files that where not even touched by the PR commits:
How can I fix this?