To set up Flow Enterprise to work with BitBucket Cloud, Flow Enterprise requires that an Oauth integration be configured in your BitBucket account. It is recommended that you consider creating a "server user" account that has access to all of the teams and repositories you wish to analyze. You should then use that user to configure the Oauth integration.
- Go to https://bitbucket.com and login as a user that has access to modify the account.
- Navigate to the BitBucket Settings section by clicking your your icon in the lower left-hand corner of the screen.
- By default, when you enter the settings screen, you will be placed into your personal account settings. You must select the settings for you main organization.
- Next, you need to create a new OAuth Consumer integration. This can be found by clicking OAuth under the Access Management section of the left-hand menu. Once you find that section, click Add Consumer.
- Adding the consumer requires filling out two sections: Details and Permissions.
The details section has several fields. Please fill them out according to these guidelines:
- Name: This should be an easily recognizable name for your Flow Enterprise instance. For example, "Flow Enterprise Integration," for a literal use. Or, if you have multiple Flow Enterprise Integrations, perhaps per department, you might use "Flow Enterprise: Core System Developers."
- Description: A more verbose description of the integration.
- Callback URL: This URL is the URL that BitBucket will redirect the user browser to after OAuth authentication has been performed. This should be on the format of https://<your Flow Enterprise hostname>/accounts/complete/bitbucket-oauth2. For example, if your Flow Enterprise instance is at flow.mycompany.com, you would enter: https://flow.mycompany.com/accounts/complete/bitbucket-oauth2/
- URL: This is the root URL of your Flow Enterprise instance. For example, https://gitprime.mycompany.com
- "This is a private consumer" Checkbox: This should be checked.
- The permissions section allows you to control how much access GitPrime Enterprise will have to your repositories and other BitBucket account data. We recommend that you grant the following permissions:
Permission Group Granted Permissions Description Account
Amount of access to the account level data Flow Enterprise needs. Flow Enterprise needs to be able to read the general information. Team Membership
Team Membership access, including listing your users. Flow Enterprise uses this to sync your team membership on the server. Projects
Read access to project information lets Flow Enterprise scan issue and repository data more efficiently. Repositories
Flow Enterprise requires read access to repositories to do the core analysis of your code. Pull Requests
Flow Enterprise requires read access to pull requests. Issues
Flow Enterprise requires read access to your issue data if you want to track that data in Flow. Wikis
Flow Enterprise does not need this access. Snippets
Flow Enterprise does not need this access. Webhooks
Flow Enterprise requires read and write access to your webhooks so that it can best integrate and keep code analysis up to date. Pipelines
Flow Enterprise does not need this access.
- Once you have filled out the data, click Save and you should now see your application listed in the list of OAuth Consumers.
Click on the integration, and it will show you a Key and Secret. Navigate to the Flow Enterprise Administration Console (see Configuring Flow Enterprise) and enter this key/secret pair in the BitBucket Settings section.
Click Save and allow Flow Enterprise to restart. At this point, BitBucket functionality should be enabled.
To connect Flow Enterprise to BitBucket, browse to the Repos section under My Data.
Click Add Repos and choose BitBucket.
You will be asked to connect to BitBucket if you have not already done so. Click Connect BitBucket to continue.
You will now be forwarded to BitBucket for OAuth confirmation. You will be asked to login to BitBucket (if you are not already). You will then be asked to confirm the integration and grant the privileges requested that we setup earlier.
Clicking Grant should return you to Flow Enterprise where you will now be able to import repositories from BitBucket.
If you need help, please email email@example.com for 24/7 assistance.