Why Sonar for Bitbucket default to Leak period instead of branch-based, which one is better?

Eclipse Trading May 31, 2017

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?

2 answers

1 accepted

0 votes
Answer accepted
Mibex_Software
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2017

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

0 votes
AJ-Tech August 4, 2021

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?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events