CODEOWNERS settings
The syntax for plugin settings in the file CODEOWNERS
is
CODEOWNERS.<setting> <value>
The following settings are currently supported:
- Restrict code owners functionality for a certain destination branch.
This
CODEOWNERS
file is then only active for pull requests with matching destination branch. Supported pattern format.CODEOWNERS.destination_branch_pattern <branchpattern>
- To exclude code owners functionality for pull requests with certain source branches,
This
CODEOWNERS
file is then inactive for pull requests with matching source branch. Supported pattern format.CODEOWNERS.source_branch_exclusion_pattern <branchpattern>
- Enable subdirectories overrides, where a
CODEOWNERS
file in a subdirectory overrides all settings. Ideal when you have independent projects in subdirectories which require independent rules. By default, this is disabled and only the CODEOWNERS at the top of the repository is used.CODEOWNERS.toplevel.subdirectory_overrides enable
- Suppress info comment on pull request creation about added code owners.
Comments are enabled by default.
CODEOWNERS.toplevel.create_pull_request_comment disable
- Removes existing approvals for new commits in pull request
Similar to Atlassian's Auto Unapprove app, but skips unapproval for Code Owners whose owned files did not change in new commits. (opt-in)
CODEOWNERS.toplevel.auto_unapprove_on_change enable
- Custom assignment routing for pull requests. You can reduce the number of Code Owners that are automatically assigned to a pull request. (opt-in)
Currently, the only available method of assignment is at random.
Note: The algorithm will take the specified number of code owners (when possible) for each group affected by the pull request.
CODEOWNERS.toplevel.assignment_routing random <number-per-group> # Example: CODEOWNERS.toplevel.assignment_routing random 2
- Set a limit to the number of Code Owners assigned as reviewers.
You might want to prevent unwanted notifications in the case of manipulation mistakes (e.g., creating a Pull Request from the wrong branch, or an unhappy rebase).
To that end, you can define a limit to the number of Code Owners that get assigned automatically to a Pull Request.
If there are too many impacted Code Owners, the app will not add them automatically.
You can still assign them using the manual "trigger" button from the Pull Request context menu on the top right.
CODEOWNERS.toplevel.assignment_limit <max-number> # Example: CODEOWNERS.toplevel.assignment_limit 20