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.
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)
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.