Sonar 4 Bitbucker Server Copy Quality Profile

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

This widget could not be displayed.

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

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?

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

@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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Jul 25, 2018 in Marketplace Apps

Jira Cloud and Bitbucket Cloud Integration with Microsoft Teams

One of the newest products in the Microsoft family - Microsoft Teams,  is a chat-based hub for teamwork that integrates all the people, content, and tools your team needs to be more engaged and ...

733 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you