Code deployments are a key source of change Sleuth needs to do its job. Once a code deployment is integrated as a change of source, Sleuth immediately begins its analysis, looking at your commit history, number of authors, deploy frequency, size of commits, and other data to give you a full picture of how you and your team are managing your project's codebase. You'll instantly see the Trend Graph come to life with a complete snapshot that gives you the information you need to start deploying faster.
Integrating Bitbucket with Sleuth is simple. If you're connecting to a personal Bitbucket repo, you just need your credentials. If you're part of a Bitbucket organization and aren't the owner, you will need permission to allow Sleuth to connect to the repo (after you connect you'll be able to select individual private or public repositories).
You can connect as many code deployments to a project as you'd like; be sure to give them recognizable names in Sleuth. You will also be able to tell Sleuth whether it should manually register each deploy or automatically create deploys for every push to or tag on branch, it's completely up to you. This setting can be changed at any time. Additionally, you can configure your target branch to lock if it contains unreleased code.
To set up the Sleuth Bitbucket integration:
Click Integrations in the left sidebar, then click Change Sources.
In the Bitbucket tile, click enable.
You must grant Sleuth access to your Bitbucket account by clicking Grant access in the confirmation dialog. Don't worry, you'll select the Bitbucket repo to connect to your Sleuth project later.
On successful integration, you'll see Bitbucket enabled (Connected as <Bitbucket user account>) displayed in the Bitbucket tile. You'll next configure the code deployment to connect your repo to a project.
You now need to add a Bitbucket repo to a Sleuth project. This source of change is the repo the configured Sleuth project will monitor and report in the Dashboard on each and every deploy you make to that repo, along with any other change sources you have connected to your project.
To configure the Bitbucket integration:
After step #4 above, you will be taken back to the Bitbucket integration tile. On the Bitbucket tile, click the Add code deployment dropdown.
Select the Sleuth project you wish to add a chance source to from the dropdown list.
The preferences in Advanced Settings allow you to control the flow of data that are generated by a deploy. You can control whether a deploy affects your project's health, shows up in notifications, or is included in the project dashboard.
All settings are on (checked) by default. However, there might be some code that you don't want affecting your frequency graph, or a change source points to a staging version of your codebase that contains fragile code, which you don't want affecting your repo's health report.
For example, Sleuth Documentation is a public Sleuth repo (sleuth-gitbook-docs). However, we have disabled Collect Impact on Deploy for that particular repo. Although we treat documentation as code (our documentation is sourced in Markdown), the impact of deploying documentation shouldn't impact the overall health reports that Sleuth generates for the top-level repo. To put it another way: Documentation commits and PRs shouldn't bring down the application.
The preferences available in Advanced Settings are:
With Notify in Slack checked, all activity in this change source will generate a Slack notification in accordance with any project- and organization-level Slack notification preferences that have already been set.
With Collect Impact on Deploy checked, any impact measurements generated by this change of source will be applied to your project's collective health metrics.
With Include in Project Dashboard checked, all the deploys for this change source will be included in the project dashboard and frequency graph.
Click on Integrations in the left sidebar, then on Change Sources.
In the Bitbucket integration card, click disable. The message Bitbucket disabled is displayed in the Bitbucket integration card once the integration is dissolved.
The Bitbucket integration is disconnected and no longer available to any projects within that organization.