commit | 552147cf59b7b424f6d072006925d85aed94d0ba | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Thu Jan 20 17:15:31 2022 +0100 |
committer | Edwin Kempin <ekempin@google.com> | Fri Jan 21 11:34:09 2022 +0100 |
tree | 7b3e3bfd5922614fa9d941890163c5eb0c3c74c8 | |
parent | 1f37e09c2383a9fa6cc2970e749b1195dd08c663 [diff] |
Fix submit rule for changes for which the target branch doesn't exist There are 2 possibilities to have changes where the target branch doesn't exist: 1. An initial commit is pushed for review to the not yet created master branch (that's a hard-coded special case where Gerrit allows uploading a change for an unborn branch). 2. A change is created for an existing branch and the branch gets deleted afterwards. At the moment the code owner submit rule returns not ready in this case. Since the target branch of the change doesn't exist it cannot contain OWNERS files that define code owners. However it is possible that there are default code owners (defined in refs/meta/config), global code owners (defined in code-owners.config) or fallback code owners (configured via code-owners.config) that could approve the change. In addition there can be a code owner override that code-owner-approves the change. Now, if the target branch doesn't exist, CodeOwnerApprovalCheck skips checking code owners from OWNERS files in the target branch, but still checks default, global and fallback code owners, as well as overrides. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: Idfcec9c0dc1601ae4cbd2185203e658a6a65b713
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.
For testing the plugin with Gerrit FE Dev Helper build the JavaScript bundle and copy it to the plugins/
folder:
bazel build //plugins/code-owners/ui:code-owners cp -f bazel-bin/plugins/code-owners/ui/code-owners.js plugins/
and let the Dev Helper redirect from .+/plugins/code-owners/static/code-owners.js
to http://localhost:8081/plugins_/code-owners.js
.