Skip to content

Latest commit

 

History

History
69 lines (42 loc) · 3.2 KB

bitbucket_cloud.md

File metadata and controls

69 lines (42 loc) · 3.2 KB

Bitbucket Cloud

Site admins can sync Git repositories hosted on Bitbucket Cloud with Sourcegraph so that users can search and navigate the repositories.

To connect Bitbucket Cloud to Sourcegraph:

  1. Go to Site admin > Manage code hosts > Add repositories.
  2. Select Bitbucket.org.
  3. Configure the connection to Bitbucket Cloud using the action buttons above the text field. Additional fields can be added using Cmd/Ctrl+Space for auto-completion. See the configuration documentation below.
  4. Press Add repositories.

Repository syncing

Currently, all repositories belonging to the user configured will be synced.

In addition, there is one more field for configuring which repositories are mirrored:

  • teams
    A list of teams (workspaces) that the configured user has access to whose repositories should be synced.
  • exclude
    A list of repositories to exclude, which takes precedence over the teams field.

HTTPS cloning

Sourcegraph clones repositories from your Bitbucket Cloud via HTTP(S), using the username and appPassword required fields you provide in the configuration.

Rate limits

Read about how Bitbucket Cloud applies rate limits here.

When Sourcegraph encounters rate limits on Bitbucket Cloud, it will retry the request with exponential back-off, until 5 minutes have passed. If the connection is still being rate limited after 5 minutes, the request will be dropped.

Internal rate limits

See Internal rate limits

User authentication

To configure Bitbucket Cloud as an authentication provider (which will enable sign-in via Bitbucket Cloud), see the authentication documentation.

Repository permissions

Prerequisite: Add Bitbucket Cloud as an authentication provider.

Then, add or edit a Bitbucket Cloud connection as described above and include the authorization field:

{
  // The URL used to set up the Bitbucket Cloud authentication provider must match this URL.
  "url": "https://bitbucket.com",
  "username": "horsten",
  "appPassword": "$APP_PASSWORD",
  // ...
  "authorization": {}
}

NOTE: It can take some time to complete full cycle of repository permissions sync if you have a large number of users or repositories. See sync duration time for more information.

Configuration

Bitbucket Cloud connections support the following configuration options, which are specified in the JSON editor in the site admin "Manage code hosts" area.

[View page on docs.sourcegraph.com](https://docs.sourcegraph.com/admin/external_service/bitbucket_cloud) to see rendered content.

Webhooks

Using the webhooks property on the external service has been deprecated.

Please consult this page in order to configure webhooks.