generation of sonar.projectkey

Jens Müller August 10, 2020

We use the Sonar for Bitbucket Server version 2.7.3 in our bitbucket server.There if I am correct the sonar.projectkey is used to access the sonarqube project. And theprojectkey is generated by using the branch name, which contains a slash as a delemiter of branch type and branch name. Now in SonarQube Server 7.9.4 (also in 8.4) the slash is not allowed to use in a projectkey.

Is there any way to replace the slash in this plugin by changing a configuration? Or is there an update planned for this behavior?

 

We use Bitbucket v6.10.5 so i can not install the latest version of the plugin which is only compatible with v7.x of bitbucket

 

1 answer

1 accepted

0 votes
Answer accepted
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.
August 10, 2020

Hi,

Yes, there is a possibility by replacing the now invalid characters like "/" with allowed characters when analyzing your projects with SonarQube, e.g. instead of

-Dsonar.projectKey=projectKey:feature/branch

you now have to use

-Dsonar.projectKey=projectKey:feature_branch

Sonar for Bamboo and Sonar for Bitbucket support this and make it transparent by using the feature "Replacement for illegal branch characters" which is also supported by app version 2.7.3.

Does that help you?

Best regards,

Michael (app vendor)

Jens Müller August 10, 2020

Hi @Michael Rüegg _Mibex Software_, thanks for the response. can you show me how it works, as I understand this field as the replacement character not as the characters which should be replaced. If I add the slash to the field I get an error message:

grafik.png

Thanks Jens

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.
August 11, 2020

@Jens MüllerYou're very welcome. In that field you are expected to enter the character which you want to replace the illegal characters with. For the example given above, this would be "_". We will need to update the description as it is now necessary again with the most recent SQ versions (not only for SQ < 5).

Jens Müller August 11, 2020

@Michael Rüegg _Mibex Software_Thanks that works fine. Souldn't it be '_' by default, because this is the rule which is used by bitbucket itself?

 

Also it would be great if it is possible to have a global configuration, not only on a project/repository.

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.
August 11, 2020

@Jens MüllerCould you please describe which rule of Bitbucket you are referring to where "_" is the default? Yes, we are currently working on a solution that will either make this transparent or provide a global configuration option.

Jens Müller August 11, 2020

@Michael Rüegg _Mibex Software_

Sorry my fault I thouht that all blanks for instance are replaced by _ as i create a branch. Now as i am tried it, it will be replaced by minus and looks like only blanks are replaced

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events