/
Getting Started - Cloud ☁️

Getting Started - Cloud ☁️

 

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

1.  Put a CODEOWNERS file into your repository and Code Owners will add reviewers automatically to your pull requests:

# Put this in a file called CODEOWNERS in the root directory of your repository. # Lines starting with # are comments. # Every rule line is a file pattern that is followed by one or more Code Owners. # As identifiers for the Code Owners you can use the display name or nickname of # Bitbucket Cloud users (see screenshot below how you can find those). **/*.java @"James Gosling" **/*.scala @"Martin Odersky" jvm/**/*.java @"Brian Goetz" # Ordering is important! The last matching file pattern has the highest precedence. # So if only files in the jvm sub-directories are in the pull request, Brian Goetz # will be the code owner and not James Gosling. # You can build your own Code Owners group. @@@FrontendTeam @"Brendan Eich" @"Tim Berners-Lee" # And reference it in your Code Owner rules. web/* @@FrontendTeam @CTO

For more details about how owner rules work, see our Owner rules documentation.

Double quotes are only necessary if the nickname or display name contain white spaces.

@"Paul the JSGuru" @@"Dev Ops Team"

As identifiers in CODEOWNERS file are supported in Bitbucket Cloud ☁️:

  • Display Name

  • Nickname (Public name) of Bitbucket Cloud users

To get the Display Name or Nickname of a user, mention a user in the pull request (e.g. description or comments).
In the auto-complete list, you will see the Display Name on top and below the Nickname (see image below).

 

NOT supported:

  • e-mail addresses or user slugs

 

How to find Display name or Nickname in Bitbucket Cloud

 

2. OPTIONAL: Configure Merge Checks to enforce approvals of Code Owners.

3. Create a pull request and the app adds all matching code owners from CODEOWNERS in the destination branch as pull request reviewers:

NOTE: The Pull Request page may need to be refreshed before the reviewer is visible

 

4. If you change your pull request, the app will add additional pull request reviewers if needed according to updated PR content.

 

Recommendation:
Use separate user account for installing the app, so that the calls to Bitbucket API are isolated for Code Owners app and independent to other installed apps.

  • If using same user account to install multiple apps, you risk to hit API rate limit, as the calls the installed apps make count towards the same, shared limit.

  • This user must be able to:

Protect your CODEOWNERS file

Ensure to have a Code Owners rule covering the CODEOWNERS file itself, to prevent unwanted changes regarding enforced approvals:
CODEOWNERS @CTO

 

Missing features in Cloud edition of Code Owners
The following features of the Data Center / Server edition are missing in Cloud edition: