commit | 76532b4cdd53f19d34944c3796c6d6a854651ef9 | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Wed Mar 10 14:53:17 2021 +0100 |
committer | Edwin Kempin <ekempin@google.com> | Fri Mar 12 08:33:56 2021 +0100 |
tree | 0f028695e0458e1fa5e5d08371168561a5580651 | |
parent | 38ff2bfbaf179559fe15fe52f4c257327801477d [diff] |
Allow to disable the validation of code owner config files per branch Being able to skip the validation on some branches is useful for branches that are fully operated by bots. Bots cannot fix code owner config files and any issue that blocks them from uploading/submitting is more severe than an invalid code owner config file. So it's better to allow invalid code owner config files and fix them at a later point in time. Whether code owner config files are validated on commit received and submit can be controlled on project-level by setting `codeOwners.enableValidationOnCommitReceived` and `codeOwners.enableValidationOnSubmit` in code-owners.config. With this change we now add a possibility to override this configuration on branch-level by setting `validation.<branch>.enableValidationOnCommitReceived` and `validation.<branch>.enableValidationOnSubmit` in code-owners.config. As all configuration parameters the new configuration parameters are inherited from parent projects if not set. An inherited branch-level configuration also overrides a local project-level configuration. This allows to exempt branches globally from code owner config validations. '<branch>' can be an exact ref, a ref pattern (e.g. "refs/heads/*") or a regular expression (e.g. "^refs/heads/.*"). If a branch is matched by multiple validation subsections it is undefined which subsection takes precedence. This is because Config#getSubsections returns a Set which doesn't preserve the order in which subsections appear in the config file. In contrast to other configuration parameters branch-level validation parameters can only be set in code-owners.config, but not in gerrit.config (because as plugin we cannot have subsections in gerrit.config). This means to exempt branches globally the configuration needs to be done in the code-owners.config of the All-Projects project. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: Ifaa955d56fa499c440ee338ef4c0f40b495a2542
This plugin provides support for defining code owners for files in a repository.
If the code-owners plugin is enabled, changes can only be submitted if all touched files are covered by approvals from code owners.
Also see resources/Documentation/about.md.
IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide, see resources/Documentation/setup-guide.md.