commit | 9438fbf0f4434774e775014104cce096d1452adb | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Fri Feb 19 11:35:08 2021 +0100 |
committer | Edwin Kempin <ekempin@google.com> | Fri Feb 19 11:45:05 2021 +0100 |
tree | 48ccb40d5a640f3319a5b70a0681eb518552769c | |
parent | 4a24587069a37914fa88b16dfd76b35c0d42b235 [diff] |
Fix MissingObjectException when validating OWNERS imports on create change When a new merge change is created through the Create Change REST endpoint the code owner config validator can see the newly created merge commit only through the provided RevWalk. Using another (new) RevWalk instance does not see this revision yet and trying to access it fails with a MissingObjectException. For validating imports of code owner configs we always created a new RevWalk to check if the imported code owner config exists. If a code owner config was imported from the same project, and thus from the newly created merge commit, it failed with a MissingObjectException. Fix this by using the provided RevWalk instance in this case. The RevWalk instance is specific to the repo for which it was created, hence for loading code owner configs from other projects, we still need to create a new RevWalk instance (which happens when we call CodeOwnerBackend#getCodeOwnerConfig(CodeOwnerConfig.Key, ObjectId)). Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: Icd74c3393e1b4e5fd00a495d290109ede74649a7
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