View all connectors

Bitbucket Data Center Pull Commits

The Bitbucket Data Center Pull Commits connector imports commits associated with pull requests already imported into DX. Imported metadata includes commit hashes, messages, author names and email addresses, timestamps, and commit URLs. DX does not read your source code through this connector. See the schema explorer for the imported data model.

Prerequisites

  • An existing Bitbucket Data Center connection or Bitbucket extractor connection that imports projects, repositories, and pull requests from the same Bitbucket instance.
  • A Bitbucket service account with read access to the projects, repositories, and pull requests you want to import.
  • Network access from DX to your Bitbucket instance. If your instance has IP restrictions, allowlist DX IP addresses. For instances that cannot accept inbound traffic, use the reverse tunnel proxy.

Setup instructions

  1. Set up the main Bitbucket Data Center or extractor connection and let it import your repositories and pull requests.
  2. Navigate to the connections page in DX and select + Connection.
  3. Select Bitbucket Data Center Pull Commits.
  4. Enter the HTTPS Base URL for the same Bitbucket instance, including any context path, such as https://bitbucket.example.com/bitbucket. Do not include /rest/api/1.0.
  5. Enter the service account Username and Password.
  6. If using a reverse tunnel proxy, have it provisioned and running, then enable Route traffic through reverse tunnel proxy before verifying the connection.
  7. Verify and save the connection.

This is a separate connection with its own credentials. It imports commits for eligible pull requests in repositories selected by the existing connection; it does not import projects, repositories, or pull requests itself. Even when the source data comes from an extractor, this connector needs API access to Bitbucket.

API reference

DX uses the following endpoints under /rest/api/1.0. Project, repository, and pull request listing endpoints are used during connection verification; imports fetch commits for existing pull requests.

Endpoint Documentation
GET /projects Projects API
GET /projects/{projectKey}/repos Repository API
GET /projects/{projectKey}/repos/{repositorySlug}/pull-requests Pull requests API
GET /projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits Pull requests API

Errors

Connection verification checks a sample of projects, repositories, and pull requests and requires at least one returned commit. It stops after finding commits; it does not scan every repository. A sample without pull request commits can fail verification even when commits exist elsewhere in the instance.

Error Description
invalid_credentials Check the service account username and password.
invalid_permissions The service account cannot access a required resource. Check its project and repository permissions.
no_resources No repositories or pull request commits were found in the verification sample. Check access and confirm the accessible repositories contain pull requests with commits.

Curl commands

To troubleshoot verification, test access to a known pull request with commits. Replace the URL, username, project key, repository slug, and pull request ID below. Curl prompts for the password.

curl --user 'YOUR_USERNAME' \
  --header 'Accept: application/json' \
  'https://YOUR_BITBUCKET_HOST/rest/api/1.0/projects/YOUR_PROJECT_KEY/repos/YOUR_REPO_SLUG/pull-requests/YOUR_PR_ID/commits'

Include your instance’s context path in the URL if it has one. A successful response contains commits in the values array. For a 401 response, check credentials; for 403, check permissions; for 404, check the URL and resource identifiers. If using a tunnel, run the command from a machine with access to Bitbucket; this tests API access but does not verify the DX tunnel configuration.

Data Cloud API

After creating the connection, you can manage its credentials with the Data Cloud API. The connection type is bitbucket_data_center_pull_commits.

Field Type Description
settings.bitbucket_data_center_base_url String The HTTPS base URL of the Bitbucket instance, including any context path.
settings.bitbucket_data_center_username String The service account username.
secrets.bitbucket_data_center_password String The service account password.