Sonar 4 Bitbucker Server Copy Quality Profile

shaunma October 20, 2016

We use a custom quality profile in Sonar, but despite enabling Quality Gate in Provisioning, the analysis is still using the Default Profile.

We have verified:

  • The Sonar master project is using the custom profile.
  • The Sonar Gradle task is working fine in Bamboo.
  • The Provisioning - Quality Profiles checkbox is enabled.
  • The corresponding Bamboo build has the following in the log:
build	19-Oct-2016 23:06:39	323 files ignored because of inclusion/exclusion patterns
build	19-Oct-2016 23:06:39	Quality profile for java: Sonar way
build	19-Oct-2016 23:06:40	Sensor Lines Sensor

Since the log suggests that the analysis is done using the default profile, I wonder how profile copying is implemented. The Bamboo task triggers the analysis. Bitbucket just loads the post-analysis results from Sonar. If the profile copying is managed by sonar4stash, how does sonar4stash "tell" the bamboo task what the source profile to copy during the analysis?

 

We are on:

  • Sonar 6.0
  • Bitbucket Server 4.9.1
    • Sonar for Bitbucket Server 1.10.3
  • Bamboo 5.12.2
    • Sonar for Bamboo 1.4.2

 

1 answer

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.
October 24, 2016

Hi,

Quality profile provisioning works as follows: Sonar4Stash will use the quality profile of the configured master branch in the plug-in's repository settings. Whenever it detects that a new branch was created, it will create a new SonarQube project for it and configure its quality profile to be the same as the one from the master branch.

If this process didn't work in your case, do you see any errors in the Stash application log when the branch was created?

Best regards,

Michael

shaunma October 25, 2016

Michael,

You are right. When new branches are created, the addon created Sonar projects and copied the master project's quality profile. There were some old branches that existed before installing the addon. Those branches' Sonar projects don't have the master project's quality profile.

The addon's behavior matches your explanation. However, we observed that quality gates are not copied. No errors in Bitbucket's logs. Is this a bug?

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.
October 26, 2016

Provisioning of quality gates is not yet supported, but it is on our roadmap smile

shaunma October 26, 2016

@Michael Rüegg [Mibex Software], that's great to hear! We are very happy with Sonar for Bitbucket Server so far. Keep up the good work.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events