commit | afdcca5d8453e4265a4a55f8725c5046d4cc8bb3 | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Wed Jul 14 11:29:31 2021 +0200 |
committer | Edwin Kempin <ekempin@google.com> | Wed Jul 14 11:40:58 2021 +0200 |
tree | b65dac1a595c67af4d18a502c1f1505bd8419baf | |
parent | 03ee5aa5dd8cb1374752411a4be349c182d2344d [diff] |
CodeOwnersSubmitRule: Treat invalid plugin configuration as RULE_ERROR In case of a failure submit rules can throw an exception or return a RULE_ERROR. An exception should be thrown in case of server errors that should count against Gerrit’s SLO’s and that need to be investigated by the Gerrit team. A RULE_ERROR should be returned in case a failure is caused by bad configuration that is under the control of host and project owners. In this case it’s the responsibility of the host/project owner to fix the configuration and the error should not count against Gerrit's SLO’s. Since the code-owners plugin configuration is maintained by the host/project owners, any failure that is caused by a bad configuration should be treated as RULE_ERROR, but so far we threw an exception. Fixing this allows us to run the code-owners tests that verify the behaviour when the plugin configuration is invalid against the fake index. Before this change these tests failed when running against the fake index because the fake index is more strict when exceptions occur during the indexing. With the fake index exceptions are propagated, whereas with other index implementations they are swallowed (which means that the exception is caught, but the change is not indexed). For the code-owners plugin this meant that creating changes was possible when the code-owners plugin configuration was invalid, but these changes didn't get indexed. With this fix, they are indexed now and only the code-owners submit requirement in the index says RULE_ERROR. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I1ec13548b42f541cc40fcc651e997d374b08ee02
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.