We are using a compliance orchestration tool which fetch data for compliance monitoring and evidence collection.
We are using Bitbucket datacenter and would like to know:
We would like to collect the following:
Hi Itay Semel,
Direct Extension: The standard Bitbucket Data Center REST API for branches (/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches) does not natively include branch protection rules, required approvals, or required checks in its response. It primarily returns metadata about branches (name, latest commit, etc.).
Custom Extension: To include additional compliance data in a single API call, you would need to build a custom integration or service that aggregates data from multiple endpoints (see below).
Reference:
The Bitbucket Data Center REST API
|
Requirement |
Endpoint |
Notes |
|---|---|---|
|
Branch protection rules |
/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions |
Lists all branch restrictions (write, merge, etc.) |
|
Required approvals |
/rest/default-reviewers/latest/projects/{projectKey}/repos/{repositorySlug}/conditions |
Lists reviewer/approval requirements per branch pattern |
|
Required checks (builds) |
/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests |
Lists merge checks, including required builds |
|
Build status (per commit) |
/rest/build-status/1.0/commits/{commitId} |
Shows build status for a specific commit |
Details regarding each api are referenced below.
Reference:
The Bitbucket Data Center REST API
Hope this answer helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.