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 documentation.

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

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

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.