Refactor ReviewerConfig and ReviewerFilterSection
* Extract abstract class ReviewerFilter.
- Abstracts the Config from REST and reviewer-adding logic in
Reviewers.
- Makes it more straight-forward to create ReviewerFilters in tests
for comparison.
* Introduce ReviewerFilterCollection class.
- Maintains the collection of ReviewerFilters found in the Config
object provided to the ReviewerFilterCollection.
- Handles adding and removing reviewers from a Config object through
it's own implementation of ReviewerFilter.
* Create new config package.
- Move ReviewerFilterCollection, ReviewersConfig and
ReviewersConfigIT into this new package for separation.
* Remove ReviewerConfig#forProject(Project.NameKey) creator.
- This created a ForProject with a Config "with inheritance" to
enable getting all ReviewerFilterSections with inheritance
from a ForProject.
Since ForProject is also a VersionedMetaData this Config was later
replaced if the ForProject was loaded. This meant that ForProjects
had different responsibilities and behavior depending on if they
were loaded or not.
- Replace this creator with new method:
ReviewersConfig#filtersWithInheritance(Project.NameKey)
with the sole responsibility of returning all inherited
ReviewerFilters.
In preparation of supporting CC.
https://bugs.chromium.org/p/gerrit/issues/detail?id=11676
Feature: Issue 12903
Change-Id: Ie0593297bd5e52749993966458aa13dd42f28bfd
10 files changed