I have been using Sonar for Bitbucket for some time and all proejcts has been configured to use branch-based anlaysis (e.g. compare feature branch vs a main develop branch). Recently we have upgraded both SonarQube and this plug-in and it seems all the repo has changed to default to Leak period instead. From description it is comparing against the last release, a couple of question:
1) how does it know when it is the leak period to compare against?
2) is it better / recommended that we use leak period instead of branch based? From branch based, it seems we can find out exactly what technical debt or issues have been introduced in this feature branch into the main development branch, isn't that a more useful approach?
Hi,
Since version 1.11 of the plug-in, the default is "branch-based" mode. If your default is now leak period suddenly, then this is a bug. What do you see in the repository settings of the plug-in?
Regarding your other questions:
1) The plug-in just uses the last leak period available to compare against. This can be either the last version of your project if you are using -Dsonar.timemachine.period1=previous_version or the last analysis when using -Dsonar.timemachine.period1=previous_analysis.
2) It really depends on your workflow. There are teams that do not analyze their target branches but only the source branches of their pull request. In this case, it makes sense to use leak period mode. For other teams, branch-based mode is better because they clearly see what new issues will be really introduced with a feature branch.
Please let us know if you have further questions.
Best regards,
Michael
We recently upgraded sonar for bitbucket plugin to version 4.3.1 and upgraded bitbucket to version 7.6.5.
Before the Bitbucket upgrade, there was a setting on the Sonar plugin in the project settings to specify whether the analysis should be branch based vs. leak period.
I am no longer seeing this option after the upgrade. From the PRs, it seems like it’s using leak period by default. Is there a way to change it back to branch-based analysis?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.