Owner rules

Define what part of the code is owned by whom, and your team:

  1. Helps to find out who should review which PR, thanks to the automatic assignment of Code Owners as reviewers to your pull requests.

  2. Can require reviews and approvals for PRs, enforced with flexible Merge Checks based on the active Code Owners. (optional)

Want to try it out first? Access the interactive playground where you can check your Code Owner rules.

Owner rule: What? is owned by Who?

For the file pattern, the app uses the syntax of Bitbucket’s branch permission patterns.

For details, check Branch permission patterns | Bitbucket Data Center 5.0 | Atlassian Documentation

 

Example

CODEOWNERS:

**/*.java @james_gosling **/*.scala @martin_odersky jvm/**/*.java @brian_goetz

PR diff:

jvm/Unsafe.java scala-compiler/AST.scala

Gives active rules and Code Owners for this PR:

**/*.scala @martin_odersky jvm/**/*.java @brian_goetz


The active Code Owners:

  • Martin

  • Brian

are added as reviewers on PR creation/updates.

 

Full CODEOWNERS reference

Â