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:
- Go to Site admin > Manage code hosts > Add repositories.
- Select Bitbucket.org.
- 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.
- Press Add repositories.
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 that the configured user has access to whose repositories should be synced.exclude
A list of repositories to exclude, which takes precedence over theteamsfield.
Sourcegraph clones repositories from your Bitbucket Cloud via HTTP(S), using the username and appPassword required fields you provide in the configuration.
Internal rate limiting can be configured to limit the rate at which requests are made from Sourcegraph to Bitbucket Cloud.
If enabled, the default rate is set at 7200 per hour (2 per second), which can be configured via the requestsPerHour field (see below):
- For Sourcegraph <=3.38, if rate limiting is configured more than once for the same code host instance, the most restrictive limit will be used.
- For Sourcegraph >=3.39, rate limiting should be enabled and configured for each individual code host connection.
NOTE Internal rate limiting is only currently applied when synchronizing changesets in batch changes, repository permissions, and repository metadata from code hosts.
To configure Bitbucket Cloud as an authentication provider (which will enable sign-in via Bitbucket Cloud), see the authentication documentation.
Bitbucket Cloud connections support the following configuration options, which are specified in the JSON editor in the site admin "Manage code hosts" area.
Using the webhooks property on the external service has been deprecated.
Please consult this page in order to configure webhooks.