v0.1.0
First release of Bitbucket Code Owners — a self-hosted, open-source Bitbucket Data Center app
that enforces path-based code ownership with subgroup approval thresholds: the gap native Code
Owners (suggests reviewers only) and native merge checks (global, not path-based) can't close on
their own.
What it does
- Merge check — blocks a merge until the configured number of approvals from each matched owner
group is reached for the paths a pull request changes. - Subgroup thresholds — express "≥1 senior must approve" by making the owner group contain only
seniors withminApprovals: 1; a junior's approval does not count. - Auto-reviewers — optionally adds the matched owners as reviewers when a PR is opened.
- Config-as-code —
codeowners.yml(orcodeowners.yaml) at the repository root, read
from the PR's target branch, so the rules gating a merge can't be weakened by the same PR. - Fail-closed — an invalid config blocks the merge with an explanatory message instead of being
silently ignored.
# codeowners.yml — at the repository root
version: 1
groups:
frontend-seniors: { users: [alice, bob] }
rules:
- paths: ["frontend/**", "**/*.tsx"]
owners: ["@frontend-seniors"]
minApprovals: 1
options:
autoAddReviewers: true
unmatchedPolicy: allowInstall
The attached bitbucket-codeowners-0.1.0.jar targets Bitbucket DC 10.x (Java 21). Upload it via
Administration → Manage apps → Upload app, then enable Code Owners Merge Check per
repository/project under Merge checks.
Running Bitbucket 9.x LTS (Java 17)? Build the compatible artifact from the same source:
mvn -B -Pbb9 clean package # -> target/bitbucket-codeowners-0.1.0.jar for Bitbucket 9.xSee docs/deployment.md
and docs/configuration.md.
Verified
mvn clean verify is green on both profiles — default (Bitbucket 10.3.1 / Java 21) and bb9
(Bitbucket 9.3.0 / Java 17), 32 tests each — and the enforcement was live-checked on a Bitbucket
9.3.2 instance (merge blocked until the required owner approval is present).
License: MIT.