commit | 64defd0a3c1d1d8770550142e9dfea42639c66ac | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Wed Oct 07 09:56:05 2020 +0200 |
committer | Edwin Kempin <ekempin@google.com> | Wed Oct 07 09:56:48 2020 +0200 |
tree | 5d790170282008a897c0829ddf10d7f6515d9025 | |
parent | 969d9b7b8ce04b37f7e3ba204bcfa40ca91b69be [diff] |
Fix MissingObjectException when validating code owner configs in newly created merge If a revision is newly inserted, but not committed to the repository yet, it can only be seen from the RevWalk instance that created it, but not by newly instantiated RevWalks. When a new merge commit is created via the create change REST endpoint we have exactly this case. The new merge commit is newly inserted and is only visible from the RevWalk instance that created it. So far CodeOwnerConfigValidator created new RevWalk instances to load the revision and those couldn’t see the newly created merge commit which caused the MissingObjectException. Now CodeOwnerConfigValidator no longer instantiates new RevWalk instances but instead passes on the RevWalk instance that we get via CommitReceivedEvent. This way the newly created merge commit can now be found and the code owner configs in it can be validated. The newly added test reproduced the MissingObjectException and ensures that this is working now. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I7ec82537404b5d1ce9c884146f3759e43ff34cc7
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