Does Sonar for Bitbucket Server plan to support with branches in SonarQube Community Edition

Stefan Kiryazov March 13, 2019

Currently, Sonar for Bitbucket Server supports branches but the functionality relies on the deprecated analysis parameter sonar.branch:

https://docs.sonarqube.org/latest/analysis/analysis-parameters/

There is no alternative provided for this parameter (except purchasing a developer edition, which I can't get approved in a timely fashion).

For the moment my team has implemented a workaround, whereby the branches are treated as separate projects, with separate keys - but then Sonar for Bitbucket Server can't recognize the branch projects as being linked to the same bitbucket repository. Presumably, if this is to be supported by the plugin there should be some naming convention so that Sonar for Bitbucket can pick up the branch projects.

1 answer

1 vote
Michael Rüegg _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.
March 13, 2019

Hi,

Thank you for contacting us.

You're correct that the parameter -Dsonar.branch is deprecated. This is why the plug-in also supports projects created with the new branching plug-in that uses -Dsonar.branch.name. The new branching plug-in is only available with the developer edition, that's right.

If you cannot use the developer edition, the plug-in still supports the old "one project per branch" mode. What the plug-in expects in this case is that you have projects for the branches of a pull request with keys like

my.project:master

or

my.project:feature/XYZ

I cannot say for sure why the plug-in is not able to recognize your branch projects in this particular case, but basically this mode is fully supported by the plug-in.

I suggest that you open a support case at https://support.mibexsoftware.com and I will have a look and try to get this working with you ASAP.

Hope that helps. Otherwise, please let us know.

Best regards,
Michael (app vendor)

Stefan Kiryazov March 14, 2019

Thanks for you prompt reply Michael. I think the slash is not allowed in the project key though, we specifically wrote code to replaces slashes.
Or is there an escape sequence?

We'll test how it works for branches without slashes but this would be the exception in our case.

Michael Rüegg _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.
March 14, 2019

You're very welcome. Slashes are only prohibited in SQ versions < 5.0. Our plug-in supports this by the option "replacement for illegal branch characters" in the repository settings. Please find more information in our Wiki: https://mibexsoftware.atlassian.net/wiki/spaces/SONAR4STASH/pages/5537915/Sonar+for+Bitbucket+Server+Configuration#SonarforBitbucketServerConfiguration-a)Sonarproject

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events