Initial commit of the standalone owners plugin

Reset the whole repository to contain the owners plugin only.
This refactoring allows an easier management of the lifecycle
of the plugin and also simpler and more standard discovery
and validation.

Change-Id: I5cb9f69d02f7b82a70c64bc02ee3703ef46be0b9
diff --git a/.gitignore b/.gitignore
index 6042b9d..1293c82 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
-# IntelliJ
 *.iml
 *.ipr
 .idea
@@ -7,3 +6,4 @@
 /.settings/
 /bazel-*
 /eclipse-out/
+.DS_Store
diff --git a/BUILD b/BUILD
index 548e6a8..c9be8f6 100644
--- a/BUILD
+++ b/BUILD
@@ -1,29 +1,97 @@
-load("//tools:genrule2.bzl", "genrule2")
-load("//tools/bzl:plugin.bzl", "PLUGIN_TEST_DEPS")
-load("//owners-common:common.bzl", "EXTERNAL_DEPS", "EXTERNAL_TEST_DEPS")
+load("//tools/bzl:plugin.bzl", "PLUGIN_DEPS", "PLUGIN_DEPS_NEVERLINK", "PLUGIN_TEST_DEPS", "gerrit_plugin")
+load("//lib/prolog:prolog.bzl", "prolog_cafe_library")
+load("//tools/bzl:junit.bzl", "junit_tests")
 
-genrule2(
-    name = "all",
-    srcs = [
-        "//owners",
-        "//owners-autoassign",
-        "//owners-common",
+PROLOG_PREDICATES = glob(["src/main/java/gerrit_owners/**/*.java"]) + [
+    "src/main/java/com/googlesource/gerrit/owners/OwnersMetrics.java",
+    "src/main/java/com/googlesource/gerrit/owners/OwnersStoredValues.java",
+]
+
+java_library(
+    name = "gerrit-owners-predicates",
+    srcs = PROLOG_PREDICATES,
+    deps = [
+        ":owners-common-api-neverlink",
+        "@external_deps//:com_googlecode_prolog_cafe_prolog_runtime",
+    ] + PLUGIN_DEPS_NEVERLINK,
+)
+
+prolog_cafe_library(
+    name = "gerrit-owners-prolog-rules",
+    srcs = glob(["src/main/prolog/*.pl"]),
+    deps = PLUGIN_DEPS_NEVERLINK + [
+        ":gerrit-owners-predicates",
     ],
-    outs = ["all.zip"],
-    cmd = " && ".join([
-        "cp $(SRCS) $$TMP",
-        "cd $$TMP",
-        "zip -qr $$ROOT/$@ .",
-    ]),
+)
+
+gerrit_plugin(
+    name = "owners",
+    srcs = glob(
+        [
+            "src/main/java/**/*.java",
+        ],
+        exclude = PROLOG_PREDICATES,
+    ),
+    manifest_entries = [
+        "Implementation-Title: Gerrit OWNERS plugin",
+        "Implementation-URL: https://gerrit.googlesource.com/plugins/owners",
+        "Gerrit-PluginName: owners",
+        "Gerrit-Module: com.googlesource.gerrit.owners.OwnersModule",
+        "Gerrit-HttpModule: com.googlesource.gerrit.owners.HttpModule",
+    ],
+    resource_jars = ["//plugins/owners/web:gr-owners"],
+    resources = glob(["src/main/resources/**/*"]),
+    deps = [
+        ":gerrit-owners-predicates",
+        ":gerrit-owners-prolog-rules",
+        ":owners-common-api-neverlink",
+    ],
 )
 
 java_library(
-    name = "owners_classpath_deps",
-    testonly = 1,
-    visibility = ["//visibility:public"],
-    exports = EXTERNAL_DEPS + EXTERNAL_TEST_DEPS + PLUGIN_TEST_DEPS + [
-        "//owners:owners__plugin",
-        "//owners-autoassign:owners-autoassign__plugin",
-        "//owners-common:owners-common__plugin",
+    name = "owners-common-api-neverlink",
+    neverlink = 1,
+    exports = [
+        "//plugins/owners-common-api",
     ],
 )
+
+java_library(
+    name = "owners__plugin_test_deps",
+    testonly = 1,
+    srcs = glob(
+        ["src/test/java/**/*.java"],
+        exclude = [
+            "src/test/java/**/*Test.java",
+            "src/test/java/**/*IT.java",
+        ],
+    ),
+    visibility = ["//visibility:public"],
+    exports = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
+        ":owners",
+        "//plugins/owners-common-api",
+    ],
+    deps = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
+        ":owners",
+        "//plugins/owners-common-api",
+    ],
+)
+
+junit_tests(
+    name = "owners_tests",
+    srcs = glob(["src/test/java/**/*Test.java"]),
+    tags = ["owners"],
+    deps = [
+        ":owners__plugin_test_deps",
+    ],
+)
+
+[junit_tests(
+    name = f[:f.index(".")].replace("/", "_"),
+    srcs = [f],
+    tags = ["owners"],
+    visibility = ["//visibility:public"],
+    deps = [
+        ":owners__plugin_test_deps",
+    ],
+) for f in glob(["src/test/java/**/*IT.java"])]
diff --git a/CHANGELOG b/CHANGELOG
deleted file mode 100644
index 8d6d1b3..0000000
--- a/CHANGELOG
+++ /dev/null
@@ -1,15 +0,0 @@
-1.2 - ???
-=====================
-
-* Add owner_path(-Path) to use instead of gerrit:commit_delta
-* Change owner(-Path, _) to bind to the OWNERS file(s) path instead of patch list paths
-
-1.1 - April 29, 2013
-=====================
-
-* Paths without any owners will no longer require "Owner-Approval"
-
-1.0 - April 29, 2013
-========================
-
-* Initial release
diff --git a/README.md b/README.md
index bbee77e..77f4982 100644
--- a/README.md
+++ b/README.md
@@ -1,23 +1,18 @@
-# Gerrit OWNERS Plugin
+# Gerrit Owners Plugin
 
-This repository comprises of effectively two separate plugins, `owners` and
-`owners-autoassign`.
-
-They share the ability to parse the same OWNERS file format, which facilitates
-the maintenance of ACLs, as there is only one source of truth.
+The `owners` plugin has the ability to parse the OWNERS file in the repository for
+defining who is the owner of the components in a repository and therefore is
+entitled to have the final word for the submission of changes associated with
+the files owned.
 
 For details on how to configure either plugin, please refer to the docs in the
-specific plugin's folder.
+specific plugin's folder.``
 
 > **NOTE**: A comprehensive introduction to both `owners` and `owners-autoassign` has been
 > given as part of the [GerritMeets series in Jan 2025](https://www.youtube.com/watch?v=NfIHnJF30Wo).
 > While a further deep dive specifically into newer features of this plugin was
 > give at the [GerritMeets in April 2026](https://www.youtube.com/watch?v=DfKYduVKJEY)
 
-Here's an introduction to both plugins:
-
-## owners
-
 This plugin exposes the `has:approval_owners` predicate that can be used with
 Gerrit's own
 [submit-requirements](/Documentation/config-submit-requirements.html) to ensure
@@ -32,59 +27,18 @@
 in others, enabling great flexibility when working on repositories shared by
 multiple teams.
 
-## owners-autoassign
+## Building the plugin
 
-This plugin parses the same OWNERS file format as the owners plugin. It will
-automatically assign all of the owners as reviewers to newly created or updated
-changes. It also allows for completely custom management of the attention set,
-i.e. allows, via custom integrations, to not add people on holiday to the
-attention set, or that the same user is not added to too many changes at the
-same time, etc...
+This plugin is built with Bazel using an in Gerrit tree.
 
-## Building the plugins
-
-This plugin is built with Bazel and two build modes are supported:
-
- * Standalone
- * In Gerrit tree
-
-### Build standalone
-
-To build the plugin, issue the following command:
-
-```
-  bazel build :all
-```
-
-The output is created in
-
-```
-  bazel-bin/owners/owners.jar
-  bazel-bin/owners-autoassign/owners-autoassign.jar
-  bazel-bin/owners-api/owners-api.jar
-
-```
-
-To execute the tests run:
-
-```
-  bazel test //...
-```
-
-This project can be imported into the Eclipse IDE:
-
-```
-  ./tools/eclipse/project.sh
-```
-
-## Build in Gerrit tree
-
-Create symbolic links of the owners and owners-autoassign folders and of the
-external_plugin_deps.bzl file to the Gerrit source code /plugins directory.
-
-Create a symbolic link of the owners-common plugin to the Gerrit source code
+Create symbolic links of the owners folders to the Gerrit source code /plugins
 directory.
 
+Create a symbolic link of the owners-common-api plugin to the Gerrit source code
+directory, which is needed as a pre-requisite for parsing the OWNERS file
+and the other utility functions for discovering it inside the repository branches.
+
+>>>>>>> a022e8a (Initial commit)
 Then build the owners and owners-autoassign plugins with the usual Gerrit
 plugin compile command.
 
@@ -92,15 +46,14 @@
 
 ```
   git clone https://gerrit.googlesource.com/plugins/owners
+  git clone https://gerrit.googlesource.com/plugins/owners-common-api
   git clone --recurse-submodules https://gerrit.googlesource.com/gerrit
   cd gerrit/plugins
-  ln -s ../../owners/owners .
-  ln -s ../../owners/owners-autoassign .
-  ln -s ../../owners/owners-api .
-  ln -sf ../../owners/external_plugin_deps.bzl .
+  ln -s ../../owners .
+  ln -s ../../owners-common-api .
+  ln -sf owners-common-api/external_plugin_deps.bzl .
   cd ..
-  ln -s ../owners/owners-common .
-  bazel build plugins/owners plugins/owners-autoassign
+  bazel build plugins/owners
 ```
 
 NOTE: the owners-common folder is producing shared artifacts for the two plugins
@@ -111,13 +64,12 @@
 
 ```
   bazel-bin/plugins/owners/owners.jar
-  bazel-bin/plugins/owners-autoassign/owners-autoassign.jar
 ```
 
 To execute the tests run:
 
 ```
-  bazel test owners-common:test
+  bazel test plugins/owners/...
 ```
 
 This project can be imported into the Eclipse IDE:
diff --git a/bazlets.bzl b/bazlets.bzl
deleted file mode 100644
index f089af4..0000000
--- a/bazlets.bzl
+++ /dev/null
@@ -1,18 +0,0 @@
-load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
-
-NAME = "com_googlesource_gerrit_bazlets"
-
-def load_bazlets(
-        commit,
-        local_path = None):
-    if not local_path:
-        git_repository(
-            name = NAME,
-            remote = "https://gerrit.googlesource.com/bazlets",
-            commit = commit,
-        )
-    else:
-        native.local_repository(
-            name = NAME,
-            path = local_path,
-        )
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
deleted file mode 100644
index 5ad1930..0000000
--- a/external_plugin_deps.bzl
+++ /dev/null
@@ -1,99 +0,0 @@
-load("//tools/bzl:maven_jar.bzl", "maven_jar")
-
-JACKSON_VER = "2.9.7"
-
-def external_plugin_deps():
-    maven_jar(
-        name = "jackson-core",
-        artifact = "com.fasterxml.jackson.core:jackson-core:" + JACKSON_VER,
-        sha1 = "4b7f0e0dc527fab032e9800ed231080fdc3ac015",
-    )
-
-    maven_jar(
-        name = "jackson-databind",
-        artifact = "com.fasterxml.jackson.core:jackson-databind:" + JACKSON_VER,
-        sha1 = "e6faad47abd3179666e89068485a1b88a195ceb7",
-    )
-
-    maven_jar(
-        name = "jackson-annotations",
-        artifact = "com.fasterxml.jackson.core:jackson-annotations:" + JACKSON_VER,
-        sha1 = "4b838e5c4fc17ac02f3293e9a558bb781a51c46d",
-    )
-
-    maven_jar(
-        name = "jackson-dataformat-yaml",
-        artifact = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:" + JACKSON_VER,
-        sha1 = "a428edc4bb34a2da98a50eb759c26941d4e85960",
-    )
-
-    maven_jar(
-        name = "snakeyaml",
-        artifact = "org.yaml:snakeyaml:1.23",
-        sha1 = "ec62d74fe50689c28c0ff5b35d3aebcaa8b5be68",
-    )
-
-    maven_jar(
-        name = "easymock",
-        artifact = "org.easymock:easymock:3.1",
-        sha1 = "3e127311a86fc2e8f550ef8ee4abe094bbcf7e7e",
-        deps = [
-            "@cglib//jar",
-            "@objenesis//jar",
-        ],
-    )
-
-    maven_jar(
-        name = "cglib",
-        artifact = "cglib:cglib-nodep:3.2.6",
-        sha1 = "92bf48723d277d6efd1150b2f7e9e1e92cb56caf",
-    )
-
-    maven_jar(
-        name = "objenesis",
-        artifact = "org.objenesis:objenesis:2.6",
-        sha1 = "639033469776fd37c08358c6b92a4761feb2af4b",
-    )
-
-    POWERM_VERS = "1.6.1"
-    maven_jar(
-        name = "powermock-module-junit4",
-        artifact = "org.powermock:powermock-module-junit4:" + POWERM_VERS,
-        sha1 = "ea8530b2848542624f110a393513af397b37b9cf",
-    )
-
-    maven_jar(
-        name = "powermock-module-junit4-common",
-        artifact = "org.powermock:powermock-module-junit4-common:" + POWERM_VERS,
-        sha1 = "7222ced54dabc310895d02e45c5428ca05193cda",
-    )
-
-    maven_jar(
-        name = "powermock-reflect",
-        artifact = "org.powermock:powermock-reflect:" + POWERM_VERS,
-        sha1 = "97d25eda8275c11161bcddda6ef8beabd534c878",
-    )
-
-    maven_jar(
-        name = "powermock-api-easymock",
-        artifact = "org.powermock:powermock-api-easymock:" + POWERM_VERS,
-        sha1 = "aa740ecf89a2f64d410b3d93ef8cd6833009ef00",
-    )
-
-    maven_jar(
-        name = "powermock-api-support",
-        artifact = "org.powermock:powermock-api-support:" + POWERM_VERS,
-        sha1 = "592ee6d929c324109d3469501222e0c76ccf0869",
-    )
-
-    maven_jar(
-        name = "powermock-core",
-        artifact = "org.powermock:powermock-core:" + POWERM_VERS,
-        sha1 = "5afc1efce8d44ed76b30af939657bd598e45d962",
-    )
-
-    maven_jar(
-        name = "javassist",
-        artifact = "org.javassist:javassist:3.22.0-GA",
-        sha1 = "3e83394258ae2089be7219b971ec21a8288528ad",
-    )
diff --git a/external_plugin_deps_standalone.bzl b/external_plugin_deps_standalone.bzl
deleted file mode 100644
index b2964a5..0000000
--- a/external_plugin_deps_standalone.bzl
+++ /dev/null
@@ -1,32 +0,0 @@
-load("//tools/bzl:maven_jar.bzl", "GERRIT", "maven_jar")
-load("//:external_plugin_deps.bzl", "external_plugin_deps")
-
-PROLOG_VERS = "1.4.3"
-PROLOG_REPO = GERRIT
-
-def external_plugin_deps_standalone():
-    external_plugin_deps(omit_jackson_core = False)
-
-    maven_jar(
-        name = "prolog-runtime",
-        artifact = "com.googlecode.prolog-cafe:prolog-runtime:" + PROLOG_VERS,
-        attach_source = False,
-        repository = PROLOG_REPO,
-        sha1 = "d5206556cbc76ffeab21313ffc47b586a1efbcbb",
-    )
-
-    maven_jar(
-        name = "prolog-compiler",
-        artifact = "com.googlecode.prolog-cafe:prolog-compiler:" + PROLOG_VERS,
-        attach_source = False,
-        repository = PROLOG_REPO,
-        sha1 = "f37032cf1dec3e064427745bc59da5a12757a3b2",
-    )
-
-    maven_jar(
-        name = "prolog-io",
-        artifact = "com.googlecode.prolog-cafe:prolog-io:" + PROLOG_VERS,
-        attach_source = False,
-        repository = PROLOG_REPO,
-        sha1 = "d02b2640b26f64036b6ba2b45e4acc79281cea17",
-    )
diff --git a/lib/prolog/BUILD b/lib/prolog/BUILD
deleted file mode 100644
index c5ed0b7..0000000
--- a/lib/prolog/BUILD
+++ /dev/null
@@ -1 +0,0 @@
-# Empty file required by Bazel
diff --git a/lib/prolog/prolog.bzl b/lib/prolog/prolog.bzl
deleted file mode 100644
index 5ba004b..0000000
--- a/lib/prolog/prolog.bzl
+++ /dev/null
@@ -1,3 +0,0 @@
-load("@com_googlesource_gerrit_bazlets//lib/prolog:prolog.bzl", _prolog_cafe_library = "prolog_cafe_library")
-
-prolog_cafe_library = _prolog_cafe_library
diff --git a/owners-api/BUILD b/owners-api/BUILD
deleted file mode 100644
index 06416d2..0000000
--- a/owners-api/BUILD
+++ /dev/null
@@ -1,36 +0,0 @@
-load("//tools/bzl:junit.bzl", "junit_tests")
-load("//tools/bzl:plugin.bzl", "PLUGIN_DEPS", "PLUGIN_DEPS_NEVERLINK", "PLUGIN_TEST_DEPS", "gerrit_plugin")
-
-gerrit_plugin(
-    name = "owners-api",
-    srcs = glob([
-        "src/main/java/**/*.java",
-    ]),
-    dir_name = "owners",
-    manifest_entries = [
-        "Implementation-Title: Gerrit OWNERS api plugin",
-        "Implementation-URL: https://gerrit.googlesource.com/plugins/owners",
-        "Gerrit-PluginName: owners-api",
-        "Gerrit-Module: com.googlesource.gerrit.owners.api.OwnersApiModule",
-    ],
-    resources = glob(["src/main/**/*"]),
-    deps = [],
-)
-
-java_library(
-    name = "owners-api_deps",
-    srcs = glob([
-        "src/main/java/**/*.java",
-    ]),
-    visibility = ["//visibility:public"],
-    deps = PLUGIN_DEPS_NEVERLINK,
-)
-
-junit_tests(
-    name = "owners_api_tests",
-    testonly = 1,
-    srcs = glob(["src/test/java/**/*.java"]),
-    deps = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
-        ":owners-api_deps",
-    ],
-)
diff --git a/owners-api/src/main/java/com/googlesource/gerrit/owners/api/OwnersApiModule.java b/owners-api/src/main/java/com/googlesource/gerrit/owners/api/OwnersApiModule.java
deleted file mode 100644
index 54ee51d..0000000
--- a/owners-api/src/main/java/com/googlesource/gerrit/owners/api/OwnersApiModule.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.api;
-
-import com.google.gerrit.extensions.registration.DynamicItem;
-import com.google.inject.AbstractModule;
-
-public class OwnersApiModule extends AbstractModule {
-
-  @Override
-  protected void configure() {
-    DynamicItem.itemOf(binder(), OwnersAttentionSet.class);
-  }
-}
diff --git a/owners-api/src/main/java/com/googlesource/gerrit/owners/api/OwnersAttentionSet.java b/owners-api/src/main/java/com/googlesource/gerrit/owners/api/OwnersAttentionSet.java
deleted file mode 100644
index 31cd2a4..0000000
--- a/owners-api/src/main/java/com/googlesource/gerrit/owners/api/OwnersAttentionSet.java
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.api;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.extensions.common.ChangeInfo;
-import java.util.Collection;
-
-/** API to expose a mechanism to selectively add owners to the attention-set. */
-public interface OwnersAttentionSet {
-
-  /**
-   * Select the owners that should be added to the attention-set.
-   *
-   * @param changeInfo change under review
-   * @param owners set of owners associated with a change.
-   * @return subset of owners that need to be added to the attention-set.
-   */
-  Collection<Account.Id> addToAttentionSet(ChangeInfo changeInfo, Collection<Account.Id> owners);
-}
diff --git a/owners-api/src/test/java/com/googlesource/gerrit/owners/api/OwnersAttentionSetIT.java b/owners-api/src/test/java/com/googlesource/gerrit/owners/api/OwnersAttentionSetIT.java
deleted file mode 100644
index 8a3ec18..0000000
--- a/owners-api/src/test/java/com/googlesource/gerrit/owners/api/OwnersAttentionSetIT.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.api;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import com.google.gerrit.acceptance.LightweightPluginDaemonTest;
-import com.google.gerrit.acceptance.TestPlugin;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.extensions.common.ChangeInfo;
-import com.google.gerrit.extensions.registration.DynamicItem;
-import com.google.inject.AbstractModule;
-import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.google.inject.Scopes;
-import java.util.Collection;
-import org.junit.Test;
-
-@TestPlugin(
-    name = "owners-api",
-    sysModule = "com.googlesource.gerrit.owners.api.OwnersAttentionSetIT$TestModule")
-public class OwnersAttentionSetIT extends LightweightPluginDaemonTest {
-
-  @Inject private DynamicItem<OwnersAttentionSet> ownerAttentionSetItem;
-
-  @Override
-  public Module createModule() {
-    return new OwnersApiModule();
-  }
-
-  public static class TestModule extends AbstractModule {
-    @Override
-    protected void configure() {
-      DynamicItem.bind(binder(), OwnersAttentionSet.class)
-          .to(SelectFirstOwnerForAttentionSet.class)
-          .in(Scopes.SINGLETON);
-    }
-  }
-
-  public static class SelectFirstOwnerForAttentionSet implements OwnersAttentionSet {
-    @Override
-    public Collection<Id> addToAttentionSet(ChangeInfo changeInfo, Collection<Id> owners) {
-      return null;
-    }
-  }
-
-  @Test
-  public void shouldAllowOwnersAttentionSetOverride() {
-    OwnersAttentionSet attentionSetSelector = ownerAttentionSetItem.get();
-
-    assertThat(attentionSetSelector).isNotNull();
-    assertThat(attentionSetSelector.getClass()).isEqualTo(SelectFirstOwnerForAttentionSet.class);
-  }
-}
diff --git a/owners-autoassign/BUILD b/owners-autoassign/BUILD
deleted file mode 100644
index 4aa4cec..0000000
--- a/owners-autoassign/BUILD
+++ /dev/null
@@ -1,50 +0,0 @@
-load("//tools/bzl:junit.bzl", "junit_tests")
-load("//tools/bzl:plugin.bzl", "PLUGIN_DEPS", "PLUGIN_DEPS_NEVERLINK", "PLUGIN_TEST_DEPS", "gerrit_plugin")
-
-gerrit_plugin(
-    name = "owners-autoassign",
-    srcs = glob([
-        "src/main/java/**/*.java",
-    ]),
-    dir_name = "owners",
-    manifest_entries = [
-        "Implementation-Title: Gerrit OWNERS autoassign plugin",
-        "Implementation-URL: https://gerrit.googlesource.com/plugins/owners",
-        "Gerrit-PluginName: owners-autoassign",
-        "Gerrit-Module: com.googlesource.gerrit.owners.common.AutoassignModule",
-    ],
-    resources = glob(["src/main/**/*"]),
-    deps = [
-        ":owners-api-neverlink",
-        "//owners-common",
-    ],
-)
-
-java_library(
-    name = "owners-autoassign_deps",
-    srcs = glob([
-        "src/main/java/**/*.java",
-    ]),
-    visibility = ["//visibility:public"],
-    deps = PLUGIN_DEPS_NEVERLINK + [
-        "//owners-common",
-        ":owners-api-neverlink",
-    ],
-)
-
-java_library(
-    name = "owners-api-neverlink",
-    neverlink = 1,
-    exports = ["//plugins/owners-api"],
-)
-
-junit_tests(
-    name = "owners_autoassign_tests",
-    testonly = 1,
-    srcs = glob(["src/test/java/**/*.java"]),
-    deps = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
-        "//owners-common",
-        "//plugins/owners-api",
-        ":owners-autoassign_deps",
-    ],
-)
diff --git a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AsyncReviewerManager.java b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AsyncReviewerManager.java
deleted file mode 100644
index 6ea35e4..0000000
--- a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AsyncReviewerManager.java
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.entities.Project;
-import com.google.gerrit.entities.Project.NameKey;
-import com.google.gerrit.extensions.api.changes.ChangeApi;
-import com.google.gerrit.extensions.restapi.RestApiException;
-import com.google.gerrit.server.git.WorkQueue;
-import com.google.gerrit.server.util.ManualRequestContext;
-import com.google.gerrit.server.util.OneOffRequestContext;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Collection;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Singleton
-class AsyncReviewerManager implements ReviewerManager {
-
-  private static final Logger log = LoggerFactory.getLogger(AsyncReviewerManager.class);
-
-  private final SyncReviewerManager syncReviewerManager;
-  private final AutoAssignConfig config;
-  private final ScheduledExecutorService executor;
-  private final OneOffRequestContext requestContext;
-
-  class AddReviewersTask implements Runnable {
-    private final NameKey projectName;
-    private final ChangeApi cApi;
-    private final Collection<Id> reviewers;
-    private final int changeNum;
-    private int retryNum;
-
-    public AddReviewersTask(
-        Project.NameKey projectName, ChangeApi cApi, Collection<Account.Id> reviewers)
-        throws RestApiException {
-      this.projectName = projectName;
-      this.cApi = cApi;
-      this.changeNum = cApi.get()._number;
-      this.reviewers = reviewers;
-    }
-
-    @Override
-    public String toString() {
-      return "auto-assign reviewers to change "
-          + changeNum
-          + (retryNum > 0 ? "(retry #" + retryNum + ")" : "");
-    }
-
-    @Override
-    public void run() {
-      try (ManualRequestContext ctx = requestContext.open()) {
-        syncReviewerManager.addReviewers(projectName, cApi, reviewers);
-      } catch (Exception e) {
-        retryNum++;
-
-        if (retryNum > config.retryCount()) {
-          log.error("{} *FAILED*", this, e);
-        } else {
-          long retryInterval = config.retryInterval();
-          log.warn("{} *FAILED*: retrying after {} msec", this, retryInterval, e);
-          executor.schedule(this, retryInterval, TimeUnit.MILLISECONDS);
-        }
-      }
-    }
-  }
-
-  @Inject
-  public AsyncReviewerManager(
-      AutoAssignConfig config,
-      WorkQueue executorFactory,
-      SyncReviewerManager syncReviewerManager,
-      OneOffRequestContext requestContext) {
-    this.config = config;
-    this.syncReviewerManager = syncReviewerManager;
-    this.executor = executorFactory.createQueue(config.asyncThreads(), "AsyncReviewerManager");
-    this.requestContext = requestContext;
-  }
-
-  @Override
-  public void addReviewers(
-      Project.NameKey projectName, ChangeApi cApi, Collection<Account.Id> reviewers)
-      throws ReviewerManagerException {
-    try {
-      executor.schedule(
-          new AddReviewersTask(projectName, cApi, reviewers),
-          config.asyncDelay(),
-          TimeUnit.MILLISECONDS);
-    } catch (RestApiException e) {
-      throw new ReviewerManagerException(e);
-    }
-  }
-}
diff --git a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoAssignConfig.java b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoAssignConfig.java
deleted file mode 100644
index c381f19..0000000
--- a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoAssignConfig.java
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.gerrit.extensions.client.InheritableBoolean.TRUE;
-import static com.googlesource.gerrit.owners.common.AutoassignConfigModule.PROJECT_CONFIG_AUTOASSIGN_FIELD;
-import static com.googlesource.gerrit.owners.common.AutoassignConfigModule.PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.gerrit.entities.Project;
-import com.google.gerrit.extensions.annotations.PluginName;
-import com.google.gerrit.extensions.client.ReviewerState;
-import com.google.gerrit.server.config.ConfigUtil;
-import com.google.gerrit.server.config.PluginConfig;
-import com.google.gerrit.server.config.PluginConfigFactory;
-import com.google.gerrit.server.project.NoSuchProjectException;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import org.eclipse.jgit.lib.Config;
-
-@Singleton
-public class AutoAssignConfig {
-  public static final String REVIEWERS_SECTION = "reviewers";
-  public static final String ASYNC = "async";
-  public static final boolean ASYNC_DEF = false;
-  public static final String DELAY = "delay";
-  public static final long DELAY_MSEC_DEF = 1500L;
-  public static final String RETRY_COUNT = "retryCount";
-  public static final int RETRY_COUNT_DEF = 2;
-  public static final String RETRY_INTERVAL = "retryInterval";
-  public static final long RETRY_INTERVAL_MSEC_DEF = DELAY_MSEC_DEF;
-  public static final String THREADS = "threads";
-  public static final int THREADS_DEF = 1;
-
-  private final boolean asyncReviewers;
-  private final int asyncThreads;
-  private final int retryCount;
-  private final long retryInterval;
-  private final long asyncDelay;
-
-  private final PluginConfigFactory cfgFactory;
-  private final String pluginName;
-
-  private final PluginSettings settings;
-
-  @Inject
-  AutoAssignConfig(
-      PluginSettings settings, PluginConfigFactory configFactory, @PluginName String pluginName) {
-    this.settings = settings;
-    this.pluginName = pluginName;
-    this.cfgFactory = configFactory;
-    Config config = configFactory.getGlobalPluginConfig(pluginName);
-    asyncReviewers = config.getBoolean(REVIEWERS_SECTION, ASYNC, ASYNC_DEF);
-    asyncThreads = config.getInt(REVIEWERS_SECTION, THREADS, THREADS_DEF);
-    asyncDelay =
-        ConfigUtil.getTimeUnit(
-            config, REVIEWERS_SECTION, null, DELAY, DELAY_MSEC_DEF, MILLISECONDS);
-
-    retryCount = config.getInt(REVIEWERS_SECTION, RETRY_COUNT, RETRY_COUNT_DEF);
-    retryInterval =
-        ConfigUtil.getTimeUnit(
-            config, REVIEWERS_SECTION, null, RETRY_INTERVAL, asyncDelay, MILLISECONDS);
-  }
-
-  @VisibleForTesting
-  public AutoAssignConfig() {
-    this.settings = null;
-    this.pluginName = "owners-autoassign";
-    cfgFactory = null;
-    Config config = new Config();
-    asyncReviewers = config.getBoolean(REVIEWERS_SECTION, ASYNC, ASYNC_DEF);
-    asyncThreads = config.getInt(REVIEWERS_SECTION, THREADS, THREADS_DEF);
-    asyncDelay =
-        ConfigUtil.getTimeUnit(
-            config, REVIEWERS_SECTION, null, DELAY, DELAY_MSEC_DEF, MILLISECONDS);
-
-    retryCount = config.getInt(REVIEWERS_SECTION, RETRY_COUNT, RETRY_COUNT_DEF);
-    retryInterval =
-        ConfigUtil.getTimeUnit(
-            config, REVIEWERS_SECTION, null, RETRY_INTERVAL, asyncDelay, MILLISECONDS);
-  }
-
-  public boolean isAsyncReviewers() {
-    return asyncReviewers;
-  }
-
-  public int asyncThreads() {
-    return asyncThreads;
-  }
-
-  public int retryCount() {
-    return retryCount;
-  }
-
-  public long retryInterval() {
-    return retryInterval;
-  }
-
-  public long asyncDelay() {
-    return asyncDelay;
-  }
-
-  private PluginConfig cfg(Project.NameKey projectKey) throws NoSuchProjectException {
-    return cfgFactory.getFromProjectConfigWithInheritance(projectKey, pluginName);
-  }
-
-  public boolean autoAssignWip(Project.NameKey projectKey) throws NoSuchProjectException {
-    return settings
-        .projectSpecificConfig(projectKey)
-        .getEnum(PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES, TRUE)
-        .equals(TRUE);
-  }
-
-  public ReviewerState autoassignedReviewerState(Project.NameKey projectKey)
-      throws NoSuchProjectException {
-    return settings
-        .projectSpecificConfig(projectKey)
-        .getEnum(PROJECT_CONFIG_AUTOASSIGN_FIELD, ReviewerState.REVIEWER);
-  }
-
-  public boolean isBranchDisabled(String branch) {
-    return settings.isBranchDisabled(branch);
-  }
-
-  public boolean expandGroups() {
-    return settings.expandGroups();
-  }
-}
diff --git a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoassignConfigModule.java b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoassignConfigModule.java
deleted file mode 100644
index 865d971..0000000
--- a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoassignConfigModule.java
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.extensions.annotations.Exports;
-import com.google.gerrit.extensions.api.projects.ProjectConfigEntryType;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import com.google.gerrit.extensions.client.ReviewerState;
-import com.google.gerrit.server.config.ProjectConfigEntry;
-import com.google.inject.AbstractModule;
-import java.util.Arrays;
-
-public class AutoassignConfigModule extends AbstractModule {
-  public static final String PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES = "autoAssignWip";
-  public static final String PROJECT_CONFIG_AUTOASSIGN_FIELD = "autoAssignField";
-
-  @Override
-  protected void configure() {
-    bind(ProjectConfigEntry.class)
-        .annotatedWith(Exports.named(PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES))
-        .toInstance(
-            new ProjectConfigEntry(
-                "Auto-assign WIP changes", InheritableBoolean.INHERIT, InheritableBoolean.class));
-    bind(ProjectConfigEntry.class)
-        .annotatedWith(Exports.named(PROJECT_CONFIG_AUTOASSIGN_FIELD))
-        .toInstance(
-            new ProjectConfigEntry(
-                "Auto-assign field",
-                ReviewerState.REVIEWER.name(),
-                ProjectConfigEntryType.LIST,
-                Arrays.asList(ReviewerState.CC.name(), ReviewerState.REVIEWER.name()),
-                true,
-                "Change field to use for the assigned accounts"));
-  }
-}
diff --git a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoassignModule.java b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoassignModule.java
deleted file mode 100644
index 5e6ad99..0000000
--- a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/AutoassignModule.java
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2013 VMware, Inc. All Rights Reserved.
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.gerrit.extensions.events.GitReferenceUpdatedListener;
-import com.google.gerrit.extensions.registration.DynamicItem;
-import com.google.gerrit.extensions.registration.DynamicSet;
-import com.google.inject.AbstractModule;
-import com.google.inject.Inject;
-import com.google.inject.Scopes;
-import com.googlesource.gerrit.owners.api.OwnersAttentionSet;
-
-public class AutoassignModule extends AbstractModule {
-
-  private final Class<? extends OwnersAttentionSet> ownersAttentionSetImpl;
-  private final AutoAssignConfig config;
-
-  @VisibleForTesting
-  AutoassignModule() {
-    this(DefaultAddAllOwnersToAttentionSet.class, new AutoAssignConfig());
-  }
-
-  @Inject
-  AutoassignModule(AutoAssignConfig config) {
-    this(DefaultAddAllOwnersToAttentionSet.class, config);
-  }
-
-  @VisibleForTesting
-  public AutoassignModule(
-      Class<? extends OwnersAttentionSet> ownersAttentionSetImpl, AutoAssignConfig config) {
-    this.ownersAttentionSetImpl = ownersAttentionSetImpl;
-    this.config = config;
-  }
-
-  @Override
-  protected void configure() {
-    install(PathOwnersEntriesCache.module());
-    bind(ReviewerManager.class)
-        .to(config.isAsyncReviewers() ? AsyncReviewerManager.class : SyncReviewerManager.class);
-    DynamicSet.bind(binder(), GitReferenceUpdatedListener.class).to(GitRefListener.class);
-    DynamicItem.bind(binder(), OwnersAttentionSet.class)
-        .to(ownersAttentionSetImpl)
-        .in(Scopes.SINGLETON);
-    install(new AutoassignConfigModule());
-  }
-}
diff --git a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/DefaultAddAllOwnersToAttentionSet.java b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/DefaultAddAllOwnersToAttentionSet.java
deleted file mode 100644
index d53a239..0000000
--- a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/DefaultAddAllOwnersToAttentionSet.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.extensions.common.ChangeInfo;
-import com.googlesource.gerrit.owners.api.OwnersAttentionSet;
-import java.util.Collection;
-
-class DefaultAddAllOwnersToAttentionSet implements OwnersAttentionSet {
-
-  @Override
-  public Collection<Id> addToAttentionSet(ChangeInfo changeInfo, Collection<Id> owners) {
-    return owners;
-  }
-}
diff --git a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/GitRefListener.java b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/GitRefListener.java
deleted file mode 100644
index 16c720a..0000000
--- a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/GitRefListener.java
+++ /dev/null
@@ -1,289 +0,0 @@
-// Copyright (c) 2013 VMware, Inc. All Rights Reserved.
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE;
-
-import com.google.common.base.Predicates;
-import com.google.common.collect.Sets;
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Change;
-import com.google.gerrit.entities.Project;
-import com.google.gerrit.entities.Project.NameKey;
-import com.google.gerrit.entities.RefNames;
-import com.google.gerrit.exceptions.StorageException;
-import com.google.gerrit.extensions.annotations.Listen;
-import com.google.gerrit.extensions.api.GerritApi;
-import com.google.gerrit.extensions.api.changes.ChangeApi;
-import com.google.gerrit.extensions.api.changes.Changes;
-import com.google.gerrit.extensions.common.AccountInfo;
-import com.google.gerrit.extensions.common.ChangeInfo;
-import com.google.gerrit.extensions.events.GitReferenceUpdatedListener;
-import com.google.gerrit.extensions.restapi.RestApiException;
-import com.google.gerrit.server.ChangeMessagesUtil;
-import com.google.gerrit.server.CurrentUser;
-import com.google.gerrit.server.git.GitRepositoryManager;
-import com.google.gerrit.server.notedb.ChangeNotes;
-import com.google.gerrit.server.notedb.ChangeNotesCommit;
-import com.google.gerrit.server.notedb.ChangeNotesCommit.ChangeNotesRevWalk;
-import com.google.gerrit.server.patch.DiffSummary;
-import com.google.gerrit.server.patch.DiffSummaryKey;
-import com.google.gerrit.server.patch.PatchListCache;
-import com.google.gerrit.server.patch.PatchListKey;
-import com.google.gerrit.server.patch.PatchListNotAvailableException;
-import com.google.gerrit.server.project.NoSuchProjectException;
-import com.google.gerrit.server.project.ProjectCache;
-import com.google.gerrit.server.project.ProjectState;
-import com.google.gerrit.server.util.ManualRequestContext;
-import com.google.gerrit.server.util.OneOffRequestContext;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-import org.eclipse.jgit.errors.IncorrectObjectTypeException;
-import org.eclipse.jgit.errors.MissingObjectException;
-import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.revwalk.FooterKey;
-import org.eclipse.jgit.revwalk.RevCommit;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Listen
-public class GitRefListener implements GitReferenceUpdatedListener {
-  private static final Logger logger = LoggerFactory.getLogger(GitRefListener.class);
-
-  private static final FooterKey FOOTER_WORK_IN_PROGRESS = new FooterKey("Work-in-progress");
-
-  private final GerritApi api;
-
-  private final PatchListCache patchListCache;
-  private final ProjectCache projectCache;
-  private final GitRepositoryManager repositoryManager;
-  private final Accounts accounts;
-  private final ReviewerManager reviewerManager;
-
-  private final OneOffRequestContext oneOffReqCtx;
-
-  private Provider<CurrentUser> currentUserProvider;
-
-  private ChangeNotes.Factory notesFactory;
-
-  private final AutoAssignConfig cfg;
-
-  private final PathOwnersEntriesCache cache;
-  private final PluginSettings pluginSettings;
-
-  @Inject
-  public GitRefListener(
-      GerritApi api,
-      PatchListCache patchListCache,
-      ProjectCache projectCache,
-      GitRepositoryManager repositoryManager,
-      Accounts accounts,
-      ReviewerManager reviewerManager,
-      OneOffRequestContext oneOffReqCtx,
-      Provider<CurrentUser> currentUserProvider,
-      ChangeNotes.Factory notesFactory,
-      AutoAssignConfig cfg,
-      PathOwnersEntriesCache cache,
-      PluginSettings pluginSettings) {
-    this.api = api;
-    this.patchListCache = patchListCache;
-    this.projectCache = projectCache;
-    this.repositoryManager = repositoryManager;
-    this.accounts = accounts;
-    this.reviewerManager = reviewerManager;
-    this.oneOffReqCtx = oneOffReqCtx;
-    this.currentUserProvider = currentUserProvider;
-    this.notesFactory = notesFactory;
-    this.cfg = cfg;
-    this.cache = cache;
-    this.pluginSettings = pluginSettings;
-  }
-
-  @Override
-  public void onGitReferenceUpdated(Event event) {
-    if (event.isDelete()) {
-      logger.debug("Ref-update event on ref %s is a deletion: ignoring", event.getRefName());
-      return;
-    }
-
-    try {
-      AccountInfo updaterAccountInfo = event.getUpdater();
-      CurrentUser currentUser = currentUserProvider.get();
-      if (currentUser.isIdentifiedUser()) {
-        handleGitReferenceUpdated(event);
-      } else if (updaterAccountInfo != null) {
-        handleGitReferenceUpdatedAsUser(event, Account.id(updaterAccountInfo._accountId));
-      } else {
-        handleGitReferenceUpdatedAsServer(event);
-      }
-    } catch (StorageException | NoSuchProjectException e) {
-      logger.warn("Unable to process event {} on project {}", event, event.getProjectName(), e);
-    }
-  }
-
-  private void handleGitReferenceUpdatedAsUser(Event event, Account.Id updaterAccountId)
-      throws NoSuchProjectException {
-    try (ManualRequestContext ctx = oneOffReqCtx.openAs(updaterAccountId)) {
-      handleGitReferenceUpdated(event);
-    }
-  }
-
-  private void handleGitReferenceUpdatedAsServer(Event event) throws NoSuchProjectException {
-    try (ManualRequestContext ctx = oneOffReqCtx.open()) {
-      handleGitReferenceUpdated(event);
-    }
-  }
-
-  private void handleGitReferenceUpdated(Event event) throws NoSuchProjectException {
-    String projectName = event.getProjectName();
-    Repository repository;
-    try {
-      NameKey projectNameKey = Project.NameKey.parse(projectName);
-      boolean autoAssignWip = cfg.autoAssignWip(projectNameKey);
-      repository = repositoryManager.openRepository(projectNameKey);
-      try {
-        String refName = event.getRefName();
-        Change.Id changeId = Change.Id.fromRef(refName);
-        if (changeId != null) {
-          ChangeNotes changeNotes = notesFactory.createChecked(projectNameKey, changeId);
-          if ((!RefNames.isNoteDbMetaRef(refName)
-                  && isChangeToBeProcessed(changeNotes.getChange(), autoAssignWip))
-              || isChangeSetReadyForReview(repository, changeNotes, event.getNewObjectId())) {
-            processEvent(projectNameKey, repository, event, changeId);
-          }
-        }
-      } finally {
-        repository.close();
-      }
-    } catch (IOException e) {
-      logger.warn("Couldn't open repository: {}", projectName, e);
-    }
-  }
-
-  private boolean isChangeToBeProcessed(Change change, boolean autoAssignWip) {
-    return !change.isWorkInProgress() || autoAssignWip;
-  }
-
-  private boolean isChangeSetReadyForReview(
-      Repository repository, ChangeNotes changeNotes, String metaObjectId)
-      throws MissingObjectException, IncorrectObjectTypeException, IOException {
-    if (changeNotes.getChange().isWorkInProgress()) {
-      return false;
-    }
-
-    if (changeNotes.getChangeMessages().stream()
-        .filter(message -> message.getKey().uuid().equals(metaObjectId))
-        .map(message -> message.getTag())
-        .filter(Predicates.notNull())
-        .anyMatch(tag -> tag.contains(ChangeMessagesUtil.TAG_SET_READY))) {
-      return true;
-    }
-
-    try (ChangeNotesRevWalk revWalk = ChangeNotesCommit.newRevWalk(repository)) {
-      ChangeNotesCommit metaCommit = revWalk.parseCommit(ObjectId.fromString(metaObjectId));
-      if (metaCommit.getParentCount() == 0) {
-        // The first commit cannot be a 'Set ready' operation
-        return false;
-      }
-      List<String> wipFooterLines = metaCommit.getFooterLines(FOOTER_WORK_IN_PROGRESS);
-      return wipFooterLines != null
-          && !wipFooterLines.isEmpty()
-          && Boolean.FALSE.toString().equalsIgnoreCase(wipFooterLines.get(0));
-    }
-  }
-
-  public void processEvent(
-      Project.NameKey projectNameKey, Repository repository, Event event, Change.Id cId)
-      throws NoSuchProjectException {
-    Changes changes = api.changes();
-    // The provider injected by Gerrit is shared with other workers on the
-    // same local thread and thus cannot be closed in this event listener.
-    try {
-      ChangeApi cApi = changes.id(cId.get());
-      ChangeInfo change = cApi.get();
-      List<NameKey> parentProjectsNameKeys =
-          projectCache
-              .get(NameKey.parse(change.project))
-              .map(
-                  p ->
-                      p.parents().stream()
-                          .map(ProjectState::getNameKey)
-                          .collect(Collectors.toList()))
-              .orElse(Collections.emptyList());
-
-      DiffSummary patchList = getDiffSummary(repository, event, change);
-      if (patchList != null) {
-        PathOwners owners =
-            new PathOwners(
-                accounts,
-                repositoryManager,
-                repository,
-                parentProjectsNameKeys,
-                cfg.isBranchDisabled(change.branch) ? Optional.empty() : Optional.of(change.branch),
-                patchList,
-                cfg.expandGroups(),
-                projectNameKey.get(),
-                cache,
-                pluginSettings.globalLabel());
-        Set<Account.Id> allReviewers = Sets.newHashSet();
-        allReviewers.addAll(owners.get().values());
-        allReviewers.addAll(owners.getReviewers().values());
-        for (Matcher matcher : owners.getMatchers().values()) {
-          allReviewers.addAll(matcher.getOwners());
-          allReviewers.addAll(matcher.getReviewers());
-        }
-        logger.debug("Autoassigned reviewers are: {}", allReviewers.toString());
-        reviewerManager.addReviewers(projectNameKey, cApi, allReviewers);
-      }
-    } catch (RestApiException e) {
-      logger.warn("Could not open change: {}", cId, e);
-    } catch (ReviewerManagerException e) {
-      logger.warn("Could not add reviewers for change: {}", cId, e);
-    } catch (InvalidOwnersFileException e) {
-      logger.warn("Could not add reviewers for change: {} due to rules error", cId, e);
-    }
-  }
-
-  private DiffSummary getDiffSummary(Repository repository, Event event, ChangeInfo change) {
-    ObjectId newId = null;
-    PatchListKey plKey;
-    try {
-      if (RefNames.isNoteDbMetaRef(event.getRefName())) {
-        newId = ObjectId.fromString(change.currentRevision);
-        RevCommit revCommit = repository.parseCommit(newId);
-        plKey = PatchListKey.againstBase(newId, revCommit.getParentCount());
-      } else {
-        if (event.getNewObjectId() != null) {
-          newId = ObjectId.fromString(event.getNewObjectId());
-        }
-        plKey = PatchListKey.againstCommit(null, newId, IGNORE_NONE);
-      }
-      return patchListCache.getDiffSummary(
-          DiffSummaryKey.fromPatchListKey(plKey), Project.nameKey(change.project));
-    } catch (PatchListNotAvailableException | IOException e) {
-      logger.warn("Could not load patch list for change {}", change.id, e);
-    }
-    return null;
-  }
-}
diff --git a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/ReviewerManager.java b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/ReviewerManager.java
deleted file mode 100644
index bf56e26..0000000
--- a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/ReviewerManager.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Project.NameKey;
-import com.google.gerrit.extensions.api.changes.ChangeApi;
-import com.google.gerrit.server.project.NoSuchProjectException;
-import java.util.Collection;
-
-public interface ReviewerManager {
-
-  public void addReviewers(
-      NameKey projectNameKey, ChangeApi cApi, Collection<Account.Id> accountsIds)
-      throws ReviewerManagerException, NoSuchProjectException;
-}
diff --git a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/ReviewerManagerException.java b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/ReviewerManagerException.java
deleted file mode 100644
index 34b6109..0000000
--- a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/ReviewerManagerException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2013 VMware, Inc. All Rights Reserved.
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-public class ReviewerManagerException extends Exception {
-  private static final long serialVersionUID = 1L;
-
-  public ReviewerManagerException(String message) {
-    super(message);
-  }
-
-  public ReviewerManagerException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  public ReviewerManagerException(Throwable cause) {
-    super(cause);
-  }
-}
diff --git a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/SyncReviewerManager.java b/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/SyncReviewerManager.java
deleted file mode 100644
index d44cfc1..0000000
--- a/owners-autoassign/src/main/java/com/googlesource/gerrit/owners/common/SyncReviewerManager.java
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright (c) 2013 VMware, Inc. All Rights Reserved.
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Change;
-import com.google.gerrit.entities.Project;
-import com.google.gerrit.entities.Project.NameKey;
-import com.google.gerrit.extensions.api.GerritApi;
-import com.google.gerrit.extensions.api.changes.AttentionSetInput;
-import com.google.gerrit.extensions.api.changes.ChangeApi;
-import com.google.gerrit.extensions.api.changes.ReviewInput;
-import com.google.gerrit.extensions.api.changes.ReviewerInput;
-import com.google.gerrit.extensions.client.ReviewerState;
-import com.google.gerrit.extensions.common.ChangeInfo;
-import com.google.gerrit.extensions.registration.DynamicItem;
-import com.google.gerrit.extensions.restapi.RestApiException;
-import com.google.gerrit.server.IdentifiedUser;
-import com.google.gerrit.server.permissions.ChangePermission;
-import com.google.gerrit.server.permissions.PermissionBackend;
-import com.google.gerrit.server.project.NoSuchProjectException;
-import com.google.gerrit.server.query.change.ChangeData;
-import com.google.gerrit.server.util.ManualRequestContext;
-import com.google.gerrit.server.util.OneOffRequestContext;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.googlesource.gerrit.owners.api.OwnersAttentionSet;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Singleton
-class SyncReviewerManager implements ReviewerManager {
-  private static final Logger log = LoggerFactory.getLogger(SyncReviewerManager.class);
-
-  private final OneOffRequestContext requestContext;
-  private final GerritApi gApi;
-  private final IdentifiedUser.GenericFactory userFactory;
-  private final ChangeData.Factory changeDataFactory;
-  private final PermissionBackend permissionBackend;
-
-  /**
-   * TODO: The optional injection here is needed for keeping backward compatibility with existing
-   * setups that do not have the owners-api.jar configured as Gerrit libModule.
-   *
-   * <p>Once merged to master, the optional injection can go and this can be moved as extra argument
-   * in the constructor.
-   */
-  @Inject(optional = true)
-  private DynamicItem<OwnersAttentionSet> ownersForAttentionSet;
-
-  private final AutoAssignConfig cfg;
-
-  @Inject
-  public SyncReviewerManager(
-      OneOffRequestContext requestContext,
-      GerritApi gApi,
-      IdentifiedUser.GenericFactory userFactory,
-      ChangeData.Factory changeDataFactory,
-      PermissionBackend permissionBackend,
-      AutoAssignConfig cfg) {
-    this.requestContext = requestContext;
-    this.gApi = gApi;
-    this.userFactory = userFactory;
-    this.changeDataFactory = changeDataFactory;
-    this.permissionBackend = permissionBackend;
-    this.cfg = cfg;
-  }
-
-  public void addReviewers(
-      NameKey projectNameKey, ChangeApi cApi, Collection<Account.Id> accountsIds)
-      throws ReviewerManagerException, NoSuchProjectException {
-    try {
-      ChangeInfo changeInfo = cApi.get();
-      Set<Integer> currentReviewers =
-          changeInfo.reviewers.values().stream()
-              .flatMap(Collection::stream)
-              .map(ri -> ri._accountId)
-              .collect(Collectors.toSet());
-      ReviewerState reviewerState = cfg.autoassignedReviewerState(projectNameKey);
-      try (ManualRequestContext ctx =
-          requestContext.openAs(Account.id(changeInfo.owner._accountId))) {
-        // TODO(davido): Switch back to using changes API again,
-        // when it supports batch mode for adding reviewers
-        ReviewInput in = new ReviewInput();
-        in.reviewers = new ArrayList<>(accountsIds.size());
-        Collection<Account.Id> validOwnersForAttentionSet = new ArrayList<>(accountsIds.size());
-        for (Account.Id account : accountsIds) {
-          if (currentReviewers.contains(account.get())) {
-            continue;
-          }
-          if (isVisibleTo(changeInfo, account)) {
-            ReviewerInput addReviewerInput = new ReviewerInput();
-            addReviewerInput.reviewer = account.toString();
-            addReviewerInput.state = reviewerState;
-            in.reviewers.add(addReviewerInput);
-
-            if (reviewerState == ReviewerState.REVIEWER) {
-              validOwnersForAttentionSet.add(account);
-            }
-          } else {
-            log.warn(
-                "Not adding account {} as reviewer to change {} because the associated ref is not"
-                    + " visible",
-                account,
-                changeInfo._number);
-          }
-        }
-
-        Collection<Account.Id> reviewersAccounts;
-        if (validOwnersForAttentionSet.isEmpty()) {
-          reviewersAccounts = Collections.emptyList();
-        } else {
-          reviewersAccounts =
-              Optional.ofNullable(ownersForAttentionSet)
-                  .map(DynamicItem::get)
-                  .filter(Objects::nonNull)
-                  .map(owners -> owners.addToAttentionSet(changeInfo, validOwnersForAttentionSet))
-                  .orElse(validOwnersForAttentionSet);
-        }
-
-        in.ignoreAutomaticAttentionSetRules = true;
-        if (ownersForAttentionSet != null) {
-          in.addToAttentionSet =
-              reviewersAccounts.stream()
-                  .map(
-                      (reviewer) ->
-                          new AttentionSetInput(
-                              reviewer.toString(), "Selected as member of the OWNERS file"))
-                  .collect(Collectors.toList());
-        }
-
-        gApi.changes().id(changeInfo.id).current().review(in);
-      }
-    } catch (RestApiException e) {
-      log.error("Couldn't add reviewers to the change", e);
-      throw new ReviewerManagerException(e);
-    }
-  }
-
-  private boolean isVisibleTo(ChangeInfo changeInfo, Account.Id account) {
-    ChangeData changeData =
-        changeDataFactory.create(
-            Project.nameKey(changeInfo.project), Change.id(changeInfo._number));
-    return permissionBackend
-        .user(userFactory.create(account))
-        .change(changeData)
-        .testOrFalse(ChangePermission.READ);
-  }
-}
diff --git a/owners-autoassign/src/main/resources/Documentation/attention-set.md b/owners-autoassign/src/main/resources/Documentation/attention-set.md
deleted file mode 100644
index ca4295f..0000000
--- a/owners-autoassign/src/main/resources/Documentation/attention-set.md
+++ /dev/null
@@ -1,74 +0,0 @@
-## Attention-Set
-
-The owners-autoassign plugin allows to customize the selection of owners
-that need to be added to the attention-set.
-By default, Gerrit adds all reviewers to the attention-set, which could
-not be ideal when the list of owners automatically assigned could be
-quite long, due to the hierarchy of the OWNERS files in the parent
-directories.
-
-## Customization of the attention-set selection
-
-The OwnersAttentionSet API, contained in the owners-api.jar libModule,
-provides the following interface:
-
-```
-public interface OwnersAttentionSet {
-
-  Collection<Account.Id> addToAttentionSet(ChangeInfo changeInfo, Collection<Account.Id> owners);
-}
-```
-
-Any other plugin, or script, can implement the interface and provide
-an alternative implementation of the Gerrit's default mechanism.
-
-Example: select two random owners and add to the attention set by adding the
-following script as $GERRIT_SITE/plugins/owners-attentionset-1.0.groovy.
-
-```
-import com.google.inject.*
-import com.google.gerrit.common.*
-import com.google.gerrit.entities.*
-import com.google.gerrit.extensions.common.*
-import com.google.gerrit.extensions.registration.*
-import com.googlesource.gerrit.owners.api.*
-import java.util.*
-
-@Singleton
-class MyAttentionSet implements OwnersAttentionSet {
-  def desiredAttentionSet = 3
-
-  Collection<Account.Id> addToAttentionSet(ChangeInfo changeInfo, Collection<Account.Id> owners) {
-    def currentAttentionSet = changeInfo.attentionSet.size()
-
-    // There is already the desired number of attention-set
-    if (currentAttentionSet >= desiredAttentionSet) {
-      return Collections.emptyList()
-    }
-
-    // All owners are within the attention-set limits
-    if (owners.size() <= desiredAttentionSet) {
-      return owners
-    }
-
-    // Select randomly some owners for the attention-set
-    def shuffledOwners = owners.asType(List)
-    Collections.shuffle shuffledOwners
-    return shuffledOwners.subList(0,desiredAttentionSet)
-  }
-}
-
-class MyAttentionSetModule extends AbstractModule {
-
-  protected void configure() {
-    DynamicItem.bind(binder(), OwnersAttentionSet.class)
-        .to(MyAttentionSet.class)
-        .in(Scopes.SINGLETON)
-  }
-}
-
-modules = [ MyAttentionSetModule.class ]
-```
-
-**NOTE**: Install the [groovy-provider plugin](https://gerrit.googlesource.com/plugins/scripting/groovy-provider/)
-for enabling Gerrit to load Groovy scripts as plugins.
\ No newline at end of file
diff --git a/owners-autoassign/src/main/resources/Documentation/auto-assign.md b/owners-autoassign/src/main/resources/Documentation/auto-assign.md
deleted file mode 100644
index 506a176..0000000
--- a/owners-autoassign/src/main/resources/Documentation/auto-assign.md
+++ /dev/null
@@ -1,49 +0,0 @@
-## Reviewers auto-assign configuration
-
-The OWNERS file is processed by the @PLUGIN@ for automatically
-assigning all relevant owners to a change for every new patch-set
-uploaded.
-
-The way that the reviewers are added is controlled by the
-$GERRIT_SITE/etc/@PLUGIN@.config file.
-
-By default, all reviewers are added synchronously when a patch-set
-is uploaded. However, you may want to delay the assignment of additional
-reviewers to a later stage for lowering the pressure on the Git
-repository associated with concurrent updates.
-
-For example, the following configuration would delay the assignment of
-reviewers by 5 seconds:
-
-```
-[reviewers]
-  async = true
-  delay = 5 sec
-```
-
-See below the full list of configuration settings available:
-
-- `reviewers.async`: assign reviewers asynchronously. When set to `false`, all
-  the other settings in @PLUGIN@.config are ignored. By default, set to `false`.
-
-- `reviewers.delay`: delay of the assignment of reviewers since the upload
-  of a new patch-set, expressed in <number> <unit>. By default, set to `0`.
-
-  Values should use common unit suffixes to express their setting:
-
-  - ms, milliseconds
-
-  - s, sec, second, seconds
-
-  - m, min, minute, minutes
-
-   - h, hr, hour, hours
-
-- `reviewers.retryCount`: number of retries for attempting to assign reviewers
-  to a change. By default, set to `2`.
-
-- `reviewers.retryInterval`: delay between retries. Expressed in the same format
-  of the `reviewers.delay`. By default, set to the same value of `reviewers.delay`.
-
-- `reviewers.threads`: maximum concurrency of threads for assigning reviewers to
-  changes. By default, set to 1.
\ No newline at end of file
diff --git a/owners-autoassign/src/main/resources/Documentation/config.md b/owners-autoassign/src/main/resources/Documentation/config.md
deleted file mode 100644
index 0353861..0000000
--- a/owners-autoassign/src/main/resources/Documentation/config.md
+++ /dev/null
@@ -1,332 +0,0 @@
-## Global configuration
-
-The global plugin configuration is read from the `$GERRIT_SITE/etc/owners-autoassign.config`
-and is applied across all projects in Gerrit.
-
-owners.disable.branch
-:	List of branches regex where the resolution and auto-assignment of owners is disabled.
-
-Example:
-
-```
-[owners "disable"]
-  branch = refs/meta/config
-  branch = refs/heads/sandboxes.*
-```
-
-## Project configuration
-
-There are 2 project specific configurations: `autoAssignWip` and
-`autoAssignField`. `autoAssignWip` controls the automatic assignment of
-reviewers based on the OWNERS file on WIP changes, while `autoAssignField`
-controls which field these OWNERS will be assigned too. It can be one of
-`REVIEWER` or `CC`. e.g.:
-
-```
-[plugin "owners-autoassign"]
-  autoAssignField = CC
-  autoAssignWip = TRUE
-```
-
-Both settings can be inherited from the parent project by setting the value
-to `INHERIT`.
-
-By default, all changes are subject to auto-assignment, unless the project
-or one of its parent projects has the `autoAssignWip` set to `FALSE`.
-
-## OWNERS configuration
-
-Owner approval is determined based on OWNERS files located in the same
-repository on the target branch of the changes uploaded for review.
-
-The `OWNERS` file has the following YAML structure:
-
-```yaml
-inherited: true
-owners:
-- some.email@example.com
-- User Name
-- group/Group of Users
-matchers:
-- suffix: .java
-  owners:
-      [...]
-- regex: .*/README.*
-  owners:
-      [...]
-- partial_regex: example
-  owners:
-      [...]
-- exact: path/to/file.txt
-      [...]
-```
-
-_NOTE: Be aware to double check that emails and full user names correspond to
-valid registered Gerrit users. When owner user full name or e-mail cannot be
-resolved, a corresponding WARN message is logged on Gerrit error_log and the
-user entry dropped._
-
-That translates to inheriting owner email address from any parent OWNER files
-and to define 'some.email@example.com' or 'User Name' users as the mandatory
-reviewers for all changes that include modification to those files.
-
-To specify a group of people instead of naming individual owners, prefix the
-group name or UUID with 'group/'.
-
-Additional owners can be specified for files selected by other matching
-conditions (matchers section). Matching can be done by file suffix, regex
-(partial or full) and exact string comparison. For exact match, path is
-relative to the root of the repo.
-
-> **NOTE:** The `generic` matcher is a special type of regex matching that
-> is applied only when none of the other sections are matching. It is
-> used to define fallback rules. The `generic: .*` is the top-level fallback
-> and can be used with other more specific `generic` matchers.
-
-The plugin analyzes the latest patch set by looking at each file directory and
-building an OWNERS hierarchy. It stops once it finds an OWNERS file that has
-“inherited” set to false (by default it’s true.)
-
-For example, imagine the following tree:
-
-```
-/OWNERS
-/example/src/main/OWNERS
-/example/src/main/java/com/example/foo/Foo.java
-/example/src/main/resources/config.properties
-/example/src/test/OWNERS
-/example/src/test/java/com/example/foo/FooTest.java
-```
-
-If you submit a patch set that changes /example/src/main/java/com/example/foo/Foo.java
-then the plugin will first open /example/src/main/OWNERS and if inherited is set
-to true combine it with the owners listed in /OWNERS.
-
-If for each patch there is a reviewer who gave a Code-Review +2 then the plugin
-will not add any labels, otherwise, it will add ```label('Code-Review from owners', need(_)).```
-
-## Global project OWNERS
-
-Set a OWNERS file into the project refs/meta/config to define a global set of
-rules applied to every change pushed, regardless of the folder or target branch.
-
-Example of assigning every configuration files to a specific owner group:
-
-```yaml
-matchers:
-- suffix: .config
-  owners:
-  - Configuration Managers
-```
-
-Global refs/meta/config OWNERS configuration is inherited only when the OWNERS file
-contain the 'inherited: true' condition at the top of the file or if they are absent.
-
-That means that in the absence of any OWNERS file in the target branch, the refs/meta/config
-OWNERS is used as global default.
-
-## Additional non-owners added as reviewers
-
-The OWNERS file can also contain a section called `reviewers` that allows
-to add extra people as reviewers to a change without having to make them
-owners and therefore without having any impact on the underlying validation
-rules.
-
-See for instance the example below, where `john@example.com` is added as an additional
-reviewer in addition to the owners.
-
-```yaml
-inherited: true
-owners:
-- some.email@example.com
-- User Name
-reviewers:
-- john@example.com
-```
-
-The `reviewers` optional section can be added in any place where `owners` is specified
-and can be also associated with matchers exactly in the same way that `owners` do.
-
-## Example 1 - OWNERS file without matchers and default Gerrit submit rules
-
-Given an OWNERS configuration of:
-
-```yaml
-inherited: true
-owners:
-- John Doe
-- Doug Smith
-```
-
-And sample rules.pl that uses this predicate to enable the submit rule if
-one of the owners has given a Code Review +2
-
-```prolog
-submit_rule(S) :-
-  gerrit:default_submit(D),
-  D =.. [submit | Ds],
-  findall(U, gerrit:commit_label(label('Code-Review', 2), U), Approvers),
-  gerrit_owners:add_owner_approval(Approvers, Ds, A),
-  S =.. [submit | A].
-```
-
-Then Gerrit would evaluate the Prolog rule as follows:
-
-It first gets the current default on rule which gives ok() if no Code-Review -2
-and at least a Code-Review +2 is being provided.
-
-Then it accumulates in Approvers the list of users who had given Code-Review +2
-and then checks if this list contains either 'John Doe' or 'Doug Smith'.
-
-If Approvers list does not include one of the owners, then Owner-Approval need()
-is added thus making the change not submittable.
-
-## Example 2 - OWNERS file without matchers and no default Gerrit rules
-
-Given an OWNERS configuration of:
-
-```yaml
-inherited: true
-owners:
-- John Doe
-- Doug Smith
-```
-
-And a rule which makes submittable a change if at least one of the owners has
-given a +1 without taking into consideration any other label:
-
-```prolog
-submit_rule(S) :-
-     Ds = [ label(‘owners_plugin_default’,ok(user(100000))) ],
-     findall(U, gerrit:commit_label(label('Code-Review', 1), U), Approvers),
-     gerrit_owners:add_owner_approval(Approvers, Ds, A),
-     S =.. [submit | A].
-```
-
-Then Gerrit would make the change Submittable only if 'John Doe' or 'Doug Smith'
-have provided at least a Code-Review +1.
-
-## Example 3 - OWNERS file without matchers and custom _Owner-Approves_ label
-
-Sometimes to differentiate the _owners approval_ on a change from the code
-review on the entire project. The scenario could be for instance the sign-off of
-the project's build dependencies based on the Company roles-and-responsibilities
-matrix and governance process.
-
-In this case, we need to grant specific people with the _Owner-Approved_ label
-without necessarily having to give Code-Review +2 rights on the entire project.
-
-Amend the project.config as shown in (1) and add a new label; then give
-permissions to any registered user. Finally, define a small variant of the
-Prolog rules as shown in (2).
-
-(1) Example fo the project config changes with the new label with values
-(label name and values are arbitrary)
-
-```
-[label "Owner-Approved"]
-     function = NoOp
-     defaultValue = 0
-     copyMinScore = true
-     copyAllScoresOnTrivialRebase = true
-     value = -1 I don't want this to be merged
-     value =  0 No score
-     value = +1 Approved
-[access "refs/heads/*"]
-     label-Owner-Approved = -1..+1 group Registered Users
-```
-
-(2) Define the project's rules.pl with an amended version of Example 1:
-
-```prolog
-submit_rule(S) :-
-  gerrit:default_submit(D),
-  D =.. [submit | Ds],
-  findall(U, gerrit:commit_label(label('Owner-Approved', 1), U), Approvers),
-  gerrit_owners:add_owner_approval(Approvers, Ds, A),
-  S =.. [submit | A].
-```
-
-Given now an OWNERS configuration of:
-
-```yaml
-inherited: true
-owners:
-- John Doe
-- Doug Smith
-```
-
-A change cannot be submitted until John Doe or Doug Smith add a label
-"Owner-Approved", independently from being able to provide any Code-Review.
-
-## Example 4 - Owners based on matchers
-
-Often the ownership comes from the developer's skills and competencies and
-cannot be purely defined by the project's directory structure.
-For instance, all the files ending with .sql should be owned and signed-off by
-the DBA while all the ones ending with .css by approved by the UX Team.
-
-Given an OWNERS configuration of:
-
-```yaml
-inherited: true
-matchers:
-- suffix: .sql
-  owners:
-  - Mister Dba
-- suffix: .css
-  owners:
-  - John Creative
-  - Matt Designer
-```
-
-And a rules.pl of:
-
-```prolog
-submit_rule(S) :-
-  gerrit:default_submit(L),
-  L =.. [submit | Sr ],
-  gerrit_owners:add_match_owner_approval(Sr,A),
-  S =.. [submit | A ].
-```
-
-Then for any change that contains files with .sql or .css extensions, besides
-to the default Gerrit submit rules, the extra constraints on the additional
-owners of the modified files will be added. The final submit is enabled if both
-Gerrit default rules are satisfied and all the owners of the .sql files
-(Mister Dba) and the .css files (either John Creative or Matt Designer) have
-provided their Code-Review +2 feedback.
-
-## Example 5 - Owners details on a per-file basis
-
-When using the owners with a series of matchers associated to different set of
-owners, it may not be trivial to understand exactly *why* change is not approved
-yet.
-
-We need to define one extra submit rule to scan the entire list of files in the
-change and their associated owners and cross-check with the existing Code-Review
-feedback received.
-
-Given the same OWNERS and rules.pl configuration of Example 4 with the following
-extra rule:
-
-```prolog
-submit_rule(submit(W)) :-
-  gerrit_owners:findall_match_file_user(W).
-```
-
-For every change that would include any .sql or .css file (e.g. my-update.sql
-and styles.css) Gerrit will display as additional description on the "need" code
-review labels section of the change screen:
-
-```
-Code-Review from owners
-Mister Dba owns my-update.sql
-John Creative, Matt Designer own styles.css
-```
-
-As soon as the owners reviews are provided, the corresponding entry will be
-removed from the "need" section of the change.
-
-In this way, it is always clear which owner needs to provide their feedback on
-which file of the change.
diff --git a/owners-autoassign/src/main/resources/Documentation/setup.md b/owners-autoassign/src/main/resources/Documentation/setup.md
deleted file mode 100644
index b17f851..0000000
--- a/owners-autoassign/src/main/resources/Documentation/setup.md
+++ /dev/null
@@ -1,16 +0,0 @@
-## Setup
-
-The owners-autoassign plugin depends on the shared library `owners-api.jar`
-which needs to be installed into the `$GERRIT_SITE/lib`. You will then need to
-add the following entry to `gerrit.config`:
-
-```
-[gerrit]
-  installModule = com.googlesource.gerrit.owners.api.OwnersApiModule
-```
-
-A restart of the Gerrit service will be required for the lib to be loaded.
-
-Once the `owners-api.jar` is loaded at Gerrit startup, the `owners-autoassign.jar`
-file can be installed like a regular Gerrit plugin, by simply placing the file
-in the `GERRIT_SITE/plugins` directory or installed through the plugin manager.
\ No newline at end of file
diff --git a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/AbstractAutoassignIT.java b/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/AbstractAutoassignIT.java
deleted file mode 100644
index 52fc441..0000000
--- a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/AbstractAutoassignIT.java
+++ /dev/null
@@ -1,426 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.common.truth.Truth.assertThat;
-import static com.googlesource.gerrit.owners.common.AutoassignConfigModule.PROJECT_CONFIG_AUTOASSIGN_FIELD;
-
-import com.google.gerrit.acceptance.LightweightPluginDaemonTest;
-import com.google.gerrit.acceptance.PushOneCommit;
-import com.google.gerrit.acceptance.TestAccount;
-import com.google.gerrit.acceptance.UseLocalDisk;
-import com.google.gerrit.acceptance.config.GlobalPluginConfig;
-import com.google.gerrit.common.RawInputUtil;
-import com.google.gerrit.extensions.api.changes.ChangeApi;
-import com.google.gerrit.extensions.api.changes.ChangeEditApi;
-import com.google.gerrit.extensions.api.changes.ReviewerInput;
-import com.google.gerrit.extensions.client.ReviewerState;
-import com.google.gerrit.extensions.common.AccountInfo;
-import com.google.gerrit.extensions.common.ChangeInfo;
-import com.google.gerrit.extensions.restapi.RestApiException;
-import com.google.gerrit.server.git.meta.MetaDataUpdate;
-import com.google.gerrit.server.project.ProjectConfig;
-import com.google.inject.AbstractModule;
-import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.googlesource.gerrit.owners.api.OwnersApiModule;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
-public abstract class AbstractAutoassignIT extends LightweightPluginDaemonTest {
-  private static final String PLUGIN_NAME = "owners-api";
-
-  private final String section;
-  private final boolean INHERITED = true;
-  private final boolean NOT_INHERITED = false;
-  private final ReviewerState assignedUserState;
-
-  @SuppressWarnings("hiding")
-  @Inject
-  private ProjectConfig.Factory projectConfigFactory;
-
-  private TestAccount user2;
-
-  private TestAccount admin2;
-
-  AbstractAutoassignIT(String section, ReviewerState assignedUserState) {
-    this.section = section;
-    this.assignedUserState = assignedUserState;
-  }
-
-  public static class TestModule extends AbstractModule {
-    @Override
-    protected void configure() {
-      install(new AutoassignModule());
-    }
-  }
-
-  @Override
-  public Module createModule() {
-    return new OwnersApiModule();
-  }
-
-  @Override
-  public void setUpTestPlugin() throws Exception {
-    super.setUpTestPlugin();
-
-    try (MetaDataUpdate md = metaDataUpdateFactory.create(project)) {
-      ProjectConfig projectConfig = projectConfigFactory.create(project);
-      projectConfig.load(md);
-      projectConfig.updatePluginConfig(
-          PLUGIN_NAME,
-          cfg -> cfg.setString(PROJECT_CONFIG_AUTOASSIGN_FIELD, assignedUserState.name()));
-      projectConfig.commit(md);
-      projectCache.evict(project);
-    }
-
-    user2 = accountCreator.user2();
-    admin2 = accountCreator.admin2();
-  }
-
-  @Test
-  public void shouldAutoassignOneOwner() throws Exception {
-    String ownerEmail = user.email();
-
-    pushFactory
-        .create(
-            admin.newIdent(),
-            testRepo,
-            "Set OWNERS",
-            "OWNERS",
-            "inherited: false\n" + "owners:\n" + "- " + ownerEmail)
-        .to("refs/heads/master")
-        .assertOkStatus();
-
-    ChangeApi changeApi = change(createChange());
-    Collection<AccountInfo> reviewers = changeApi.get().reviewers.get(ReviewerState.REVIEWER);
-  }
-
-  @Test
-  public void shouldAutoassignUserInPath() throws Exception {
-    String ownerEmail = user.email();
-
-    addOwnersToRepo("", ownerEmail, NOT_INHERITED);
-
-    Collection<AccountInfo> reviewers = getAutoassignedAccounts(change(createChange()).get());
-
-    assertThat(reviewers).isNotNull();
-    assertThat(reviewers).hasSize(1);
-    assertThat(reviewersEmail(reviewers).get(0)).isEqualTo(ownerEmail);
-  }
-
-  @Test
-  @UseLocalDisk // Required when using @GlobalPluginConfig
-  @GlobalPluginConfig(
-      pluginName = "owners-api",
-      name = "owners.disable.branch",
-      value = "refs/heads/master")
-  public void shouldNotAutoassignUserInPathWhenBranchIsDisabled() throws Exception {
-    addOwnersToRepo("", user.email(), NOT_INHERITED);
-
-    assertThat(getAutoassignedAccounts(change(createChange()).get())).isNull();
-  }
-
-  @Test
-  public void shouldNotReAutoassignUserInPath() throws Exception {
-    String ownerEmail = user.email();
-
-    addOwnersToRepo("", ownerEmail, NOT_INHERITED);
-
-    ChangeApi changeApi = change(createChange());
-    ChangeInfo changeInfo = changeApi.get();
-    Collection<AccountInfo> reviewers = getAutoassignedAccounts(changeInfo);
-    assertThat(reviewers).hasSize(1);
-
-    // Switch user from CC to Reviewer or the other way around
-    ReviewerInput switchReviewerInput = new ReviewerInput();
-    switchReviewerInput.reviewer = ownerEmail;
-    switchReviewerInput.state =
-        assignedUserState == ReviewerState.REVIEWER ? ReviewerState.CC : ReviewerState.REVIEWER;
-    changeApi.addReviewer(switchReviewerInput);
-
-    ChangeEditApi changeEdit = changeApi.edit();
-    changeEdit.create();
-    changeEdit.modifyFile("foo", RawInputUtil.create("foo content"));
-    changeEdit.publish();
-
-    // It should not re-assign any user
-    assertThat(getAutoassignedAccounts(changeInfo)).isNull();
-  }
-
-  @Test
-  public void shouldAutoassignUserInPathWithInheritance() throws Exception {
-    String childOwnersEmail = accountCreator.user2().email();
-    String parentOwnersEmail = user.email();
-    String childpath = "childpath/";
-
-    addOwnersToRepo("", parentOwnersEmail, NOT_INHERITED);
-    addOwnersToRepo(childpath, childOwnersEmail, INHERITED);
-
-    Collection<AccountInfo> reviewers =
-        getAutoassignedAccounts(
-            change(createChange("test change", childpath + "foo.txt", "foo")).get());
-
-    assertThat(reviewers).isNotNull();
-    assertThat(reviewersEmail(reviewers)).containsExactly(parentOwnersEmail, childOwnersEmail);
-  }
-
-  @Test
-  public void shouldAutoassignUserInPathWithoutInheritance() throws Exception {
-    String childOwnersEmail = accountCreator.user2().email();
-    String parentOwnersEmail = user.email();
-    String childpath = "childpath/";
-
-    addOwnersToRepo("", parentOwnersEmail, NOT_INHERITED);
-    addOwnersToRepo(childpath, childOwnersEmail, NOT_INHERITED);
-
-    Collection<AccountInfo> reviewers =
-        getAutoassignedAccounts(
-            change(createChange("test change", childpath + "foo.txt", "foo")).get());
-
-    assertThat(reviewers).isNotNull();
-    assertThat(reviewersEmail(reviewers)).containsExactly(childOwnersEmail);
-  }
-
-  @Test
-  public void shouldAutoassignUserMatchingPath() throws Exception {
-    String ownerEmail = user.email();
-
-    addOwnersToRepo("", NOT_INHERITED, "suffix", ".java", ownerEmail);
-
-    Collection<AccountInfo> reviewers =
-        getAutoassignedAccounts(change(createChange("test change", "foo.java", "foo")).get());
-
-    assertThat(reviewers).isNotNull();
-    assertThat(reviewersEmail(reviewers)).containsExactly(ownerEmail);
-  }
-
-  @Test
-  public void shouldNotAutoassignUserNotMatchingPath() throws Exception {
-    String ownerEmail = user.email();
-
-    addOwnersToRepo("", NOT_INHERITED, "suffix", ".java", ownerEmail);
-
-    ChangeApi changeApi = change(createChange("test change", "foo.bar", "foo"));
-    Collection<AccountInfo> reviewers = getAutoassignedAccounts(changeApi.get());
-
-    assertThat(reviewers).isNull();
-  }
-
-  @Test
-  public void shouldAutoassignUserWithGenericTopLevelFallback() throws Exception {
-    String ownerEmail = user.email();
-    String owner2Email = user2.email();
-    String admin2Email = admin2.email();
-
-    addOwnersToRepo(
-        "",
-        NOT_INHERITED,
-        "suffix",
-        ".java",
-        ownerEmail,
-        "generic",
-        ".*\\.c",
-        admin2Email,
-        "generic",
-        ".*",
-        owner2Email);
-
-    ChangeApi changeApi =
-        change(createChangeWithFiles("test change", "foo.bar", "foo", "foo.java", "Java code"));
-    Collection<AccountInfo> reviewers = getAutoassignedAccounts(changeApi.get());
-
-    assertThat(reviewers).isNotNull();
-    assertThat(reviewersEmail(reviewers)).containsExactly(ownerEmail, owner2Email);
-  }
-
-  @Test
-  public void shouldAutoassignUserWithGenericMidLevelFallback() throws Exception {
-    String ownerEmail = user.email();
-    String owner2Email = user2.email();
-    String admin2Email = admin2.email();
-
-    addOwnersToRepo(
-        "",
-        NOT_INHERITED,
-        "suffix",
-        ".java",
-        ownerEmail,
-        "generic",
-        ".*\\.c",
-        admin2Email,
-        "generic",
-        ".*",
-        owner2Email);
-
-    ChangeApi changeApi =
-        change(createChangeWithFiles("test change", "foo.c", "foo", "foo.java", "Java code"));
-    Collection<AccountInfo> reviewers = getAutoassignedAccounts(changeApi.get());
-
-    assertThat(reviewers).isNotNull();
-    assertThat(reviewersEmail(reviewers)).containsExactly(ownerEmail, admin2Email);
-  }
-
-  @Test
-  public void shouldNotAutoassignUserWithNonMatchingGenericFallback() throws Exception {
-    String ownerEmail = user.email();
-    String owner2Email = user2.email();
-
-    addOwnersToRepo(
-        "", NOT_INHERITED, "suffix", ".java", ownerEmail, "generic", "\\.c", owner2Email);
-
-    ChangeApi changeApi =
-        change(createChangeWithFiles("test change", "foo.bar", "foo", "foo.groovy", "Groovy code"));
-    Collection<AccountInfo> reviewers = getAutoassignedAccounts(changeApi.get());
-
-    assertThat(reviewers).isNull();
-  }
-
-  @Test
-  public void shouldAutoassignUserWithMultipleGenericFallback() throws Exception {
-    String admin2Email = admin2.email();
-    String ownerEmail = user.email();
-    String owner2Email = user2.email();
-
-    addOwnersToRepo(
-        "",
-        NOT_INHERITED,
-        "suffix",
-        ".java",
-        admin2Email,
-        "generic",
-        ".*\\.c",
-        ownerEmail,
-        "generic",
-        ".*",
-        owner2Email);
-
-    ChangeApi changeApi =
-        change(createChangeWithFiles("test change", "foo.bar", "foo", "foo.c", "C code"));
-    Collection<AccountInfo> reviewers = getAutoassignedAccounts(changeApi.get());
-
-    assertThat(reviewers).isNotNull();
-    assertThat(reviewersEmail(reviewers)).containsExactly(ownerEmail, owner2Email);
-  }
-
-  @Test
-  public void shouldAutoassignUserMatchingPathWithInheritance() throws Exception {
-    String childOwnersEmail = accountCreator.user2().email();
-    String parentOwnersEmail = user.email();
-    String childpath = "childpath/";
-
-    addOwnersToRepo("", NOT_INHERITED, "suffix", ".java", parentOwnersEmail);
-    addOwnersToRepo(childpath, INHERITED, "suffix", ".java", childOwnersEmail);
-
-    ChangeApi changeApi = change(createChange("test change", childpath + "foo.java", "foo"));
-    Collection<AccountInfo> reviewers = getAutoassignedAccounts(changeApi.get());
-
-    assertThat(reviewers).isNotNull();
-    assertThat(reviewersEmail(reviewers)).containsExactly(parentOwnersEmail, childOwnersEmail);
-  }
-
-  @Test
-  public void shouldAutoassignUserMatchingPathWithoutInheritance() throws Exception {
-    String childOwnersEmail = accountCreator.user2().email();
-    String parentOwnersEmail = user.email();
-    String childpath = "childpath/";
-
-    addOwnersToRepo("", parentOwnersEmail, NOT_INHERITED);
-    addOwnersToRepo(childpath, NOT_INHERITED, "suffix", ".java", childOwnersEmail);
-
-    ChangeApi changeApi = change(createChange("test change", childpath + "foo.java", "foo"));
-    Collection<AccountInfo> reviewers = getAutoassignedAccounts(changeApi.get());
-
-    assertThat(reviewers).isNotNull();
-    assertThat(reviewersEmail(reviewers)).containsExactly(childOwnersEmail);
-  }
-
-  protected PushOneCommit.Result createChangeWithFiles(String subject, String... filesWithContent)
-      throws Exception {
-    Map<String, String> files = new HashMap<>();
-    for (int i = 0; i < filesWithContent.length; ) {
-      String fileName = filesWithContent[i++];
-      String fileContent = filesWithContent[i++];
-      files.put(fileName, fileContent);
-    }
-    PushOneCommit push = pushFactory.create(admin.newIdent(), testRepo, subject, files);
-    return push.to("refs/for/master");
-  }
-
-  private Collection<AccountInfo> getAutoassignedAccounts(ChangeInfo changeInfo)
-      throws RestApiException {
-    Collection<AccountInfo> reviewers =
-        gApi.changes().id(changeInfo._number).get().reviewers.get(assignedUserState);
-    return reviewers;
-  }
-
-  private List<String> reviewersEmail(Collection<AccountInfo> reviewers) {
-    List<String> reviewersEmail = reviewers.stream().map(a -> a.email).collect(Collectors.toList());
-    return reviewersEmail;
-  }
-
-  private void addOwnersToRepo(String parentPath, String ownerEmail, boolean inherited)
-      throws Exception {
-    pushFactory
-        .create(
-            admin.newIdent(),
-            testRepo,
-            "Set OWNERS",
-            parentPath + "OWNERS",
-            "inherited: " + inherited + "\n" + section + ":\n" + "- " + ownerEmail)
-        .to("refs/heads/master")
-        .assertOkStatus();
-  }
-
-  private void addOwnersToRepo(String parentPath, boolean inherited, String... matchingRules)
-      throws Exception {
-    StringBuilder ownersStringBuilder =
-        new StringBuilder("inherited: " + inherited + "\n" + "matchers:\n");
-    for (int i = 0; i < matchingRules.length; ) {
-      String matchingType = matchingRules[i++];
-      String patternMatch = matchingRules[i++];
-      String ownerEmail = matchingRules[i++];
-
-      ownersStringBuilder
-          .append("- ")
-          .append(matchingType)
-          .append(": ")
-          .append(patternMatch)
-          .append("\n")
-          .append("  ")
-          .append(section)
-          .append(":\n")
-          .append("  - ")
-          .append(ownerEmail)
-          .append("\n");
-    }
-    pushFactory
-        .create(
-            admin.newIdent(),
-            testRepo,
-            "Set OWNERS",
-            parentPath + "OWNERS",
-            ownersStringBuilder.toString())
-        .to("refs/heads/master")
-        .assertOkStatus();
-  }
-}
diff --git a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/GitRefListenerIT.java b/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/GitRefListenerIT.java
deleted file mode 100644
index cb34173..0000000
--- a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/GitRefListenerIT.java
+++ /dev/null
@@ -1,219 +0,0 @@
-// Copyright (C) 2019 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.googlesource.gerrit.owners.common.AutoassignConfigModule.PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES;
-import static org.junit.Assert.assertEquals;
-
-import com.google.gerrit.acceptance.LightweightPluginDaemonTest;
-import com.google.gerrit.acceptance.RestResponse;
-import com.google.gerrit.acceptance.TestPlugin;
-import com.google.gerrit.entities.Project;
-import com.google.gerrit.extensions.api.changes.ReviewInput;
-import com.google.gerrit.extensions.api.projects.ConfigInput;
-import com.google.gerrit.extensions.api.projects.ConfigValue;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import com.google.gerrit.extensions.events.GitReferenceUpdatedListener;
-import com.google.gerrit.extensions.registration.DynamicSet;
-import com.google.gerrit.extensions.registration.Extension;
-import com.google.gerrit.extensions.restapi.RestApiException;
-import com.google.gerrit.server.AnonymousUser;
-import com.google.gerrit.server.util.ManualRequestContext;
-import com.google.gerrit.server.util.ThreadLocalRequestContext;
-import com.google.inject.AbstractModule;
-import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.googlesource.gerrit.owners.api.OwnersApiModule;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.stream.StreamSupport;
-import org.eclipse.jgit.transport.ReceiveCommand.Type;
-import org.junit.Test;
-
-@TestPlugin(
-    name = "owners-autoassign",
-    sysModule = "com.googlesource.gerrit.owners.common.GitRefListenerIT$TestModule")
-public class GitRefListenerIT extends LightweightPluginDaemonTest {
-  private static final String PLUGIN_NAME = "owners-autoassign";
-
-  @Inject DynamicSet<GitReferenceUpdatedListener> allRefUpdateListeners;
-  @Inject ThreadLocalRequestContext requestContext;
-
-  String anOldObjectId = "anOldRef";
-  String aNewObjectId = "aNewRef";
-
-  @Override
-  public Module createModule() {
-    return new OwnersApiModule();
-  }
-
-  public static class TestModule extends AbstractModule {
-    @Override
-    protected void configure() {
-      install(PathOwnersEntriesCache.module());
-      DynamicSet.bind(binder(), GitReferenceUpdatedListener.class).to(GitRefListenerTest.class);
-      install(new AutoassignConfigModule());
-    }
-  }
-
-  @Test
-  public void shouldNotProcessNoteDbOnlyRefs() throws Exception {
-    int changeNum = createChange().getChange().getId().get();
-    int baselineProcessedEvents = gitRefListener().getProcessedEvents();
-
-    gApi.changes().id(changeNum).current().review(new ReviewInput().message("Foo comment"));
-    assertEquals(baselineProcessedEvents, gitRefListener().getProcessedEvents());
-  }
-
-  @Test
-  public void shoulProcessSetReadyForReviewOnNoteDb() throws Exception {
-    int wipChangeNum = createChange().getChange().getId().get();
-    gApi.changes().id(wipChangeNum).setWorkInProgress();
-
-    int baselineProcessedEvents = gitRefListener().getProcessedEvents();
-
-    gApi.changes().id(wipChangeNum).setReadyForReview();
-    assertEquals(1, gitRefListener().getProcessedEvents() - baselineProcessedEvents);
-  }
-
-  @Test
-  public void shouldProcessSendAndStartReviewOnNoteDb() throws Exception {
-    int wipChangeNum = createChange().getChange().getId().get();
-    gApi.changes().id(wipChangeNum).setWorkInProgress();
-
-    int baselineProcessedEvents = gitRefListener().getProcessedEvents();
-
-    ReviewInput input = new ReviewInput().message("Let's start the review");
-    input.setWorkInProgress(false);
-
-    RestResponse resp =
-        adminRestSession.post("/changes/" + wipChangeNum + "/revisions/1/review", input);
-    resp.assertOK();
-
-    assertEquals(1, gitRefListener().getProcessedEvents() - baselineProcessedEvents);
-  }
-
-  @Test
-  public void shouldProcessWipChangesByDefault() throws Exception {
-    int baselineProcessedEvents = gitRefListener().getProcessedEvents();
-
-    createChange("refs/for/master%wip");
-
-    assertEquals(1, gitRefListener().getProcessedEvents() - baselineProcessedEvents);
-  }
-
-  @Test
-  public void shouldNotProcessWipChanges() throws Exception {
-    setProjectPluginConfig(
-        project, PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES, InheritableBoolean.FALSE.name());
-    int baselineProcessedEvents = gitRefListener().getProcessedEvents();
-
-    createChange("refs/for/master%wip");
-
-    assertEquals(baselineProcessedEvents, gitRefListener().getProcessedEvents());
-  }
-
-  @Test
-  public void shouldNotProcessWipChangesWhenAutoAssignWipChangesIsInherited() throws Exception {
-    setProjectPluginConfig(
-        allProjects, PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES, InheritableBoolean.FALSE.name());
-    setProjectPluginConfig(
-        project, PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES, InheritableBoolean.INHERIT.name());
-    int baselineProcessedEvents = gitRefListener().getProcessedEvents();
-
-    createChange("refs/for/master%wip");
-
-    assertEquals(baselineProcessedEvents, gitRefListener().getProcessedEvents());
-  }
-
-  @Test
-  public void shouldProcessWipChangesWhenAutoAssignWipChangesIsOverridden() throws Exception {
-    setProjectPluginConfig(
-        allProjects, PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES, InheritableBoolean.FALSE.name());
-    setProjectPluginConfig(
-        project, PROJECT_CONFIG_AUTOASSIGN_WIP_CHANGES, InheritableBoolean.TRUE.name());
-    int baselineProcessedEvents = gitRefListener().getProcessedEvents();
-
-    createChange("refs/for/master%wip");
-
-    assertEquals(1, gitRefListener().getProcessedEvents() - baselineProcessedEvents);
-  }
-
-  @Test
-  public void shoulNotProcessEmptyMetaRefUpdatesAfterSetReadyForReviewOnNoteDb() throws Exception {
-    int wipChangeNum = createChange().getChange().getId().get();
-    gApi.changes().id(wipChangeNum).setWorkInProgress();
-    gApi.changes().id(wipChangeNum).setReadyForReview();
-    int baselineProcessedEvents = gitRefListener().getProcessedEvents();
-
-    gApi.changes().id(wipChangeNum).addReviewer("user");
-    assertEquals(baselineProcessedEvents, gitRefListener().getProcessedEvents());
-  }
-
-  @Test
-  public void shouldProcessRefChanges() throws Exception {
-    gitRefListener().onGitReferenceUpdated(newRefUpdateEvent());
-    assertEquals(1, gitRefListener().getProcessedEvents());
-  }
-
-  @Test
-  public void shouldRetrieveChangeFromAnonymousContext() throws Exception {
-    try (ManualRequestContext ctx = new ManualRequestContext(new AnonymousUser(), requestContext)) {
-      gitRefListener().onGitReferenceUpdated(newRefUpdateEvent());
-      assertEquals(1, gitRefListener().getProcessedEvents());
-    }
-  }
-
-  @Test
-  public void shouldRetrieveChangeFromAnonymousContextWithoutAccountId() throws Exception {
-    String refPrefix = createChange().getChange().getId().toRefPrefix();
-    ReferenceUpdatedEventTest refUpdateWithoutAccountId =
-        new ReferenceUpdatedEventTest(
-            project, refPrefix, anOldObjectId, aNewObjectId, Type.CREATE, null);
-    try (ManualRequestContext ctx = new ManualRequestContext(new AnonymousUser(), requestContext)) {
-      gitRefListener().onGitReferenceUpdated(refUpdateWithoutAccountId);
-      assertEquals(1, gitRefListener().getProcessedEvents());
-    }
-  }
-
-  private void setProjectPluginConfig(Project.NameKey projectName, String configKey, String value)
-      throws RestApiException {
-    ConfigInput projectConfig = new ConfigInput();
-    Map<String, ConfigValue> ownerAutoassignConfig = new HashMap<>();
-    ConfigValue configValue = new ConfigValue();
-    configValue.value = value;
-    ownerAutoassignConfig.put(configKey, configValue);
-    projectConfig.pluginConfigValues = new HashMap<>();
-    projectConfig.pluginConfigValues.put(PLUGIN_NAME, ownerAutoassignConfig);
-
-    gApi.projects().name(projectName.get()).config(projectConfig);
-  }
-
-  private GitRefListenerTest gitRefListener() {
-    return (GitRefListenerTest)
-        StreamSupport.stream(allRefUpdateListeners.entries().spliterator(), false)
-            .map(Extension::get)
-            .filter(listener -> GitRefListenerTest.class.isAssignableFrom(listener.getClass()))
-            .findFirst()
-            .get();
-  }
-
-  private ReferenceUpdatedEventTest newRefUpdateEvent() throws Exception {
-    String refPrefix = createChange().getChange().getId().toRefPrefix();
-    return new ReferenceUpdatedEventTest(
-        project, refPrefix, anOldObjectId, aNewObjectId, Type.CREATE, admin.id());
-  }
-}
diff --git a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/GitRefListenerTest.java b/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/GitRefListenerTest.java
deleted file mode 100644
index 846f583..0000000
--- a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/GitRefListenerTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (C) 2019 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Change;
-import com.google.gerrit.entities.Project;
-import com.google.gerrit.extensions.api.GerritApi;
-import com.google.gerrit.server.CurrentUser;
-import com.google.gerrit.server.git.GitRepositoryManager;
-import com.google.gerrit.server.notedb.ChangeNotes;
-import com.google.gerrit.server.patch.PatchListCache;
-import com.google.gerrit.server.project.ProjectCache;
-import com.google.gerrit.server.util.OneOffRequestContext;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-import org.eclipse.jgit.lib.Repository;
-import org.junit.Ignore;
-
-@Ignore
-@Singleton
-public class GitRefListenerTest extends GitRefListener {
-  int processedEvents = 0;
-
-  @Inject
-  public GitRefListenerTest(
-      GerritApi api,
-      PatchListCache patchListCache,
-      ProjectCache projectCache,
-      GitRepositoryManager repositoryManager,
-      Accounts accounts,
-      SyncReviewerManager reviewerManager,
-      OneOffRequestContext oneOffReqCtx,
-      Provider<CurrentUser> currentUserProvider,
-      ChangeNotes.Factory notesFactory,
-      AutoAssignConfig cfg,
-      PathOwnersEntriesCache cache,
-      PluginSettings pluginSettings) {
-    super(
-        api,
-        patchListCache,
-        projectCache,
-        repositoryManager,
-        accounts,
-        reviewerManager,
-        oneOffReqCtx,
-        currentUserProvider,
-        notesFactory,
-        cfg,
-        cache,
-        pluginSettings);
-  }
-
-  @Override
-  public void processEvent(
-      Project.NameKey projectKey, Repository repository, Event event, Change.Id cId) {
-    processedEvents++;
-  }
-
-  int getProcessedEvents() {
-    return processedEvents;
-  }
-}
diff --git a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/OwnersAutoassignAsCcIT.java b/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/OwnersAutoassignAsCcIT.java
deleted file mode 100644
index ff71c87..0000000
--- a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/OwnersAutoassignAsCcIT.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.acceptance.TestPlugin;
-import com.google.gerrit.extensions.client.ReviewerState;
-
-@TestPlugin(
-    name = "owners-api",
-    sysModule = "com.googlesource.gerrit.owners.common.AbstractAutoassignIT$TestModule")
-public class OwnersAutoassignAsCcIT extends AbstractAutoassignIT {
-
-  public OwnersAutoassignAsCcIT() {
-    super("owners", ReviewerState.CC);
-  }
-}
diff --git a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/OwnersAutoassignAsReviewerIT.java b/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/OwnersAutoassignAsReviewerIT.java
deleted file mode 100644
index 06db78d..0000000
--- a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/OwnersAutoassignAsReviewerIT.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.acceptance.TestPlugin;
-import com.google.gerrit.extensions.client.ReviewerState;
-
-@TestPlugin(
-    name = "owners-api",
-    sysModule = "com.googlesource.gerrit.owners.common.AbstractAutoassignIT$TestModule")
-public class OwnersAutoassignAsReviewerIT extends AbstractAutoassignIT {
-
-  public OwnersAutoassignAsReviewerIT() {
-    super("owners", ReviewerState.REVIEWER);
-  }
-}
diff --git a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/OwnersAutoassignWithAttentionSetIT.java b/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/OwnersAutoassignWithAttentionSetIT.java
deleted file mode 100644
index 1cfcf04..0000000
--- a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/OwnersAutoassignWithAttentionSetIT.java
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.common.truth.Truth.assertThat;
-import static com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.block;
-import static java.util.stream.Collectors.toList;
-
-import com.google.gerrit.acceptance.LightweightPluginDaemonTest;
-import com.google.gerrit.acceptance.TestAccount;
-import com.google.gerrit.acceptance.TestPlugin;
-import com.google.gerrit.acceptance.testsuite.project.ProjectOperations;
-import com.google.gerrit.entities.AccessSection;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.entities.AccountGroup;
-import com.google.gerrit.entities.Permission;
-import com.google.gerrit.extensions.api.groups.GroupInput;
-import com.google.gerrit.extensions.client.ReviewerState;
-import com.google.gerrit.extensions.common.ChangeInfo;
-import com.google.gerrit.extensions.restapi.RestApiException;
-import com.google.inject.AbstractModule;
-import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.googlesource.gerrit.owners.api.OwnersApiModule;
-import com.googlesource.gerrit.owners.api.OwnersAttentionSet;
-import java.util.Collection;
-import java.util.Collections;
-import org.junit.Test;
-
-@TestPlugin(
-    name = "owners-autoassign",
-    sysModule =
-        "com.googlesource.gerrit.owners.common.OwnersAutoassignWithAttentionSetIT$TestModule")
-public class OwnersAutoassignWithAttentionSetIT extends LightweightPluginDaemonTest {
-
-  @Inject private ProjectOperations projectOperations;
-
-  @Override
-  public Module createModule() {
-    return new OwnersApiModule();
-  }
-
-  public static class TestModule extends AbstractModule {
-    @Override
-    protected void configure() {
-      install(new AutoassignModule(SelectFirstOwnerForAttentionSet.class, new AutoAssignConfig()));
-    }
-  }
-
-  public static class SelectFirstOwnerForAttentionSet implements OwnersAttentionSet {
-
-    @Override
-    public Collection<Id> addToAttentionSet(ChangeInfo changeInfo, Collection<Id> owners) {
-      return owners.stream().limit(1).collect(toList());
-    }
-  }
-
-  @Test
-  public void shouldAutoassignTwoOwnersWithOneAttentionSet() throws Exception {
-    String ownerEmail1 = user.email();
-    String ownerEmail2 = accountCreator.user2().email();
-
-    setOwners(ownerEmail1, ownerEmail2);
-
-    ChangeInfo change = change(createChange()).get();
-    assertThat(change.reviewers.get(ReviewerState.REVIEWER)).hasSize(2);
-    assertThat(change.attentionSet).hasSize(1);
-  }
-
-  @Test
-  public void shouldAddToAttentionSetOneUserIfAnotherUserHasNoPermission() throws Exception {
-    TestAccount userWithAccessToProject = accountCreator.user1();
-    TestAccount userWithNoAccessToProject = accountCreator.user2();
-
-    AccountGroup.UUID groupWithNoAccessToProject =
-        createGroup("groupWithNoAccessToProject", userWithNoAccessToProject);
-
-    setOwners(userWithAccessToProject.email(), userWithNoAccessToProject.email());
-
-    projectOperations
-        .project(project)
-        .forUpdate()
-        .add(block(Permission.READ).ref(AccessSection.ALL).group(groupWithNoAccessToProject))
-        .update();
-
-    ChangeInfo change = change(createChange()).get();
-    assertThat(change.attentionSet).isNotNull();
-    assertThat(change.attentionSet.keySet()).containsExactly(userWithAccessToProject.id().get());
-  }
-
-  private void setOwners(String ownerEmail1, String ownerEmail2) throws Exception {
-    pushFactory
-        .create(
-            admin.newIdent(),
-            testRepo,
-            "Set OWNERS",
-            "OWNERS",
-            "inherited: false\n"
-                + "owners:\n"
-                + "- "
-                + ownerEmail1
-                + "\n"
-                + "- "
-                + ownerEmail2
-                + "\n")
-        .to("refs/heads/master")
-        .assertOkStatus();
-  }
-
-  private AccountGroup.UUID createGroup(String name, TestAccount member) throws RestApiException {
-    GroupInput groupInput = new GroupInput();
-    groupInput.name = name(name);
-    groupInput.members = Collections.singletonList(String.valueOf(member.id().get()));
-    return AccountGroup.uuid(gApi.groups().create(groupInput).get().id);
-  }
-}
diff --git a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/ReferenceUpdatedEventTest.java b/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/ReferenceUpdatedEventTest.java
deleted file mode 100644
index 61a485f..0000000
--- a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/ReferenceUpdatedEventTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (C) 2019 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Project;
-import com.google.gerrit.extensions.api.changes.NotifyHandling;
-import com.google.gerrit.extensions.common.AccountInfo;
-import com.google.gerrit.extensions.events.GitReferenceUpdatedListener;
-import org.eclipse.jgit.transport.ReceiveCommand;
-import org.junit.Ignore;
-
-@Ignore
-public class ReferenceUpdatedEventTest implements GitReferenceUpdatedListener.Event {
-
-  private final String projectName;
-  private final String ref;
-  private final String oldObjectId;
-  private final String newObjectId;
-  private final ReceiveCommand.Type type;
-  private final Account.Id eventAccountId;
-
-  public ReferenceUpdatedEventTest(
-      Project.NameKey project,
-      String ref,
-      String oldObjectId,
-      String newObjectId,
-      ReceiveCommand.Type type,
-      Account.Id eventAccountId) {
-    this.projectName = project.get();
-    this.ref = ref;
-    this.oldObjectId = oldObjectId;
-    this.newObjectId = newObjectId;
-    this.type = type;
-    this.eventAccountId = eventAccountId;
-  }
-
-  @Override
-  public String getProjectName() {
-    return projectName;
-  }
-
-  @Override
-  public String getRefName() {
-    return ref;
-  }
-
-  @Override
-  public String getOldObjectId() {
-    return oldObjectId;
-  }
-
-  @Override
-  public String getNewObjectId() {
-    return newObjectId;
-  }
-
-  @Override
-  public boolean isCreate() {
-    return type == ReceiveCommand.Type.CREATE;
-  }
-
-  @Override
-  public boolean isDelete() {
-    return type == ReceiveCommand.Type.DELETE;
-  }
-
-  @Override
-  public boolean isNonFastForward() {
-    return type == ReceiveCommand.Type.UPDATE_NONFASTFORWARD;
-  }
-
-  @Override
-  public AccountInfo getUpdater() {
-    if (eventAccountId == null) {
-      return null;
-    }
-
-    return new AccountInfo(eventAccountId.get());
-  }
-
-  @Override
-  public NotifyHandling getNotify() {
-    return NotifyHandling.NONE;
-  }
-}
diff --git a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/ReviewersAutoassignAsCcIT.java b/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/ReviewersAutoassignAsCcIT.java
deleted file mode 100644
index ce9cc02..0000000
--- a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/ReviewersAutoassignAsCcIT.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.acceptance.TestPlugin;
-import com.google.gerrit.extensions.client.ReviewerState;
-
-@TestPlugin(
-    name = "owners-api",
-    sysModule = "com.googlesource.gerrit.owners.common.AbstractAutoassignIT$TestModule")
-public class ReviewersAutoassignAsCcIT extends AbstractAutoassignIT {
-
-  public ReviewersAutoassignAsCcIT() {
-    super("reviewers", ReviewerState.CC);
-  }
-}
diff --git a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/ReviewersAutoassignAsReviewerIT.java b/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/ReviewersAutoassignAsReviewerIT.java
deleted file mode 100644
index 8e2e45b..0000000
--- a/owners-autoassign/src/test/java/com/googlesource/gerrit/owners/common/ReviewersAutoassignAsReviewerIT.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) 2021 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.acceptance.TestPlugin;
-import com.google.gerrit.extensions.client.ReviewerState;
-
-@TestPlugin(
-    name = "owners-api",
-    sysModule = "com.googlesource.gerrit.owners.common.AbstractAutoassignIT$TestModule")
-public class ReviewersAutoassignAsReviewerIT extends AbstractAutoassignIT {
-
-  public ReviewersAutoassignAsReviewerIT() {
-    super("reviewers", ReviewerState.REVIEWER);
-  }
-}
diff --git a/owners-common/BUILD b/owners-common/BUILD
deleted file mode 100644
index faf2d08..0000000
--- a/owners-common/BUILD
+++ /dev/null
@@ -1,26 +0,0 @@
-load("//tools/bzl:junit.bzl", "junit_tests")
-load("//tools/bzl:plugin.bzl", "PLUGIN_DEPS", "PLUGIN_DEPS_NEVERLINK", "PLUGIN_TEST_DEPS", "gerrit_plugin")
-load("//owners-common:common.bzl", "EXTERNAL_DEPS", "EXTERNAL_TEST_DEPS")
-
-java_library(
-    name = "owners-common",
-    srcs = glob([
-        "src/main/java/**/*.java",
-    ]),
-    visibility = ["//visibility:public"],
-    deps = PLUGIN_DEPS_NEVERLINK + EXTERNAL_DEPS,
-)
-
-junit_tests(
-    name = "test",
-    testonly = 1,
-    srcs = glob(["src/test/java/**/*.java"]),
-    jvm_flags = [
-        "--add-opens=java.base/java.lang=ALL-UNNAMED",
-        "--add-opens=java.base/java.util=ALL-UNNAMED",
-        "--add-opens=java.base/java.util.stream=ALL-UNNAMED",
-    ],
-    deps = EXTERNAL_TEST_DEPS + PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
-        ":owners-common",
-    ],
-)
diff --git a/owners-common/common.bzl b/owners-common/common.bzl
deleted file mode 100644
index d2ce9f5..0000000
--- a/owners-common/common.bzl
+++ /dev/null
@@ -1,18 +0,0 @@
-EXTERNAL_DEPS = [
-    "@jackson-core//jar",
-    "@jackson-databind//jar",
-    "@jackson-annotations//jar",
-    "@jackson-dataformat-yaml//jar",
-    "@snakeyaml//jar",
-]
-
-EXTERNAL_TEST_DEPS = [
-    "@easymock//jar",
-    "@powermock-module-junit4//jar",
-    "@powermock-module-junit4-common//jar",
-    "@powermock-reflect//jar",
-    "@powermock-api-easymock//jar",
-    "@powermock-api-support//jar",
-    "@powermock-core//jar",
-    "@javassist//jar",
-]
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/Accounts.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/Accounts.java
deleted file mode 100644
index 9a27d36..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/Accounts.java
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import com.google.inject.ImplementedBy;
-import java.util.Set;
-
-@ImplementedBy(AccountsImpl.class)
-public interface Accounts {
-  public String GROUP_PREFIX = "group/";
-
-  Set<Account.Id> find(String nameOrEmail);
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/AccountsImpl.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/AccountsImpl.java
deleted file mode 100644
index 07c3dad..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/AccountsImpl.java
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.gerrit.server.account.externalids.ExternalId.SCHEME_GERRIT;
-import static com.google.gerrit.server.account.externalids.ExternalId.SCHEME_MAILTO;
-import static com.google.gerrit.server.account.externalids.ExternalId.SCHEME_USERNAME;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.entities.AccountGroup;
-import com.google.gerrit.entities.InternalGroup;
-import com.google.gerrit.server.IdentifiedUser;
-import com.google.gerrit.server.account.AccountCache;
-import com.google.gerrit.server.account.AccountResolver;
-import com.google.gerrit.server.account.AccountState;
-import com.google.gerrit.server.account.GroupCache;
-import com.google.gerrit.server.account.GroupMembers;
-import com.google.gerrit.server.account.externalids.ExternalId;
-import com.google.gerrit.server.project.NoSuchProjectException;
-import com.google.gerrit.server.util.ManualRequestContext;
-import com.google.gerrit.server.util.OneOffRequestContext;
-import com.google.inject.Inject;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-import org.eclipse.jgit.errors.ConfigInvalidException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AccountsImpl implements Accounts {
-  private static final Logger log = LoggerFactory.getLogger(AccountsImpl.class);
-
-  private final AccountResolver resolver;
-  private final AccountCache byId;
-  private final GroupCache groupCache;
-  private final GroupMembers groupMembers;
-  private final IdentifiedUser adminUser;
-  private final OneOffRequestContext oneOffRequestContext;
-
-  @Inject
-  public AccountsImpl(
-      AccountResolver resolver,
-      AccountCache byId,
-      GroupCache groupCache,
-      GroupMembers groupMembers,
-      OneOffRequestContext oneOffRequestContext,
-      IdentifiedUser.GenericFactory userFactory) {
-    this.resolver = resolver;
-    this.byId = byId;
-    this.groupCache = groupCache;
-    this.groupMembers = groupMembers;
-    this.adminUser = userFactory.create(Account.id(1000000));
-    this.oneOffRequestContext = oneOffRequestContext;
-  }
-
-  @Override
-  public Set<Account.Id> find(String nameOrEmailOrGroup) {
-    if (nameOrEmailOrGroup.startsWith(GROUP_PREFIX)) {
-      return findAccountsInGroup(nameOrEmailOrGroup.substring(GROUP_PREFIX.length()));
-    }
-    return findUserOrEmail(nameOrEmailOrGroup);
-  }
-
-  private Set<Id> findAccountsInGroup(String groupNameOrUUID) {
-    Optional<InternalGroup> group =
-        groupCache
-            .get(AccountGroup.nameKey(groupNameOrUUID))
-            .map(Optional::of)
-            .orElse(groupCache.get(AccountGroup.uuid(groupNameOrUUID)));
-
-    if (!group.isPresent()) {
-      log.warn("Group {} was not found", groupNameOrUUID);
-      return Collections.emptySet();
-    }
-
-    try (ManualRequestContext ctx = oneOffRequestContext.openAs(adminUser.getAccountId())) {
-
-      return groupMembers.listAccounts(group.get().getGroupUUID(), null).stream()
-          .map(Account::id)
-          .collect(Collectors.toSet());
-    } catch (NoSuchProjectException | IOException e) {
-      log.error("Unable to list accounts in group " + group, e);
-      return Collections.emptySet();
-    }
-  }
-
-  private Set<Account.Id> findUserOrEmail(String nameOrEmail) {
-    try (ManualRequestContext ctx = oneOffRequestContext.open()) {
-      Set<Id> accountIds = resolver.resolve(nameOrEmail).asIdSet();
-      if (accountIds.isEmpty()) {
-        log.warn("User '{}' does not resolve to any account.", nameOrEmail);
-        return accountIds;
-      }
-
-      Set<Id> activeAccountIds =
-          accountIds.stream().filter(this::isActive).collect(Collectors.toSet());
-      if (activeAccountIds.isEmpty()) {
-        log.warn(
-            "User '{}' resolves to {} accounts {}, but none of them are active",
-            nameOrEmail,
-            accountIds.size(),
-            accountIds);
-        return activeAccountIds;
-      }
-
-      Set<Id> fulllyMatchedAccountIds =
-          activeAccountIds.stream()
-              .filter(id -> isFullMatch(id, nameOrEmail))
-              .collect(Collectors.toSet());
-      if (fulllyMatchedAccountIds.isEmpty()) {
-        log.warn(
-            "User '{}' resolves to {} accounts {}, but does not correspond to any them",
-            nameOrEmail,
-            accountIds.size(),
-            accountIds);
-        return fulllyMatchedAccountIds;
-      }
-
-      return accountIds;
-    } catch (IOException | ConfigInvalidException e) {
-      log.error("Error trying to resolve user " + nameOrEmail, e);
-      return Collections.emptySet();
-    }
-  }
-
-  private boolean isFullMatch(Account.Id id, String nameOrEmail) {
-    Optional<AccountState> accountState = byId.get(id);
-    if (!accountState.isPresent()) {
-      return false;
-    }
-
-    Account account = accountState.get().account();
-    return isFullNameMatch(account, nameOrEmail)
-        || nameOrEmail.equalsIgnoreCase(account.preferredEmail())
-        || accountState.get().externalIds().stream()
-            .anyMatch(eid -> isEMailMatch(eid, nameOrEmail) || isUsernameMatch(eid, nameOrEmail));
-  }
-
-  private boolean isFullNameMatch(Account account, String fullName) {
-    return Optional.ofNullable(account.fullName())
-        .filter(n -> n.trim().equalsIgnoreCase(fullName))
-        .isPresent();
-  }
-
-  private boolean isUsernameMatch(ExternalId externalId, String username) {
-    return OptionalUtils.combine(
-            keySchemeRest(SCHEME_GERRIT, externalId.key()),
-            keySchemeRest(SCHEME_USERNAME, externalId.key()))
-        .filter(name -> name.equals(username))
-        .isPresent();
-  }
-
-  private boolean isEMailMatch(ExternalId externalId, String email) {
-    ExternalId.Key externalKey = externalId.key();
-    return OptionalUtils.combine(
-            Optional.ofNullable(externalId.email()).filter(mail -> mail.equalsIgnoreCase(email)),
-            keySchemeRest(SCHEME_MAILTO, externalKey).filter(mail -> mail.equalsIgnoreCase(email)))
-        .isPresent();
-  }
-
-  private boolean isActive(Account.Id accountId) {
-    return byId.get(accountId).map(AccountState::account).map(Account::isActive).orElse(false);
-  }
-
-  private Optional<String> keySchemeRest(String scheme, ExternalId.Key key) {
-    if (scheme != null && key.isScheme(scheme)) {
-      return Optional.of(key.get().substring(scheme.length() + 1));
-    }
-    return Optional.empty();
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/ConfigurationParser.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/ConfigurationParser.java
deleted file mode 100644
index 921d967..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/ConfigurationParser.java
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.googlesource.gerrit.owners.common.StreamUtils.iteratorStream;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.io.IOException;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ConfigurationParser {
-  private static final Logger log = LoggerFactory.getLogger(OwnersConfig.class);
-  private Accounts accounts;
-
-  public ConfigurationParser(Accounts accounts) {
-    this.accounts = accounts;
-  }
-
-  public OwnersConfig getOwnersConfig(byte[] yamlBytes) throws IOException {
-    final OwnersConfig ret = new OwnersConfig();
-    JsonNode jsonNode = new ObjectMapper(new YAMLFactory()).readValue(yamlBytes, JsonNode.class);
-    Boolean inherited =
-        Optional.ofNullable(jsonNode.get("inherited")).map(JsonNode::asBoolean).orElse(true);
-    ret.setInherited(inherited);
-    ret.setLabel(
-        Optional.ofNullable(jsonNode.get("label"))
-            .map(JsonNode::asText)
-            .flatMap(LabelDefinition::parse));
-    Optional<InheritableBoolean> autoOwnersApproved = parseAutoOwnersApproved(jsonNode);
-
-    autoOwnersApproved.ifPresent(ret::setAutoOwnersApproved);
-
-    addClassicMatcher(jsonNode, ret);
-    addMatchers(jsonNode, ret);
-    return ret;
-  }
-
-  private Optional<InheritableBoolean> parseAutoOwnersApproved(JsonNode jsonNode) {
-    return Optional.ofNullable(jsonNode.get("auto-owners-approved"))
-        .map(JsonNode::asText)
-        .map(String::toUpperCase)
-        .map(InheritableBoolean::valueOf);
-  }
-
-  private void addClassicMatcher(JsonNode jsonNode, OwnersConfig ret) {
-    ret.setOwners(toClassicOwnersList(jsonNode, "owners").collect(Collectors.toSet()));
-    ret.setReviewers(toClassicOwnersList(jsonNode, "reviewers").collect(Collectors.toSet()));
-  }
-
-  private void addMatchers(JsonNode jsonNode, OwnersConfig ret) {
-    getNode(jsonNode, "matchers")
-        .map(m -> getMatchers(m))
-        .ifPresent(m -> m.forEach(ret::addMatcher));
-  }
-
-  private Stream<Matcher> getMatchers(JsonNode node) {
-    return iteratorStream(node.iterator())
-        .map(this::toMatcher)
-        .filter(Optional::isPresent)
-        .map(m -> m.get());
-  }
-
-  private static Stream<String> extractAsText(JsonNode node) {
-    if (node.isTextual()) {
-      return Stream.of(node.asText());
-    }
-    return iteratorStream(node.iterator()).map(JsonNode::asText);
-  }
-
-  private static <T> Stream<T> flatten(Optional<Stream<T>> optionalStream) {
-    return optionalStream.orElse(Stream.empty());
-  }
-
-  private Stream<String> toClassicOwnersList(JsonNode jsonNode, String sectionName) {
-    Stream<String> ownersStream =
-        Optional.ofNullable(jsonNode.get(sectionName))
-            .map(ConfigurationParser::extractAsText)
-            .orElse(Stream.empty());
-    return ownersStream;
-  }
-
-  private Optional<Matcher> toMatcher(JsonNode node) {
-    Set<Id> owners =
-        getNode(node, "owners")
-            .map(ConfigurationParser::extractAsText)
-            .orElse(Stream.empty())
-            .flatMap(o -> accounts.find(o).stream())
-            .collect(Collectors.toSet());
-    Set<String> groupOwners =
-        flatten(
-                getNode(node, "owners")
-                    .map(ConfigurationParser::extractAsText)
-                    .map(owns -> owns.map(PathOwnersEntry::stripOwnerDomain)))
-            .collect(Collectors.toSet());
-    Set<Id> reviewers =
-        getNode(node, "reviewers")
-            .map(ConfigurationParser::extractAsText)
-            .orElse(Stream.empty())
-            .flatMap(o -> accounts.find(o).stream())
-            .collect(Collectors.toSet());
-
-    InheritableBoolean autoOwnersApproved =
-        parseAutoOwnersApproved(node).orElse(InheritableBoolean.INHERIT);
-
-    Optional<Matcher> suffixMatcher =
-        getText(node, "suffix")
-            .map(el -> new SuffixMatcher(el, owners, reviewers, groupOwners, autoOwnersApproved));
-    Optional<Matcher> regexMatcher =
-        getText(node, "regex")
-            .map(el -> new RegExMatcher(el, owners, reviewers, groupOwners, autoOwnersApproved));
-    Optional<Matcher> partialRegexMatcher =
-        getText(node, "partial_regex")
-            .map(
-                el ->
-                    new PartialRegExMatcher(
-                        el, owners, reviewers, groupOwners, autoOwnersApproved));
-    Optional<Matcher> exactMatcher =
-        getText(node, "exact")
-            .map(el -> new ExactMatcher(el, owners, reviewers, groupOwners, autoOwnersApproved));
-    Optional<Matcher> genericMatcher =
-        getText(node, "generic")
-            .map(el -> new GenericMatcher(el, owners, reviewers, groupOwners, autoOwnersApproved));
-
-    return Optional.ofNullable(
-        suffixMatcher.orElseGet(
-            () ->
-                regexMatcher.orElseGet(
-                    () ->
-                        partialRegexMatcher.orElseGet(
-                            () ->
-                                exactMatcher.orElseGet(
-                                    () ->
-                                        genericMatcher.orElseGet(
-                                            () -> {
-                                              log.warn(
-                                                  "Ignoring invalid element " + node.toString());
-                                              return null;
-                                            }))))));
-  }
-
-  private static Optional<String> getText(JsonNode node, String field) {
-    return Optional.ofNullable(node.get(field)).map(JsonNode::asText);
-  }
-
-  private static Optional<JsonNode> getNode(JsonNode node, String field) {
-    return Optional.ofNullable(node.get(field));
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/ExactMatcher.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/ExactMatcher.java
deleted file mode 100644
index 02b9ab5..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/ExactMatcher.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.util.Set;
-
-public class ExactMatcher extends Matcher {
-  public ExactMatcher(
-      String path,
-      Set<Account.Id> owners,
-      Set<Account.Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved) {
-    super(path, owners, reviewers, groupOwners, autoOwnersApproved);
-  }
-
-  @Override
-  public boolean matches(String pathToMatch) {
-    return pathToMatch.equals(path);
-  }
-
-  @Override
-  protected Matcher clone(
-      Set<Id> owners,
-      Set<Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved) {
-    return new ExactMatcher(path, owners, reviewers, groupOwners, autoOwnersApproved);
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/GenericMatcher.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/GenericMatcher.java
deleted file mode 100644
index f46ee7f..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/GenericMatcher.java
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.util.Set;
-
-public class GenericMatcher extends RegExMatcher {
-
-  public GenericMatcher(
-      String path,
-      Set<Account.Id> owners,
-      Set<Account.Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved) {
-    super(path, owners, reviewers, groupOwners, autoOwnersApproved);
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/InvalidOwnersFileException.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/InvalidOwnersFileException.java
deleted file mode 100644
index 1914625..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/InvalidOwnersFileException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (C) 2024 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-public class InvalidOwnersFileException extends Exception {
-  private static final long serialVersionUID = 1L;
-
-  public InvalidOwnersFileException(
-      String project, String ownersPath, String branch, Throwable reason) {
-    super(exceptionMessage(project, ownersPath, branch), reason);
-  }
-
-  private static String exceptionMessage(String project, String ownersPath, String branch) {
-    return String.format(
-        "Invalid owners file: %s, in project: %s, on branch %s", ownersPath, project, branch);
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/JgitWrapper.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/JgitWrapper.java
deleted file mode 100644
index 17b8af9..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/JgitWrapper.java
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static org.eclipse.jgit.lib.Constants.OBJ_BLOB;
-import static org.eclipse.jgit.lib.FileMode.TYPE_FILE;
-import static org.eclipse.jgit.lib.FileMode.TYPE_MASK;
-
-import com.google.gerrit.entities.RefNames;
-import java.io.IOException;
-import java.util.Optional;
-import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.Ref;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.revwalk.RevCommit;
-import org.eclipse.jgit.revwalk.RevWalk;
-import org.eclipse.jgit.treewalk.TreeWalk;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class JgitWrapper {
-  private static final Logger log = LoggerFactory.getLogger(JgitWrapper.class);
-
-  public static Optional<byte[]> getBlobAsBytes(Repository repository, String revision, String path)
-      throws IOException {
-    Ref ref = repository.getRefDatabase().exactRef(RefNames.fullName(revision));
-    if (ref == null) {
-      return Optional.empty();
-    }
-
-    try (final TreeWalk w =
-        TreeWalk.forPath(
-            repository, path, parseCommit(repository, ref.getLeaf().getObjectId()).getTree())) {
-
-      return Optional.ofNullable(w)
-          .filter(walk -> (walk.getRawMode(0) & TYPE_MASK) == TYPE_FILE)
-          .map(walk -> walk.getObjectId(0))
-          .flatMap(id -> readBlob(repository, id));
-    }
-  }
-
-  private static RevCommit parseCommit(Repository repository, ObjectId commit) throws IOException {
-    try (final RevWalk walk = new RevWalk(repository)) {
-      walk.setRetainBody(true);
-      return walk.parseCommit(commit);
-    }
-  }
-
-  private static Optional<byte[]> readBlob(Repository repository, ObjectId id) {
-    try {
-      return Optional.of(repository.open(id, OBJ_BLOB).getCachedBytes(Integer.MAX_VALUE));
-    } catch (Exception e) {
-      // TODO: are we sure we want to swallow this exception?
-      log.error("Unexpected error while reading Git Object " + id, e);
-      return Optional.empty();
-    }
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/LabelDefinition.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/LabelDefinition.java
deleted file mode 100644
index 08664fe..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/LabelDefinition.java
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright (C) 2023 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.common.flogger.FluentLogger;
-import com.google.gerrit.entities.LabelId;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Describes the label together with score (the latter is optional) that is configured in the OWNERS
- * file. File owners have to give the score for change to be submittable.
- */
-public class LabelDefinition {
-  public static final LabelDefinition CODE_REVIEW = new LabelDefinition(LabelId.CODE_REVIEW, null);
-
-  private static final FluentLogger logger = FluentLogger.forEnclosingClass();
-  private static final Pattern LABEL_PATTERN =
-      Pattern.compile("^([a-zA-Z0-9-]+)(?:(?:\\s*,\\s*)(\\d))?$");
-
-  private final String name;
-  private final Optional<Short> score;
-
-  LabelDefinition(String name, Short score) {
-    this.name = name;
-    this.score = Optional.ofNullable(score);
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public Optional<Short> getScore() {
-    return score;
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder builder = new StringBuilder();
-    builder.append("LabelDefinition [name=");
-    builder.append(name);
-    builder.append(", score=");
-    builder.append(score);
-    builder.append("]");
-    return builder.toString();
-  }
-
-  @Override
-  public int hashCode() {
-    return Objects.hash(name, score);
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (this == obj) {
-      return true;
-    }
-
-    if ((obj == null) || getClass() != obj.getClass()) {
-      return false;
-    }
-
-    LabelDefinition other = (LabelDefinition) obj;
-    return Objects.equals(name, other.name) && Objects.equals(score, other.score);
-  }
-
-  public static Optional<LabelDefinition> parse(String definition) {
-    return Optional.ofNullable(definition)
-        .filter(def -> !def.isBlank())
-        .map(
-            def -> {
-              Matcher labelDef = LABEL_PATTERN.matcher(def.trim());
-              if (!labelDef.matches()) {
-                logger.atSevere().log("Parsing label definition [%s] has failed.", def);
-                return null;
-              }
-
-              return new LabelDefinition(
-                  labelDef.group(1),
-                  Optional.ofNullable(labelDef.group(2)).map(Short::valueOf).orElse(null));
-            });
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/Matcher.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/Matcher.java
deleted file mode 100644
index 278e75d..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/Matcher.java
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.util.Set;
-
-public abstract class Matcher {
-  private Set<Account.Id> owners;
-  private Set<Account.Id> reviewers;
-  private Set<String> groupOwners;
-  protected String path;
-  private InheritableBoolean autoOwnersApproved;
-
-  public Matcher(
-      String key,
-      Set<Account.Id> owners,
-      Set<Account.Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved) {
-    this.path = key;
-    this.owners = owners;
-    this.reviewers = reviewers;
-    this.groupOwners = groupOwners;
-    this.autoOwnersApproved = autoOwnersApproved;
-  }
-
-  @Override
-  public String toString() {
-    return "Matcher [path="
-        + path
-        + ", owners="
-        + owners
-        + ", groupOwners="
-        + groupOwners
-        + ", reviewers="
-        + reviewers
-        + ", autoOwnersApproved="
-        + autoOwnersApproved
-        + "]";
-  }
-
-  public Set<Account.Id> getOwners() {
-    return owners;
-  }
-
-  public Set<String> getGroupOwners() {
-    return groupOwners;
-  }
-
-  public void setOwners(Set<Account.Id> owners) {
-    this.owners = owners;
-  }
-
-  public Set<Account.Id> getReviewers() {
-    return reviewers;
-  }
-
-  public void setReviewers(Set<Account.Id> reviewers) {
-    this.reviewers = reviewers;
-  }
-
-  public void setPath(String path) {
-    this.path = path;
-  }
-
-  public String getPath() {
-    return path;
-  }
-
-  public InheritableBoolean getAutoOwnersApproved() {
-    return autoOwnersApproved;
-  }
-
-  public abstract boolean matches(String pathToMatch);
-
-  public Matcher merge(Matcher other) {
-    if (other == null) {
-      return this;
-    }
-
-    return clone(
-        mergeSet(owners, other.owners),
-        mergeSet(reviewers, other.reviewers),
-        mergeSet(groupOwners, other.groupOwners),
-        other.autoOwnersApproved == InheritableBoolean.INHERIT
-            ? autoOwnersApproved
-            : other.getAutoOwnersApproved());
-  }
-
-  protected abstract Matcher clone(
-      Set<Id> owners,
-      Set<Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved);
-
-  private <T> Set<T> mergeSet(Set<T> set1, Set<T> set2) {
-    ImmutableSet.Builder<T> setBuilder = ImmutableSet.builder();
-    return setBuilder.addAll(set1).addAll(set2).build();
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/OptionalUtils.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/OptionalUtils.java
deleted file mode 100644
index f35941d..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/OptionalUtils.java
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import java.util.Optional;
-
-public class OptionalUtils {
-
-  public static <T> Optional<T> combine(Optional<T> firstChoice, Optional<T> secondChoice) {
-    return Optional.ofNullable(firstChoice.orElse(secondChoice.orElse(null)));
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/OwnersConfig.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/OwnersConfig.java
deleted file mode 100644
index 1fce900..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/OwnersConfig.java
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) 2013 VMware, Inc. All Rights Reserved.
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.gerrit.extensions.client.InheritableBoolean.INHERIT;
-
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-
-/**
- * OWNERS file model.
- *
- * <p>Used for de-serializing the OWNERS files.
- */
-public class OwnersConfig {
-  /** Flag for marking that this OWNERS file inherits from the parent OWNERS. */
-  private boolean inherited = true;
-
-  private Set<String> owners = Sets.newHashSet();
-  private Set<String> reviewers = Sets.newHashSet();
-
-  /** Map name of matcher and Matcher (value + Set Owners) */
-  private Map<String, Matcher> matchers = Maps.newHashMap();
-
-  /** Label that is required for submit. CodeReview if nothing is specified. */
-  private Optional<LabelDefinition> label = Optional.empty();
-
-  /** Ability to enable or disable the owners auto approval, when configured */
-  private InheritableBoolean autoOwnersApproved = INHERIT;
-
-  @Override
-  public String toString() {
-    return "OwnersConfig [inherited="
-        + inherited
-        + ", owners="
-        + owners
-        + ", matchers="
-        + matchers
-        + ", label="
-        + label
-        + ", autoOwnersApproved="
-        + autoOwnersApproved
-        + "]";
-  }
-
-  public boolean isInherited() {
-    return inherited;
-  }
-
-  public void setInherited(boolean inherited) {
-    this.inherited = inherited;
-  }
-
-  public Set<String> getOwners() {
-    return owners;
-  }
-
-  public void setOwners(Set<String> owners) {
-    this.owners = owners;
-  }
-
-  public Set<String> getReviewers() {
-    return reviewers;
-  }
-
-  public void setReviewers(Set<String> reviewers) {
-    this.reviewers = reviewers;
-  }
-
-  public Map<String, Matcher> getMatchers() {
-    return matchers;
-  }
-
-  public Matcher addMatcher(Matcher matcher) {
-    return this.matchers.put(matcher.path, matcher);
-  }
-
-  public void setLabel(Optional<LabelDefinition> label) {
-    this.label = label;
-  }
-
-  public Optional<LabelDefinition> getLabel() {
-    return label;
-  }
-
-  public InheritableBoolean getAutoOwnersApproved() {
-    return autoOwnersApproved;
-  }
-
-  public void setAutoOwnersApproved(InheritableBoolean autoOwnersApproved) {
-    this.autoOwnersApproved = autoOwnersApproved;
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/OwnersMap.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/OwnersMap.java
deleted file mode 100644
index d6dbc13..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/OwnersMap.java
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.common.collect.HashMultimap;
-import com.google.common.collect.Maps;
-import com.google.common.collect.SetMultimap;
-import com.google.common.collect.Sets;
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Account.Id;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-
-public class OwnersMap {
-  private SetMultimap<String, Account.Id> pathOwners = HashMultimap.create();
-  private SetMultimap<String, Account.Id> pathReviewers = HashMultimap.create();
-  private Map<String, Matcher> matchers = Maps.newHashMap();
-  private Map<String, Set<Account.Id>> fileOwners = Maps.newHashMap();
-  private Map<String, Set<Account.Id>> fileReviewers = Maps.newHashMap();
-  private Map<String, Set<String>> fileGroupOwners = Maps.newHashMap();
-  private Set<String> fileOwnersAllowedAutoApproval = Sets.newHashSet();
-  private Optional<LabelDefinition> label = Optional.empty();
-
-  @Override
-  public String toString() {
-    return "OwnersMap [pathOwners=" + pathOwners + ", matchers=" + matchers + "]";
-  }
-
-  public void setMatchers(Map<String, Matcher> matchers) {
-    this.matchers = matchers;
-  }
-
-  public SetMultimap<String, Account.Id> getPathOwners() {
-    return pathOwners;
-  }
-
-  public void setPathOwners(SetMultimap<String, Account.Id> pathOwners) {
-    this.pathOwners = pathOwners;
-  }
-
-  public SetMultimap<String, Account.Id> getPathReviewers() {
-    return pathReviewers;
-  }
-
-  public void setPathReviewers(SetMultimap<String, Account.Id> pathReviewers) {
-    this.pathReviewers = pathReviewers;
-  }
-
-  public Map<String, Matcher> getMatchers() {
-    return matchers;
-  }
-
-  public void addMatchers(Map<String, Matcher> matchers) {
-    this.matchers.putAll(matchers);
-  }
-
-  public void addPathOwners(String ownersPath, Set<Id> owners) {
-    pathOwners.putAll(ownersPath, owners);
-  }
-
-  public void addPathReviewers(String ownersPath, Set<Id> reviewers) {
-    pathOwners.putAll(ownersPath, reviewers);
-  }
-
-  public Map<String, Set<Id>> getFileOwners() {
-    return fileOwners;
-  }
-
-  public Map<String, Set<Id>> getFileReviewers() {
-    return fileReviewers;
-  }
-
-  public Map<String, Set<String>> getFileGroupOwners() {
-    return fileGroupOwners;
-  }
-
-  public Set<String> getFileOwnersAllowedAutoApproval() {
-    return fileOwnersAllowedAutoApproval;
-  }
-
-  public void addFileOwners(String file, Set<Id> owners) {
-    if (owners.isEmpty()) {
-      return;
-    }
-
-    Set<Id> set = fileOwners.get(file);
-    if (set != null) {
-      // add new owners removing duplicates
-      set.addAll(owners);
-    } else {
-      fileOwners.put(file, Sets.newHashSet(owners));
-    }
-  }
-
-  public void addFileReviewers(String file, Set<Id> reviewers) {
-    if (reviewers.isEmpty()) {
-      return;
-    }
-
-    Set<Id> set = fileReviewers.get(file);
-    if (set != null) {
-      // add new owners removing duplicates
-      set.addAll(reviewers);
-    } else {
-      fileReviewers.put(file, Sets.newHashSet(reviewers));
-    }
-  }
-
-  public void addFileGroupOwners(String file, Set<String> groupOwners) {
-    if (groupOwners.isEmpty()) {
-      return;
-    }
-
-    fileGroupOwners.computeIfAbsent(file, (f) -> Sets.newHashSet()).addAll(groupOwners);
-  }
-
-  public void addAllowedFileForOwnersAutoApproval(String file) {
-    fileOwnersAllowedAutoApproval.add(file);
-  }
-
-  public void removeAllowedFileForOwnersAutoApproval(String file) {
-    fileOwnersAllowedAutoApproval.remove(file);
-  }
-
-  public Optional<LabelDefinition> getLabel() {
-    return label;
-  }
-
-  public void setLabel(Optional<LabelDefinition> label) {
-    this.label = label;
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PartialRegExMatcher.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PartialRegExMatcher.java
deleted file mode 100644
index 8fe7812..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PartialRegExMatcher.java
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-// Javascript like regular expression matching substring
-public class PartialRegExMatcher extends Matcher {
-  Pattern pattern;
-
-  public PartialRegExMatcher(
-      String path,
-      Set<Account.Id> owners,
-      Set<Account.Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved) {
-    super(path, owners, reviewers, groupOwners, autoOwnersApproved);
-    pattern = Pattern.compile(".*" + path + ".*");
-  }
-
-  @Override
-  public boolean matches(String pathToMatch) {
-    return pattern.matcher(pathToMatch).matches();
-  }
-
-  @Override
-  protected Matcher clone(
-      Set<Id> owners,
-      Set<Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved) {
-    return new PartialRegExMatcher(path, owners, reviewers, groupOwners, autoOwnersApproved);
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwners.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwners.java
deleted file mode 100644
index 71ce117..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwners.java
+++ /dev/null
@@ -1,577 +0,0 @@
-// Copyright (c) 2013 VMware, Inc. All Rights Reserved.
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.gerrit.entities.Patch.COMMIT_MSG;
-import static com.google.gerrit.entities.Patch.MERGE_LIST;
-import static com.googlesource.gerrit.owners.common.JgitWrapper.getBlobAsBytes;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Multimaps;
-import com.google.common.collect.SetMultimap;
-import com.google.common.collect.Sets;
-import com.google.gerrit.common.Nullable;
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.entities.Patch;
-import com.google.gerrit.entities.Project;
-import com.google.gerrit.entities.RefNames;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import com.google.gerrit.server.git.GitRepositoryManager;
-import com.google.gerrit.server.patch.DiffSummary;
-import com.google.gerrit.server.patch.filediff.FileDiffOutput;
-import com.google.gerrit.server.project.ProjectState;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-import java.util.stream.Collectors;
-import org.eclipse.jgit.lib.Repository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/** Calculates the owners of a patch list. */
-// TODO(vspivak): provide assisted factory
-public class PathOwners {
-
-  private static final Logger log = LoggerFactory.getLogger(PathOwners.class);
-
-  private enum MatcherLevel {
-    Regular,
-    Fallback,
-    CatchAll;
-
-    static MatcherLevel forMatcher(Matcher matcher) {
-      return matcher instanceof GenericMatcher
-          ? (matcher.path.equals(".*") ? CatchAll : Fallback)
-          : Regular;
-    }
-  }
-
-  private final SetMultimap<String, Account.Id> owners;
-
-  private final SetMultimap<String, Account.Id> reviewers;
-
-  private final Repository repository;
-
-  private final List<Project.NameKey> parentProjectsNames;
-
-  private final ConfigurationParser parser;
-
-  private final Set<String> modifiedPaths;
-
-  private final Accounts accounts;
-
-  private final GitRepositoryManager repositoryManager;
-
-  private final Map<String, Matcher> matchers;
-
-  private final Map<String, Set<Id>> fileOwners;
-
-  private final Map<String, Set<String>> fileGroupOwners;
-
-  private final Set<String> fileOwnersAllowedAutoApproval;
-
-  private final boolean expandGroups;
-
-  private final Optional<LabelDefinition> label;
-
-  public PathOwners(
-      Accounts accounts,
-      GitRepositoryManager repositoryManager,
-      Repository repository,
-      List<Project.NameKey> parentProjectsNames,
-      Optional<String> branchWhenEnabled,
-      Map<String, FileDiffOutput> fileDiffMap,
-      boolean expandGroups,
-      String project,
-      PathOwnersEntriesCache cache,
-      Optional<LabelDefinition> globalLabel)
-      throws InvalidOwnersFileException {
-    this(
-        accounts,
-        repositoryManager,
-        repository,
-        parentProjectsNames,
-        branchWhenEnabled,
-        getModifiedPaths(fileDiffMap),
-        expandGroups,
-        project,
-        cache,
-        globalLabel);
-  }
-
-  public PathOwners(
-      Accounts accounts,
-      GitRepositoryManager repositoryManager,
-      Repository repository,
-      List<Project.NameKey> parentProjectsNames,
-      Optional<String> branchWhenEnabled,
-      DiffSummary diffSummary,
-      boolean expandGroups,
-      String project,
-      PathOwnersEntriesCache cache,
-      Optional<LabelDefinition> globalLabel)
-      throws InvalidOwnersFileException {
-    this(
-        accounts,
-        repositoryManager,
-        repository,
-        parentProjectsNames,
-        branchWhenEnabled,
-        ImmutableSet.copyOf(diffSummary.getPaths()),
-        expandGroups,
-        project,
-        cache,
-        globalLabel);
-  }
-
-  public PathOwners(
-      Accounts accounts,
-      GitRepositoryManager repositoryManager,
-      Repository repository,
-      List<Project.NameKey> parentProjectsNames,
-      Optional<String> branchWhenEnabled,
-      Set<String> modifiedPaths,
-      boolean expandGroups,
-      String project,
-      PathOwnersEntriesCache cache,
-      Optional<LabelDefinition> globalLabel)
-      throws InvalidOwnersFileException {
-    this.repositoryManager = repositoryManager;
-    this.repository = repository;
-    this.parentProjectsNames = parentProjectsNames;
-    this.modifiedPaths = modifiedPaths;
-    this.parser = new ConfigurationParser(accounts);
-    this.accounts = accounts;
-    this.expandGroups = expandGroups;
-
-    OwnersMap map;
-    if (branchWhenEnabled.isPresent()) {
-      map = fetchOwners(project, branchWhenEnabled.get(), cache);
-    } else {
-      map = new OwnersMap();
-    }
-    owners = Multimaps.unmodifiableSetMultimap(map.getPathOwners());
-    reviewers = Multimaps.unmodifiableSetMultimap(map.getPathReviewers());
-    matchers = map.getMatchers();
-    fileOwners = map.getFileOwners();
-    fileGroupOwners = map.getFileGroupOwners();
-    fileOwnersAllowedAutoApproval = map.getFileOwnersAllowedAutoApproval();
-    label = globalLabel.or(map::getLabel);
-  }
-
-  /**
-   * Returns a read only view of the paths to owners mapping.
-   *
-   * @return multimap of paths to owners
-   */
-  public SetMultimap<String, Account.Id> get() {
-    return owners;
-  }
-
-  /**
-   * Returns a read only view of the paths to reviewers mapping.
-   *
-   * @return multimap of paths to reviewers
-   */
-  public SetMultimap<String, Account.Id> getReviewers() {
-    return reviewers;
-  }
-
-  public Map<String, Matcher> getMatchers() {
-    return matchers;
-  }
-
-  public Map<String, Set<Account.Id>> getFileOwners() {
-    return fileOwners;
-  }
-
-  public Map<String, Set<String>> getFileGroupOwners() {
-    return fileGroupOwners;
-  }
-
-  public Set<String> getFileOwnersAllowedAutoApproval() {
-    return fileOwnersAllowedAutoApproval;
-  }
-
-  public boolean expandGroups() {
-    return expandGroups;
-  }
-
-  public Optional<LabelDefinition> getLabel() {
-    return label;
-  }
-
-  public static List<Project.NameKey> getParents(ProjectState projectState) {
-    return projectState.parents().stream()
-        .map(ProjectState::getNameKey)
-        .collect(Collectors.toList());
-  }
-
-  /**
-   * Fetched the owners for the associated patch list.
-   *
-   * @return A structure containing matchers paths to owners
-   * @throws InvalidOwnersFileException when reading/parsing OWNERS file fails
-   */
-  private OwnersMap fetchOwners(String project, String branch, PathOwnersEntriesCache cache)
-      throws InvalidOwnersFileException {
-    OwnersMap ownersMap = new OwnersMap();
-    try {
-      // Using a `map` would have needed a try/catch inside the lamba, resulting in more code
-      List<ReadOnlyPathOwnersEntry> parentsPathOwnersEntries =
-          getPathOwnersEntries(parentProjectsNames, RefNames.REFS_CONFIG, cache);
-      Optional<ReadOnlyPathOwnersEntry> projectEntry =
-          getPathOwnersEntryOrEmpty(project, repository, RefNames.REFS_CONFIG, cache);
-      PathOwnersEntry rootEntry = getPathOwnersEntryOrNew(project, repository, branch, cache);
-
-      Map<String, PathOwnersEntry> entries = new HashMap<>();
-      PathOwnersEntry currentEntry = null;
-      for (String path : modifiedPaths) {
-        currentEntry =
-            resolvePathEntry(
-                project,
-                path,
-                branch,
-                projectEntry,
-                parentsPathOwnersEntries,
-                rootEntry,
-                entries,
-                cache);
-
-        // add owners and reviewers to file for matcher predicates
-        ownersMap.addFileOwners(path, currentEntry.getOwners());
-        ownersMap.addFileReviewers(path, currentEntry.getReviewers());
-        ownersMap.addFileGroupOwners(path, currentEntry.getGroupOwners());
-        if (currentEntry.isAutoOwnersApproved()) {
-          ownersMap.addAllowedFileForOwnersAutoApproval(path);
-        }
-        // Only add the path to the OWNERS file to reduce the number of
-        // entries in the result
-        if (currentEntry.getOwnersPath() != null) {
-          ownersMap.addPathOwners(currentEntry.getOwnersPath(), currentEntry.getOwners());
-          ownersMap.addPathReviewers(currentEntry.getOwnersPath(), currentEntry.getReviewers());
-        }
-        ownersMap.addMatchers(currentEntry.getMatchers());
-      }
-
-      // We need to only keep matchers that match files in the patchset
-      Map<String, Matcher> matchers = ownersMap.getMatchers();
-      if (matchers.size() > 0) {
-        HashMap<String, Matcher> newMatchers = Maps.newHashMap();
-        // extra loop
-        for (String path : modifiedPaths) {
-          processMatcherPerPath(matchers, newMatchers, path, ownersMap);
-        }
-        if (matchers.size() != newMatchers.size()) {
-          ownersMap.setMatchers(newMatchers);
-        }
-      }
-      ownersMap.setLabel(Optional.ofNullable(currentEntry).flatMap(PathOwnersEntry::getLabel));
-    } catch (IOException e) {
-      log.warn("Opening repository {} failed", project, e);
-    } catch (ExecutionException e) {
-      log.warn("Reading OWNERS file for {} project, from cache failed", project, e);
-    }
-    return ownersMap;
-  }
-
-  private List<ReadOnlyPathOwnersEntry> getPathOwnersEntries(
-      List<Project.NameKey> projectNames, String branch, PathOwnersEntriesCache cache)
-      throws IOException, InvalidOwnersFileException, ExecutionException {
-    ImmutableList.Builder<ReadOnlyPathOwnersEntry> pathOwnersEntries = ImmutableList.builder();
-    for (Project.NameKey projectName : projectNames) {
-      try (Repository repo = repositoryManager.openRepository(projectName)) {
-        Optional<ReadOnlyPathOwnersEntry> pathOwnersEntry =
-            getPathOwnersEntryOrEmpty(projectName.get(), repo, branch, cache);
-        if (pathOwnersEntry.isPresent()) {
-          pathOwnersEntries = pathOwnersEntries.add(pathOwnersEntry.get());
-        }
-      }
-    }
-    return pathOwnersEntries.build();
-  }
-
-  private Optional<ReadOnlyPathOwnersEntry> getPathOwnersEntryOrEmpty(
-      String project, Repository repo, String branch, PathOwnersEntriesCache cache)
-      throws InvalidOwnersFileException, ExecutionException {
-    return getPathOwnersEntry(project, repo, branch, cache).map(v -> (ReadOnlyPathOwnersEntry) v);
-  }
-
-  private PathOwnersEntry getPathOwnersEntryOrNew(
-      String project, Repository repo, String branch, PathOwnersEntriesCache cache)
-      throws InvalidOwnersFileException, ExecutionException {
-    return getPathOwnersEntry(project, repo, branch, cache).orElseGet(PathOwnersEntry::new);
-  }
-
-  private Optional<PathOwnersEntry> getPathOwnersEntry(
-      String project, Repository repo, String branch, PathOwnersEntriesCache cache)
-      throws InvalidOwnersFileException, ExecutionException {
-    String rootPath = "OWNERS";
-    return unwrapInvalidOwnersFileException(
-        () ->
-            cache
-                .get(
-                    project,
-                    branch,
-                    rootPath,
-                    () -> getOwnersConfig(project, repo, rootPath, branch))
-                .map(
-                    conf ->
-                        new PathOwnersEntry(
-                            rootPath,
-                            conf,
-                            accounts,
-                            Optional.empty(),
-                            Collections.emptySet(),
-                            Collections.emptySet(),
-                            Optional.empty(),
-                            Collections.emptySet(),
-                            Collections.emptySet())));
-  }
-
-  private void processMatcherPerPath(
-      Map<String, Matcher> fullMatchers,
-      HashMap<String, Matcher> newMatchers,
-      String path,
-      OwnersMap ownersMap) {
-
-    Map<MatcherLevel, List<Matcher>> matchersByLevel =
-        fullMatchers.values().stream().collect(Collectors.groupingBy(MatcherLevel::forMatcher));
-    if (findAndAddMatchers(
-        newMatchers, path, ownersMap, matchersByLevel.get(MatcherLevel.Regular))) {
-      return;
-    }
-
-    if (findAndAddMatchers(
-        newMatchers, path, ownersMap, matchersByLevel.get(MatcherLevel.Fallback))) {
-      return;
-    }
-
-    findAndAddMatchers(newMatchers, path, ownersMap, matchersByLevel.get(MatcherLevel.CatchAll));
-  }
-
-  private boolean findAndAddMatchers(
-      HashMap<String, Matcher> newMatchers,
-      String path,
-      OwnersMap ownersMap,
-      @Nullable List<Matcher> matchers) {
-    if (matchers == null) {
-      return false;
-    }
-
-    boolean matchingFound = false;
-
-    for (Matcher matcher : matchers) {
-      if (matcher.matches(path)) {
-        newMatchers.put(matcher.getPath(), matcher);
-        ownersMap.addFileOwners(path, matcher.getOwners());
-        ownersMap.addFileGroupOwners(path, matcher.getGroupOwners());
-        ownersMap.addFileReviewers(path, matcher.getReviewers());
-        switch (matcher.getAutoOwnersApproved()) {
-          // We have an explicit allowance for this matcher.
-          case InheritableBoolean.TRUE:
-            ownersMap.addAllowedFileForOwnersAutoApproval(path);
-            break;
-          // We have an explicit disable for this matcher.
-          case InheritableBoolean.FALSE:
-            ownersMap.removeAllowedFileForOwnersAutoApproval(path);
-            break;
-
-          // There is no matcher-level specification of auto-owner-approved,
-          // therefore the OWNERS-level resolution still applies.
-          default:
-            break;
-        }
-        matchingFound = true;
-      }
-    }
-    return matchingFound;
-  }
-
-  private PathOwnersEntry resolvePathEntry(
-      String project,
-      String path,
-      String branch,
-      Optional<ReadOnlyPathOwnersEntry> projectEntry,
-      List<ReadOnlyPathOwnersEntry> parentsPathOwnersEntries,
-      PathOwnersEntry rootEntry,
-      Map<String, PathOwnersEntry> entries,
-      PathOwnersEntriesCache cache)
-      throws InvalidOwnersFileException, ExecutionException {
-    String[] parts = path.split("/");
-    StringBuilder builder = new StringBuilder();
-
-    // Inherit from Project if OWNER in root enables inheritance
-    if (rootEntry.isInherited()) {
-      projectEntry.ifPresent(pe -> calculateCurrentEntry(pe, rootEntry));
-    }
-
-    // Inherit from Parent Project if OWNER in Project enables inheritance
-    for (ReadOnlyPathOwnersEntry parentPathOwnersEntry : parentsPathOwnersEntries) {
-      if (projectEntry.isEmpty() || projectEntry.get().isInherited()) {
-        calculateCurrentEntry(parentPathOwnersEntry, rootEntry);
-      }
-    }
-
-    // Iterate through the parent paths, not including the file name
-    // itself
-    PathOwnersEntry currentEntry = rootEntry;
-    for (int i = 0; i < parts.length - 1; i++) {
-      String part = parts[i];
-      builder.append(part).append("/");
-      String partial = builder.toString();
-
-      // Skip if we already parsed this path
-      if (entries.containsKey(partial)) {
-        currentEntry = entries.get(partial);
-      } else {
-        String ownersPath = partial + "OWNERS";
-        PathOwnersEntry pathFallbackEntry = currentEntry;
-        currentEntry =
-            unwrapInvalidOwnersFileException(
-                () ->
-                    cache
-                        .get(
-                            project,
-                            branch,
-                            ownersPath,
-                            () -> getOwnersConfig(project, repository, ownersPath, branch))
-                        .map(
-                            c -> {
-                              Optional<LabelDefinition> label = pathFallbackEntry.getLabel();
-                              final Set<Id> owners = pathFallbackEntry.getOwners();
-                              final Set<Id> reviewers = pathFallbackEntry.getReviewers();
-                              Collection<Matcher> inheritedMatchers =
-                                  pathFallbackEntry.getMatchers().values();
-                              Set<String> groupOwners = pathFallbackEntry.getGroupOwners();
-                              return new PathOwnersEntry(
-                                  ownersPath,
-                                  c,
-                                  accounts,
-                                  label,
-                                  owners,
-                                  reviewers,
-                                  Optional.of(pathFallbackEntry.isAutoOwnersApproved()),
-                                  inheritedMatchers,
-                                  groupOwners);
-                            })
-                        .orElse(pathFallbackEntry));
-        entries.put(partial, currentEntry);
-      }
-    }
-    return currentEntry;
-  }
-
-  private void calculateCurrentEntry(
-      ReadOnlyPathOwnersEntry projectEntry, PathOwnersEntry currentEntry) {
-    for (Matcher matcher : projectEntry.getMatchers().values()) {
-      if (!currentEntry.hasMatcher(matcher.getPath())) {
-        currentEntry.addMatcher(matcher);
-      }
-    }
-    if (currentEntry.getOwners().isEmpty()) {
-      currentEntry.setOwners(projectEntry.getOwners());
-    }
-    if (currentEntry.getOwnersPath() == null) {
-      currentEntry.setOwnersPath(projectEntry.getOwnersPath());
-    }
-    if (currentEntry.getLabel().isEmpty()) {
-      currentEntry.setLabel(projectEntry.getLabel());
-    }
-    if (!currentEntry.hasExplicitAutoOwnersApproved()) {
-      currentEntry.setAutoOwnersApproved(projectEntry.isAutoOwnersApproved());
-    }
-  }
-
-  /**
-   * Parses the diff list for any paths that were modified.
-   *
-   * @return set of modified paths.
-   */
-  private static Set<String> getModifiedPaths(Map<String, FileDiffOutput> patchList) {
-    Set<String> paths = Sets.newHashSet();
-    for (Map.Entry<String, FileDiffOutput> patch : patchList.entrySet()) {
-      // Ignore commit message and Merge List
-      String newName = patch.getKey();
-      if (!COMMIT_MSG.equals(newName) && !MERGE_LIST.equals(newName)) {
-        paths.add(newName);
-
-        // If a file was moved then we need approvals for old and new
-        // path
-        if (patch.getValue().changeType() == Patch.ChangeType.RENAMED) {
-          paths.add(patch.getValue().oldPath().get());
-        }
-      }
-    }
-    return paths;
-  }
-
-  /**
-   * Returns the parsed FileOwnersConfig file for the given path if it exists.
-   *
-   * @return Optional(config) or Optional.empty if it doesn't exist
-   * @throws InvalidOwnersFileException when reading/parsing of the OWNERS file fails
-   */
-  private Optional<OwnersConfig> getOwnersConfig(
-      String project, Repository repo, String ownersPath, String branch)
-      throws InvalidOwnersFileException {
-    try {
-      Optional<byte[]> configBytes = getBlobAsBytes(repo, branch, ownersPath);
-      if (configBytes.isEmpty()) {
-        return Optional.empty();
-      }
-      return Optional.of(parser.getOwnersConfig(configBytes.get()));
-    } catch (IOException e) {
-      throw new InvalidOwnersFileException(project, ownersPath, branch, e);
-    }
-  }
-
-  @FunctionalInterface
-  private interface Executable<T> {
-    T call() throws ExecutionException;
-  }
-
-  /**
-   * Unwraps the InvalidOwnersFileException from the ExecutionException so that callers can focus on
-   * handling InvalidOwnersFileException if/when needed. Note that ExecutionException is thrown only
-   * when loading values to PathOwnersEntriesCache fails.
-   *
-   * @throws InvalidOwnersFileException when call throws ExecutionException that is matchable with
-   *     InvalidOwnersFileException
-   * @throws ExecutionException in all other cases
-   */
-  private <T> T unwrapInvalidOwnersFileException(Executable<T> action)
-      throws InvalidOwnersFileException, ExecutionException {
-    try {
-      return action.call();
-    } catch (ExecutionException e) {
-      if (e.getCause() instanceof InvalidOwnersFileException) {
-        throw (InvalidOwnersFileException) e.getCause();
-      }
-      throw e;
-    }
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCache.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCache.java
deleted file mode 100644
index aea33ff..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCache.java
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright (C) 2023 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.common.cache.RemovalNotification;
-import com.google.gerrit.entities.RefNames;
-import com.google.gerrit.extensions.annotations.PluginName;
-import com.google.gerrit.extensions.events.GitBatchRefUpdateListener;
-import com.google.gerrit.extensions.registration.DynamicSet;
-import com.google.gerrit.server.cache.CacheModule;
-import com.google.gerrit.server.cache.CacheRemovalListener;
-import com.google.gerrit.server.config.AllUsersName;
-import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.google.inject.Singleton;
-import com.google.inject.TypeLiteral;
-import java.time.Duration;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-
-public interface PathOwnersEntriesCache {
-  String CACHE_NAME = "path_owners_entries";
-
-  static Module module() {
-    return new CacheModule() {
-      @Override
-      protected void configure() {
-        cache(CACHE_NAME, Key.class, new TypeLiteral<Optional<OwnersConfig>>() {})
-            .maximumWeight(Long.MAX_VALUE)
-            .expireAfterWrite(Duration.ofSeconds(60));
-        bind(PathOwnersEntriesCache.class).to(PathOwnersEntriesCacheImpl.class);
-        DynamicSet.bind(binder(), GitBatchRefUpdateListener.class)
-            .to(OwnersRefUpdateListener.class);
-        DynamicSet.bind(binder(), CacheRemovalListener.class).to(OwnersCacheRemovalListener.class);
-      }
-    };
-  }
-
-  Optional<OwnersConfig> get(
-      String project, String branch, String path, Callable<Optional<OwnersConfig>> loader)
-      throws ExecutionException;
-
-  void invalidate(String project, String branch);
-
-  void invalidateIndexKey(Key key);
-
-  class Key {
-    final String project;
-    final String branch;
-    final String path;
-
-    Key(String project, String branch, String path) {
-      this.project = project;
-      this.branch = branch;
-      this.path = path;
-    }
-
-    @Override
-    public int hashCode() {
-      return Objects.hash(branch, path, project);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-      if (this == obj) {
-        return true;
-      }
-
-      if (obj == null) {
-        return false;
-      }
-
-      if (getClass() != obj.getClass()) {
-        return false;
-      }
-
-      Key other = (Key) obj;
-      return Objects.equals(branch, other.branch)
-          && Objects.equals(path, other.path)
-          && Objects.equals(project, other.project);
-    }
-
-    @Override
-    public String toString() {
-      StringBuilder builder = new StringBuilder();
-      builder.append("Key [project=");
-      builder.append(project);
-      builder.append(", branch=");
-      builder.append(branch);
-      builder.append(", path=");
-      builder.append(path);
-      builder.append("]");
-      return builder.toString();
-    }
-  }
-
-  @Singleton
-  class OwnersRefUpdateListener implements GitBatchRefUpdateListener {
-    private final PathOwnersEntriesCache cache;
-    private final String allUsersName;
-
-    @Inject
-    OwnersRefUpdateListener(PathOwnersEntriesCache cache, AllUsersName allUsersName) {
-      this.cache = cache;
-      this.allUsersName = allUsersName.get();
-    }
-
-    @Override
-    public void onGitBatchRefUpdate(GitBatchRefUpdateListener.Event event) {
-      String projectName = event.getProjectName();
-      if (!allUsersName.equals(projectName)) {
-        event.getUpdatedRefs().stream()
-            .filter(refUpdate -> supportedEvent(refUpdate.getRefName()))
-            .forEach(refUpdate -> cache.invalidate(projectName, refUpdate.getRefName()));
-      }
-    }
-
-    private boolean supportedEvent(String refName) {
-      return (refName.equals(RefNames.REFS_CONFIG) || !RefNames.isGerritRef(refName));
-    }
-  }
-
-  @Singleton
-  class OwnersCacheRemovalListener implements CacheRemovalListener<Key, PathOwnersEntry> {
-    private final PathOwnersEntriesCache cache;
-    private final String cacheName;
-
-    @Inject
-    OwnersCacheRemovalListener(@PluginName String pluginName, PathOwnersEntriesCache cache) {
-      this.cache = cache;
-      this.cacheName = String.format("%s.%s", pluginName, CACHE_NAME);
-    }
-
-    @Override
-    public void onRemoval(
-        String pluginName,
-        String cacheName,
-        RemovalNotification<Key, PathOwnersEntry> notification) {
-      if (!this.cacheName.equals(cacheName)) {
-        return;
-      }
-
-      cache.invalidateIndexKey(notification.getKey());
-    }
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCacheImpl.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCacheImpl.java
deleted file mode 100644
index c882414..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCacheImpl.java
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (C) 2023 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.HashMultimap;
-import com.google.common.collect.Multimap;
-import com.google.gerrit.entities.RefNames;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.google.inject.name.Named;
-import java.time.Duration;
-import java.util.Collection;
-import java.util.Optional;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-
-@Singleton
-class PathOwnersEntriesCacheImpl implements PathOwnersEntriesCache {
-
-  private final Cache<Key, Optional<OwnersConfig>> cache;
-  private final Multimap<String, Key> keysIndex;
-  private final LoadingCache<String, Object> keyLocks;
-
-  @Inject
-  PathOwnersEntriesCacheImpl(@Named(CACHE_NAME) Cache<Key, Optional<OwnersConfig>> cache) {
-    this.cache = cache;
-    this.keysIndex = HashMultimap.create();
-    this.keyLocks =
-        CacheBuilder.newBuilder()
-            .expireAfterAccess(Duration.ofMinutes(10L))
-            .build(CacheLoader.from(Object::new));
-  }
-
-  @Override
-  public Optional<OwnersConfig> get(
-      String project, String branch, String path, Callable<Optional<OwnersConfig>> loader)
-      throws ExecutionException {
-    Key key = new Key(project, branch, path);
-    return cache.get(
-        key,
-        () -> {
-          Optional<OwnersConfig> entry = loader.call();
-          String indexKey = indexKey(project, branch);
-          synchronized (keyLocks.getUnchecked(indexKey)) {
-            keysIndex.put(indexKey, key);
-          }
-          return entry;
-        });
-  }
-
-  @Override
-  public void invalidate(String project, String branch) {
-    String indexKey = indexKey(project, branch);
-    Collection<Key> keysToInvalidate;
-
-    synchronized (keyLocks.getUnchecked(indexKey)) {
-      keysToInvalidate = keysIndex.removeAll(indexKey);
-    }
-
-    keysToInvalidate.forEach(cache::invalidate);
-  }
-
-  @Override
-  public void invalidateIndexKey(Key key) {
-    String indexKey = indexKey(key.project, key.branch);
-
-    synchronized (keyLocks.getUnchecked(indexKey)) {
-      Collection<Key> values = keysIndex.asMap().get(indexKey);
-      if (values != null) {
-        values.remove(key);
-      }
-    }
-  }
-
-  private String indexKey(String project, String branch) {
-    return new StringBuilder(project).append('@').append(RefNames.fullName(branch)).toString();
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntry.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntry.java
deleted file mode 100644
index 8402642..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntry.java
+++ /dev/null
@@ -1,205 +0,0 @@
-// Copyright (c) 2013 VMware, Inc. All Rights Reserved.
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.common.base.Splitter;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * Path Owners Entry.
- *
- * <p>Used internally by PathOwners to represent and compute the owners at a specific path.
- */
-class PathOwnersEntry extends ReadOnlyPathOwnersEntry {
-  public PathOwnersEntry() {
-    super(true);
-  }
-
-  public PathOwnersEntry(
-      String path,
-      OwnersConfig config,
-      Accounts accounts,
-      Optional<LabelDefinition> inheritedLabel,
-      Set<Account.Id> inheritedOwners,
-      Set<Account.Id> inheritedReviewers,
-      Optional<Boolean> autoOwnersApproved,
-      Collection<Matcher> inheritedMatchers,
-      Set<String> inheritedGroupOwners) {
-    super(config.isInherited());
-    this.explicitAutoOwnersApproved = config.getAutoOwnersApproved() != InheritableBoolean.INHERIT;
-    this.ownersPath = path;
-    this.owners =
-        config.getOwners().stream()
-            .flatMap(o -> accounts.find(o).stream())
-            .collect(Collectors.toSet());
-    this.reviewers =
-        config.getReviewers().stream()
-            .flatMap(o -> accounts.find(o).stream())
-            .collect(Collectors.toSet());
-    this.groupOwners =
-        config.getOwners().stream()
-            .map(PathOwnersEntry::stripOwnerDomain)
-            .collect(Collectors.toSet());
-    this.matchers = config.getMatchers();
-
-    if (config.isInherited()) {
-      this.owners.addAll(inheritedOwners);
-      this.groupOwners.addAll(inheritedGroupOwners);
-      this.reviewers.addAll(inheritedReviewers);
-      if (config.getAutoOwnersApproved() == InheritableBoolean.INHERIT) {
-        autoOwnersApproved.ifPresent(this::setAutoOwnersApproved);
-      } else {
-        setAutoOwnersApproved(config.getAutoOwnersApproved() == InheritableBoolean.TRUE);
-      }
-      for (Matcher matcher : inheritedMatchers) {
-        addMatcher(matcher);
-      }
-      this.label = config.getLabel().or(() -> inheritedLabel);
-    } else {
-      this.label = config.getLabel();
-      // Default to false unless the OWNERS file explicitly sets it to true.
-      this.setAutoOwnersApproved(config.getAutoOwnersApproved() == InheritableBoolean.TRUE);
-    }
-  }
-
-  public void addMatcher(Matcher matcher) {
-    Matcher currMatchers = this.matchers.get(matcher.getPath());
-    this.matchers.put(matcher.getPath(), matcher.merge(currMatchers));
-  }
-
-  public void setOwners(Set<Account.Id> owners) {
-    this.owners = owners;
-  }
-
-  public void setReviewers(Set<Account.Id> reviewers) {
-    this.reviewers = reviewers;
-  }
-
-  public void setOwnersPath(String ownersPath) {
-    this.ownersPath = ownersPath;
-  }
-
-  public void setMatchers(Map<String, Matcher> matchers) {
-    this.matchers = matchers;
-  }
-
-  public void setLabel(Optional<LabelDefinition> label) {
-    this.label = label;
-  }
-
-  public void addMatchers(Collection<Matcher> values) {
-    for (Matcher matcher : values) {
-      addMatcher(matcher);
-    }
-  }
-
-  @Override
-  protected String className() {
-    return getClass().getSimpleName();
-  }
-}
-
-abstract class ReadOnlyPathOwnersEntry {
-  protected final boolean inherited;
-  protected Optional<LabelDefinition> label;
-  protected Set<Account.Id> owners = Sets.newHashSet();
-  protected Set<Account.Id> reviewers = Sets.newHashSet();
-  protected String ownersPath;
-  protected Map<String, Matcher> matchers = Maps.newHashMap();
-  protected Set<String> groupOwners = Sets.newHashSet();
-  protected boolean autoOwnersApproved;
-  protected boolean explicitAutoOwnersApproved;
-
-  protected ReadOnlyPathOwnersEntry(boolean inherited) {
-    this.inherited = inherited;
-    label = Optional.empty();
-  }
-
-  public Map<String, Matcher> getMatchers() {
-    return matchers;
-  }
-
-  public Set<Account.Id> getOwners() {
-    return owners;
-  }
-
-  public Set<String> getGroupOwners() {
-    return groupOwners;
-  }
-
-  public Set<Account.Id> getReviewers() {
-    return reviewers;
-  }
-
-  public String getOwnersPath() {
-    return ownersPath;
-  }
-
-  public boolean isInherited() {
-    return inherited;
-  }
-
-  public Optional<LabelDefinition> getLabel() {
-    return label;
-  }
-
-  public boolean isAutoOwnersApproved() {
-    return autoOwnersApproved;
-  }
-
-  public boolean hasExplicitAutoOwnersApproved() {
-    return explicitAutoOwnersApproved;
-  }
-
-  public void setAutoOwnersApproved(boolean autoOwnersApproved) {
-    this.autoOwnersApproved = autoOwnersApproved;
-  }
-
-  public boolean hasMatcher(String path) {
-    return this.matchers.containsKey(path);
-  }
-
-  public static String stripOwnerDomain(String owner) {
-    return Splitter.on('@').split(owner).iterator().next();
-  }
-
-  @Override
-  public String toString() {
-    return className()
-        + " [ownersPath="
-        + ownersPath
-        + ", owners="
-        + owners
-        + ", matchers="
-        + matchers
-        + ", label="
-        + label
-        + "]";
-  }
-
-  protected String className() {
-    return "ReadOnlyPathOwnersEntry";
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PluginSettings.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PluginSettings.java
deleted file mode 100644
index 951b133..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PluginSettings.java
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.common.base.Suppliers;
-import com.google.common.collect.ImmutableSet;
-import com.google.gerrit.entities.Project;
-import com.google.gerrit.extensions.annotations.PluginName;
-import com.google.gerrit.server.config.PluginConfig;
-import com.google.gerrit.server.config.PluginConfigFactory;
-import com.google.gerrit.server.project.NoSuchProjectException;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Optional;
-import java.util.function.Supplier;
-import org.eclipse.jgit.lib.Config;
-import org.eclipse.jgit.lib.Constants;
-
-/** Global owners plugin's settings defined globally or on a per-project basis. */
-@Singleton
-public class PluginSettings {
-  private final ImmutableSet<String> disabledBranchesPatterns;
-  private final PluginConfigFactory configFactory;
-  private final String ownersPluginName;
-  private final Config globalPluginConfig;
-  private final boolean expandGroups;
-  private final boolean enableSubmitRequirement;
-
-  private final Supplier<Optional<LabelDefinition>> globalLabel;
-
-  @Inject
-  public PluginSettings(PluginConfigFactory configFactory, @PluginName String ownersPluginName) {
-    this.configFactory = configFactory;
-    this.ownersPluginName = ownersPluginName;
-
-    this.globalPluginConfig = configFactory.getGlobalPluginConfig(ownersPluginName);
-    disabledBranchesPatterns =
-        ImmutableSet.copyOf(globalPluginConfig.getStringList("owners", "disable", "branch"));
-
-    this.expandGroups = globalPluginConfig.getBoolean("owners", "expandGroups", true);
-    this.enableSubmitRequirement =
-        globalPluginConfig.getBoolean("owners", "enableSubmitRequirement", false);
-
-    this.globalLabel =
-        Suppliers.memoize(
-            () -> LabelDefinition.parse(globalPluginConfig.getString("owners", null, "label")));
-  }
-
-  /**
-   * Branches that should be ignored for the OWNERS processing.
-   *
-   * @return set of branches regex
-   */
-  public ImmutableSet<String> disabledBranchPatterns() {
-    return disabledBranchesPatterns;
-  }
-
-  /**
-   * Check if the branch or ref is enabled for processing.
-   *
-   * <p>NOTE: If the branch does not start with 'refs/heads' it will then normalized into a
-   * ref-name.
-   *
-   * @param branch or ref name
-   * @return true if the branch or ref is disabled for processing.
-   */
-  public boolean isBranchDisabled(String branch) {
-    String normalizedRef = normalizeRef(branch);
-    return disabledBranchesPatterns.stream().anyMatch(normalizedRef::matches);
-  }
-
-  /** Returns true if the groups in the OWNERS file should be expanded in a list of account ids. */
-  public boolean expandGroups() {
-    return expandGroups;
-  }
-
-  /**
-   * @return <code>true</code> when OWNERS file should be evaluated through the submit rule
-   */
-  public boolean enableSubmitRequirement() {
-    return enableSubmitRequirement;
-  }
-
-  /**
-   * Project-specific config of the owners plugin.
-   *
-   * @param projectKey project name
-   * @return project-specific plugin config
-   * @throws NoSuchProjectException if the project cannot be found
-   */
-  public PluginConfig projectSpecificConfig(Project.NameKey projectKey)
-      throws NoSuchProjectException {
-    return configFactory.getFromProjectConfigWithInheritance(projectKey, ownersPluginName);
-  }
-
-  /**
-   * Global definition of the review label to use for the owners' plugin.
-   *
-   * <p>When the global label is set in the plugin.owners.label settings the value overrides any
-   * label name defined in the OWNERS files of any repository.
-   *
-   * @return the global label definition or {@link Optional#empty()} if there isn't any global label
-   *     definition.
-   */
-  public Optional<LabelDefinition> globalLabel() {
-    return globalLabel.get();
-  }
-
-  // Logic copied from JGit's TestRepository
-  private static String normalizeRef(String ref) {
-    if (Constants.HEAD.equals(ref)) {
-      // nothing
-    } else if ("FETCH_HEAD".equals(ref)) {
-      // nothing
-    } else if ("MERGE_HEAD".equals(ref)) {
-      // nothing
-    } else if (ref.startsWith(Constants.R_REFS)) {
-      // nothing
-    } else ref = Constants.R_HEADS + ref;
-    return ref;
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/RegExMatcher.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/RegExMatcher.java
deleted file mode 100644
index d7920a8..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/RegExMatcher.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-public class RegExMatcher extends Matcher {
-  Pattern pattern;
-
-  public RegExMatcher(
-      String path,
-      Set<Account.Id> owners,
-      Set<Account.Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved) {
-    super(path, owners, reviewers, groupOwners, autoOwnersApproved);
-    pattern = Pattern.compile(path);
-  }
-
-  @Override
-  public boolean matches(String pathToMatch) {
-    return pattern.matcher(pathToMatch).matches();
-  }
-
-  @Override
-  protected Matcher clone(
-      Set<Id> owners,
-      Set<Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved) {
-    return new RegExMatcher(path, owners, reviewers, groupOwners, autoOwnersApproved);
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/StreamUtils.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/StreamUtils.java
deleted file mode 100644
index 0f8bac3..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/StreamUtils.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import java.util.Iterator;
-import java.util.stream.Stream;
-import java.util.stream.StreamSupport;
-
-public class StreamUtils {
-
-  public static <T> Stream<T> iteratorStream(Iterator<T> sourceIterator) {
-    Iterable<T> iterable = () -> sourceIterator;
-    return StreamSupport.stream(iterable.spliterator(), false);
-  }
-}
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/SuffixMatcher.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/SuffixMatcher.java
deleted file mode 100644
index b9a2fdb..0000000
--- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/SuffixMatcher.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Account.Id;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.util.Set;
-
-public class SuffixMatcher extends Matcher {
-  public SuffixMatcher(
-      String path,
-      Set<Account.Id> owners,
-      Set<Account.Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved) {
-    super(path, owners, reviewers, groupOwners, autoOwnersApproved);
-  }
-
-  @Override
-  public boolean matches(String pathToMatch) {
-    return pathToMatch.endsWith(path);
-  }
-
-  @Override
-  protected Matcher clone(
-      Set<Id> owners,
-      Set<Id> reviewers,
-      Set<String> groupOwners,
-      InheritableBoolean autoOwnersApproved) {
-    return new SuffixMatcher(path, owners, reviewers, groupOwners, autoOwnersApproved);
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/ClassicConfig.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/ClassicConfig.java
deleted file mode 100644
index a9e78b1..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/ClassicConfig.java
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import org.junit.Ignore;
-
-@Ignore
-public class ClassicConfig extends Config {
-  public static final String USER_A = "user-a";
-  public static final String USER_B = "user-b";
-  public static final String USER_C = "user-c";
-  public static final String EMAIL_DOMAIN = "@email.com";
-  public static final String USER_A_EMAIL_COM = USER_A + EMAIL_DOMAIN;
-  public static final String USER_B_EMAIL_COM = USER_B + EMAIL_DOMAIN;
-  public static final String USER_C_EMAIL_COM = USER_C + EMAIL_DOMAIN;
-  public static final Account.Id USER_A_ID = Account.id(1);
-  public static final Account.Id USER_B_ID = Account.id(2);
-  public static final Account.Id USER_C_ID = Account.id(3);
-
-  @Override
-  public void setup() throws Exception {
-    accounts.put(USER_A_EMAIL_COM, USER_A_ID);
-    accounts.put(USER_B_EMAIL_COM, USER_B_ID);
-    accounts.put(USER_C_EMAIL_COM, USER_C_ID);
-
-    super.setup();
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/Config.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/Config.java
deleted file mode 100644
index e531a3f..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/Config.java
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-
-import com.google.common.base.Charsets;
-import com.google.gerrit.entities.Patch;
-import com.google.gerrit.server.git.GitRepositoryManager;
-import com.google.gerrit.server.patch.PatchListEntry;
-import java.io.IOException;
-import java.util.Optional;
-import org.eclipse.jgit.lib.Repository;
-import org.junit.Ignore;
-import org.powermock.api.easymock.PowerMock;
-
-@Ignore
-public abstract class Config {
-  protected GitRepositoryManager repositoryManager;
-  protected Repository repository;
-  protected Repository parentRepository1;
-  protected Repository parentRepository2;
-  protected ConfigurationParser parser;
-  protected TestAccounts accounts = new TestAccounts();
-  protected Optional<String> branch = Optional.of("master");
-
-  public void setup() throws Exception {
-    PowerMock.mockStatic(JgitWrapper.class);
-
-    repositoryManager = PowerMock.createMock(GitRepositoryManager.class);
-    repository = PowerMock.createMock(Repository.class);
-    parentRepository1 = PowerMock.createMock(Repository.class);
-    parentRepository2 = PowerMock.createMock(Repository.class);
-    parser = new ConfigurationParser(accounts);
-  }
-
-  void expectConfig(String path, String config) throws IOException {
-    expect(
-            JgitWrapper.getBlobAsBytes(
-                anyObject(Repository.class), anyObject(String.class), eq(path)))
-        .andReturn(Optional.of(config.getBytes()))
-        .anyTimes();
-  }
-
-  void expectConfig(String path, String branch, String config) throws IOException {
-    expect(JgitWrapper.getBlobAsBytes(anyObject(Repository.class), eq(branch), eq(path)))
-        .andReturn(Optional.of(config.getBytes()))
-        .anyTimes();
-  }
-
-  void expectConfig(String path, String branch, Repository repo, String config) throws IOException {
-    expect(JgitWrapper.getBlobAsBytes(eq(repo), eq(branch), eq(path)))
-        .andReturn(Optional.of(config.getBytes()))
-        .anyTimes();
-  }
-
-  void expectNoConfig(String path) throws IOException {
-    expect(
-            JgitWrapper.getBlobAsBytes(
-                anyObject(Repository.class), anyObject(String.class), eq(path)))
-        .andReturn(Optional.empty())
-        .anyTimes();
-  }
-
-  PatchListEntry expectEntry(String name) {
-    PatchListEntry entry = PowerMock.createMock(PatchListEntry.class);
-    expect(entry.getNewName()).andReturn(name).anyTimes();
-    expect(entry.getChangeType()).andReturn(Patch.ChangeType.MODIFIED).anyTimes();
-    expect(entry.getDeletions()).andReturn(1);
-    expect(entry.getInsertions()).andReturn(1);
-    return entry;
-  }
-
-  OwnersConfig getOwnersConfig(String string) throws IOException {
-    return parser.getOwnersConfig(string.getBytes(Charsets.UTF_8));
-  }
-
-  String createConfig(boolean inherited, String[] owners, MatcherConfig... matchers) {
-    return createConfig(inherited, Optional.empty(), owners, matchers);
-  }
-
-  String createConfig(
-      boolean inherited, Optional<String> label, String[] owners, MatcherConfig... matchers) {
-    StringBuilder sb = new StringBuilder();
-    sb.append("inherited: " + inherited + "\n");
-    label.ifPresent(l -> sb.append("label: " + l + "\n"));
-    if (owners.length > 0) {
-      sb.append("owners: \n");
-      for (String owner : owners) {
-        sb.append("- " + owner + "\n");
-      }
-    }
-    if (matchers.length > 0) {
-      sb.append("matchers: \n");
-      for (MatcherConfig matcher : matchers) {
-        sb.append(matcher.toYaml());
-      }
-    }
-    return sb.toString();
-  }
-
-  public String[] owners(String... owners) {
-    return owners;
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/LabelDefinitionTest.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/LabelDefinitionTest.java
deleted file mode 100644
index 126e239..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/LabelDefinitionTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (C) 2023 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.common.truth.Truth8.assertThat;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Optional;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-@RunWith(Parameterized.class)
-public class LabelDefinitionTest {
-  @Parameterized.Parameters
-  public static Collection<Object[]> labels() {
-    return Arrays.asList(
-        new Object[][] {
-          {null, Optional.empty()},
-          {"", Optional.empty()},
-          {"foo,", Optional.empty()},
-          {"foo", Optional.of(new LabelDefinition("foo", null))},
-          {"foo,1", Optional.of(new LabelDefinition("foo", (short) 1))},
-          {"foo, 1", Optional.of(new LabelDefinition("foo", (short) 1))},
-          {"foo , 1", Optional.of(new LabelDefinition("foo", (short) 1))},
-          {"foo ,1 ", Optional.of(new LabelDefinition("foo", (short) 1))}
-        });
-  }
-
-  private final String input;
-  private final Optional<LabelDefinition> expected;
-
-  public LabelDefinitionTest(String input, Optional<LabelDefinition> expected) {
-    this.input = input;
-    this.expected = expected;
-  }
-
-  @Test
-  public void shouldParseLabelDefinition() {
-    // when
-    Optional<LabelDefinition> result = LabelDefinition.parse(input);
-
-    // then
-    assertThat(result).isEqualTo(expected);
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/MatcherConfig.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/MatcherConfig.java
deleted file mode 100644
index 51e0b74..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/MatcherConfig.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import org.junit.Ignore;
-
-@Ignore
-public class MatcherConfig {
-  public static final String MATCH_EXACT = "exact";
-  public static final String MATCH_REGEX = "regex";
-  public static final String MATCH_SUFFIX = "suffix";
-  public static final String MATCH_PARTIAL_REGEX = "partial_regex";
-  public static final String MATCH_GENERIC = "generic";
-
-  private final String matchType;
-  private final String matchExpr;
-  private final String[] owners;
-
-  public static MatcherConfig exactMatcher(String expr, String... owners) {
-    return new MatcherConfig(MATCH_EXACT, expr, owners);
-  }
-
-  public static MatcherConfig regexMatcher(String expr, String... owners) {
-    return new MatcherConfig(MATCH_REGEX, expr, owners);
-  }
-
-  public static MatcherConfig suffixMatcher(String expr, String... owners) {
-    return new MatcherConfig(MATCH_SUFFIX, expr, owners);
-  }
-
-  public static MatcherConfig partialRegexMatcher(String expr, String... owners) {
-    return new MatcherConfig(MATCH_PARTIAL_REGEX, expr, owners);
-  }
-
-  public static MatcherConfig genericMatcher(String expr, String... owners) {
-    return new MatcherConfig(MATCH_GENERIC, expr, owners);
-  }
-
-  public MatcherConfig(String matchType, String matchExpr, String[] owners) {
-    super();
-    this.matchType = matchType;
-    this.matchExpr = matchExpr;
-    this.owners = owners;
-  }
-
-  public String toYaml() {
-    StringBuilder sb = new StringBuilder();
-    sb.append("- " + matchType + ": " + matchExpr + "\n");
-    sb.append("  owners: \n");
-    for (String owner : owners) {
-      sb.append("  - " + owner + "\n");
-    }
-    return sb.toString();
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/MatcherMergeTest.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/MatcherMergeTest.java
deleted file mode 100644
index a36383a..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/MatcherMergeTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (C) 2026 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.util.Set;
-import org.junit.Test;
-
-public class MatcherMergeTest {
-  @Test
-  public void mergeAutoOwnersApprovedKeepsCurrentWhenOtherUnset() {
-    assertThatMatchersMergeAs(
-        InheritableBoolean.TRUE, InheritableBoolean.INHERIT, InheritableBoolean.TRUE);
-  }
-
-  @Test
-  public void mergeAutoOwnersApprovedUsesOtherWhenOtherIsFalse() {
-    assertThatMatchersMergeAs(
-        InheritableBoolean.INHERIT, InheritableBoolean.FALSE, InheritableBoolean.FALSE);
-  }
-
-  @Test
-  public void mergeAutoOwnersApprovedUsesOtherWhenOtherIsTrue() {
-    assertThatMatchersMergeAs(
-        InheritableBoolean.FALSE, InheritableBoolean.TRUE, InheritableBoolean.TRUE);
-  }
-
-  @Test
-  public void mergeUnsetAutoOwnersApprovedIsUnset() {
-    assertThatMatchersMergeAs(
-        InheritableBoolean.INHERIT, InheritableBoolean.INHERIT, InheritableBoolean.INHERIT);
-  }
-
-  private void assertThatMatchersMergeAs(
-      InheritableBoolean baseMatcherBool,
-      InheritableBoolean otherMatcherBool,
-      InheritableBoolean mergedMatcherBool) {
-    Matcher baseTrue = new TestMatcher(baseMatcherBool);
-    Matcher otherUnset = new TestMatcher(otherMatcherBool);
-    Matcher mergedUnsetOther = baseTrue.merge(otherUnset);
-    assertThat(mergedUnsetOther.getAutoOwnersApproved()).isEqualTo(mergedMatcherBool);
-  }
-
-  private static class TestMatcher extends Matcher {
-    private TestMatcher(InheritableBoolean autoOwnersApproved) {
-      super(
-          "test",
-          java.util.Set.of(Account.id(1)),
-          java.util.Set.of(Account.id(2)),
-          java.util.Set.of("grp"),
-          autoOwnersApproved);
-    }
-
-    @Override
-    public boolean matches(String pathToMatch) {
-      return true;
-    }
-
-    @Override
-    protected Matcher clone(
-        Set<Account.Id> owners,
-        Set<Account.Id> reviewers,
-        Set<String> groupOwners,
-        InheritableBoolean autoOwnersApproval) {
-      return new TestMatcher(autoOwnersApproval);
-    }
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/OwnersBatchRefUpdateListenerTest.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/OwnersBatchRefUpdateListenerTest.java
deleted file mode 100644
index fe99ad3..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/OwnersBatchRefUpdateListenerTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (C) 2023 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import com.google.gerrit.entities.RefNames;
-import com.google.gerrit.extensions.events.GitBatchRefUpdateListener;
-import com.google.gerrit.server.config.AllProjectsNameProvider;
-import com.google.gerrit.server.config.AllUsersName;
-import com.google.gerrit.server.config.AllUsersNameProvider;
-import com.googlesource.gerrit.owners.common.PathOwnersEntriesCache.OwnersRefUpdateListener;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-@RunWith(Parameterized.class)
-public class OwnersBatchRefUpdateListenerTest {
-  @Parameterized.Parameters
-  public static Collection<Object[]> events() {
-    return Arrays.asList(
-        new Object[][] {
-          {mockEvent(ALL_USERS_NAME.get(), RefNames.REFS_CONFIG), 0},
-          {mockEvent(AllProjectsNameProvider.DEFAULT, RefNames.REFS_CHANGES), 0},
-          {mockEvent(AllProjectsNameProvider.DEFAULT, RefNames.REFS_SEQUENCES), 0},
-          {mockEvent(AllProjectsNameProvider.DEFAULT, RefNames.REFS_CONFIG), 1},
-          {
-            mockEvent(
-                AllProjectsNameProvider.DEFAULT, RefNames.REFS_CONFIG, RefNames.REFS_SEQUENCES),
-            1
-          },
-          {mockEvent("foo", RefNames.fullName("bar")), 1},
-          {mockEvent("foo", RefNames.REFS_CONFIG), 1},
-          {mockEvent("foo", RefNames.REFS_CONFIG, RefNames.fullName("bar")), 2}
-        });
-  }
-
-  private static AllUsersName ALL_USERS_NAME = new AllUsersName(AllUsersNameProvider.DEFAULT);
-
-  private final GitBatchRefUpdateListener.Event input;
-  private final int expectedTimes;
-
-  public OwnersBatchRefUpdateListenerTest(
-      GitBatchRefUpdateListener.Event input, int expectedTimes) {
-    this.input = input;
-    this.expectedTimes = expectedTimes;
-  }
-
-  @Test
-  public void shouldTriggerCacheInvalidationAccordingly() {
-    // given
-    PathOwnersEntriesCache cachMock = mock(PathOwnersEntriesCache.class);
-    OwnersRefUpdateListener listener = new OwnersRefUpdateListener(cachMock, ALL_USERS_NAME);
-
-    // when
-    listener.onGitBatchRefUpdate(input);
-
-    // then
-    verify(cachMock, times(expectedTimes)).invalidate(anyString(), anyString());
-  }
-
-  private static GitBatchRefUpdateListener.Event mockEvent(String project, String... refs) {
-    GitBatchRefUpdateListener.Event eventMock = mock(GitBatchRefUpdateListener.Event.class);
-    when(eventMock.getProjectName()).thenReturn(project);
-    Set<GitBatchRefUpdateListener.UpdatedRef> updatedRefs =
-        Stream.of(refs)
-            .map(
-                ref -> {
-                  GitBatchRefUpdateListener.UpdatedRef updatedRef =
-                      mock(GitBatchRefUpdateListener.UpdatedRef.class);
-                  when(updatedRef.getRefName()).thenReturn(ref);
-                  return updatedRef;
-                })
-            .collect(Collectors.toSet());
-    when(eventMock.getUpdatedRefs()).thenReturn(updatedRefs);
-    return eventMock;
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCacheMock.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCacheMock.java
deleted file mode 100644
index 752bf7f..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCacheMock.java
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (C) 2023 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import java.util.Optional;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import org.junit.Ignore;
-
-/** This is a test implementation that doesn't cache anything but calls loader instead. */
-@Ignore
-public class PathOwnersEntriesCacheMock implements PathOwnersEntriesCache {
-  int hit = 0;
-
-  @Override
-  public void invalidate(String project, String branch) {}
-
-  @Override
-  public void invalidateIndexKey(Key key) {}
-
-  @Override
-  public Optional<OwnersConfig> get(
-      String project, String branch, String path, Callable<Optional<OwnersConfig>> loader)
-      throws ExecutionException {
-    try {
-      hit++;
-      return loader.call();
-    } catch (Exception e) {
-      throw new ExecutionException(e);
-    }
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/PathOwnersTest.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/PathOwnersTest.java
deleted file mode 100644
index 134eeda..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/PathOwnersTest.java
+++ /dev/null
@@ -1,634 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.common.truth.Truth.assertThat;
-import static com.googlesource.gerrit.owners.common.MatcherConfig.suffixMatcher;
-import static java.util.Collections.emptyList;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.powermock.api.easymock.PowerMock.replayAll;
-
-import com.google.common.truth.Truth8;
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.entities.Project;
-import com.google.gerrit.entities.RefNames;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import org.eclipse.jgit.lib.Repository;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.powermock.core.classloader.annotations.PowerMockIgnore;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PowerMockIgnore("jdk.internal.reflect.*")
-@PrepareForTest(JgitWrapper.class)
-public class PathOwnersTest extends ClassicConfig {
-
-  private static final String CLASSIC_OWNERS = "classic/OWNERS";
-  private static final boolean EXPAND_GROUPS = true;
-  private static final boolean DO_NOT_EXPAND_GROUPS = false;
-  private static final String EXPECTED_LABEL = "expected-label";
-  private static final Short EXPECTED_LABEL_SCORE = 1;
-  private static final LabelDefinition EXPECTED_LABEL_DEFINITION =
-      new LabelDefinition(EXPECTED_LABEL, EXPECTED_LABEL_SCORE);
-  private static final String A_LABEL = "a-label";
-  private static final String B_LABEL = "b-label";
-  private static PathOwnersEntriesCache CACHE_MOCK = new PathOwnersEntriesCacheMock();
-
-  public static final String CLASSIC_FILE_TXT = "classic/file.txt";
-  public static final Project.NameKey parentRepository1NameKey =
-      Project.NameKey.parse("parentRepository1");
-  public static final Project.NameKey parentRepository2NameKey =
-      Project.NameKey.parse("parentRepository2");
-
-  @Override
-  @Before
-  public void setup() throws Exception {
-    super.setup();
-  }
-
-  @Test
-  public void testClassic() throws Exception {
-    mockOwners(USER_A_EMAIL_COM, USER_B_EMAIL_COM);
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of(CLASSIC_FILE_TXT),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-    Set<Account.Id> ownersSet = owners.get().get(CLASSIC_OWNERS);
-    assertEquals(2, ownersSet.size());
-    assertTrue(ownersSet.contains(USER_A_ID));
-    assertTrue(ownersSet.contains(USER_B_ID));
-    assertTrue(owners.expandGroups());
-    Truth8.assertThat(owners.getLabel()).isEmpty();
-  }
-
-  @Test
-  public void testGlobalLabel() throws Exception {
-    mockOwners(USER_A_EMAIL_COM, USER_B_EMAIL_COM);
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of(CLASSIC_FILE_TXT),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.of(EXPECTED_LABEL_DEFINITION));
-    Truth8.assertThat(owners.getLabel()).hasValue(EXPECTED_LABEL_DEFINITION);
-  }
-
-  @Test
-  public void testFileBasedOwnersUnexpanded() throws Exception {
-    mockOwners(USER_A_EMAIL_COM, USER_B_EMAIL_COM);
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of(CLASSIC_FILE_TXT),
-            DO_NOT_EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-    Set<String> ownersSet = owners.getFileGroupOwners().get(CLASSIC_FILE_TXT);
-    assertEquals(2, ownersSet.size());
-    assertTrue(ownersSet.contains(USER_A));
-    assertTrue(ownersSet.contains(USER_B));
-    assertFalse(owners.expandGroups());
-  }
-
-  @Test
-  public void testDisabledBranch() throws Exception {
-    mockOwners(USER_A_EMAIL_COM);
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            Optional.empty(),
-            Set.of(CLASSIC_FILE_TXT),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-    Set<Account.Id> ownersSet = owners.get().get(CLASSIC_OWNERS);
-    assertEquals(0, ownersSet.size());
-  }
-
-  @Test
-  public void testClassicWithInheritance() throws Exception {
-    expectConfig("OWNERS", createConfig(true, Optional.of(A_LABEL), owners(USER_C_EMAIL_COM)));
-    expectConfig(
-        CLASSIC_OWNERS,
-        createConfig(
-            true, Optional.of(EXPECTED_LABEL), owners(USER_A_EMAIL_COM, USER_B_EMAIL_COM)));
-
-    replayAll();
-
-    PathOwners owners2 =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of("classic/file.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-    Set<Account.Id> ownersSet2 = owners2.get().get(CLASSIC_OWNERS);
-
-    // in this case we are inheriting the acct3 from /OWNERS
-    assertEquals(3, ownersSet2.size());
-    assertTrue(ownersSet2.contains(USER_A_ID));
-    assertTrue(ownersSet2.contains(USER_B_ID));
-    assertTrue(ownersSet2.contains(USER_C_ID));
-
-    // expect that classic configuration takes precedence over `OWNERS` file for the label
-    // definition
-    Truth8.assertThat(owners2.getLabel().map(LabelDefinition::getName)).hasValue(EXPECTED_LABEL);
-  }
-
-  @Test
-  public void testClassicWithInheritanceAndGlobalLabel() throws Exception {
-    expectConfig("OWNERS", createConfig(true, Optional.of(A_LABEL), owners()));
-    expectConfig(CLASSIC_OWNERS, createConfig(true, Optional.of(B_LABEL), owners()));
-
-    replayAll();
-
-    PathOwners owners2 =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of("classic/file.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.of(EXPECTED_LABEL_DEFINITION));
-    Truth8.assertThat(owners2.getLabel()).hasValue(EXPECTED_LABEL_DEFINITION);
-  }
-
-  @Test
-  public void testClassicWithoutInheritanceAndGlobalLabel() throws Exception {
-    expectConfig("OWNERS", createConfig(false, Optional.of(A_LABEL), owners()));
-    expectConfig(CLASSIC_OWNERS, createConfig(false, Optional.of(B_LABEL), owners()));
-
-    replayAll();
-
-    PathOwners owners2 =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of("classic/file.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.of(EXPECTED_LABEL_DEFINITION));
-    Truth8.assertThat(owners2.getLabel()).hasValue(EXPECTED_LABEL_DEFINITION);
-  }
-
-  @Test
-  public void testRootInheritFromProject() throws Exception {
-    expectConfig("OWNERS", "master", createConfig(true, owners()));
-    expectConfig(
-        "OWNERS",
-        RefNames.REFS_CONFIG,
-        createConfig(
-            true,
-            Optional.of(EXPECTED_LABEL),
-            owners(),
-            suffixMatcher(".sql", USER_A_EMAIL_COM, USER_B_EMAIL_COM)));
-
-    String fileName = "file.sql";
-    replayAll();
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of(fileName),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-
-    Map<String, Set<Account.Id>> fileOwners = owners.getFileOwners();
-    assertEquals(1, fileOwners.size());
-
-    Set<Account.Id> ownersSet = fileOwners.get(fileName);
-    assertEquals(2, ownersSet.size());
-    assertTrue(ownersSet.contains(USER_A_ID));
-    assertTrue(ownersSet.contains(USER_B_ID));
-    Truth8.assertThat(owners.getLabel().map(LabelDefinition::getName)).hasValue(EXPECTED_LABEL);
-  }
-
-  @Test
-  public void testProjectInheritFromParentProject() throws Exception {
-    expectConfig("OWNERS", "master", createConfig(true, Optional.of(EXPECTED_LABEL), owners()));
-    expectConfig(
-        "OWNERS",
-        RefNames.REFS_CONFIG,
-        repository,
-        createConfig(true, Optional.of("foo"), owners()));
-    expectConfig(
-        "OWNERS",
-        RefNames.REFS_CONFIG,
-        parentRepository1,
-        createConfig(
-            true,
-            Optional.of(A_LABEL),
-            owners(),
-            suffixMatcher(".sql", USER_A_EMAIL_COM, USER_B_EMAIL_COM)));
-
-    String fileName = "file.sql";
-
-    mockParentRepository(parentRepository1NameKey, parentRepository1);
-    replayAll();
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            Arrays.asList(parentRepository1NameKey),
-            branch,
-            Set.of(fileName),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-
-    Map<String, Set<Account.Id>> fileOwners = owners.getFileOwners();
-    assertEquals(fileOwners.size(), 1);
-
-    Set<Account.Id> ownersSet = fileOwners.get(fileName);
-    assertEquals(2, ownersSet.size());
-    assertTrue(ownersSet.contains(USER_A_ID));
-    assertTrue(ownersSet.contains(USER_B_ID));
-
-    // expect that `master` configuration overwrites the label definition of both `refs/meta/config`
-    // and parent repo
-    Truth8.assertThat(owners.getLabel().map(LabelDefinition::getName)).hasValue(EXPECTED_LABEL);
-  }
-
-  @Test
-  public void testProjectInheritFromMultipleParentProjects() throws Exception {
-    expectConfig("OWNERS", "master", createConfig(true, owners()));
-    expectConfig("OWNERS", RefNames.REFS_CONFIG, repository, createConfig(true, owners()));
-    expectConfig(
-        "OWNERS",
-        RefNames.REFS_CONFIG,
-        parentRepository1,
-        createConfig(
-            true, Optional.of(EXPECTED_LABEL), owners(), suffixMatcher(".sql", USER_A_EMAIL_COM)));
-    expectConfig(
-        "OWNERS",
-        RefNames.REFS_CONFIG,
-        parentRepository2,
-        createConfig(
-            true, Optional.of(A_LABEL), owners(), suffixMatcher(".java", USER_B_EMAIL_COM)));
-
-    String sqlFileName = "file.sql";
-    String javaFileName = "file.java";
-
-    mockParentRepository(parentRepository1NameKey, parentRepository1);
-    mockParentRepository(parentRepository2NameKey, parentRepository2);
-    replayAll();
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            Arrays.asList(parentRepository1NameKey, parentRepository2NameKey),
-            branch,
-            Set.of(sqlFileName, javaFileName),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-
-    Map<String, Set<Account.Id>> fileOwners = owners.getFileOwners();
-    assertEquals(fileOwners.size(), 2);
-
-    Set<Account.Id> ownersSet1 = fileOwners.get(sqlFileName);
-    assertEquals(1, ownersSet1.size());
-    assertTrue(ownersSet1.contains(USER_A_ID));
-
-    Set<Account.Id> ownersSet2 = fileOwners.get(javaFileName);
-    assertEquals(1, ownersSet2.size());
-    assertTrue(ownersSet2.contains(USER_B_ID));
-
-    // expect that closer parent (parentRepository1) overwrites the label definition
-    Truth8.assertThat(owners.getLabel().map(LabelDefinition::getName)).hasValue(EXPECTED_LABEL);
-  }
-
-  private void mockParentRepository(Project.NameKey repositoryName, Repository repository)
-      throws IOException {
-    expect(repositoryManager.openRepository(eq(repositoryName))).andReturn(repository).anyTimes();
-    repository.close();
-    expectLastCall();
-  }
-
-  @Test
-  public void testClassicWithInheritanceAndDeepNesting() throws Exception {
-    expectConfig("OWNERS", createConfig(true, owners(USER_C_EMAIL_COM)));
-    expectConfig("dir/OWNERS", createConfig(true, Optional.of(A_LABEL), owners(USER_B_EMAIL_COM)));
-    expectConfig(
-        "dir/subdir/OWNERS",
-        createConfig(true, Optional.of(EXPECTED_LABEL), owners(USER_A_EMAIL_COM)));
-
-    replayAll();
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of("dir/subdir/file.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-    Set<Account.Id> ownersSet = owners.get().get("dir/subdir/OWNERS");
-
-    assertEquals(3, ownersSet.size());
-    assertTrue(ownersSet.contains(USER_A_ID));
-    assertTrue(ownersSet.contains(USER_B_ID));
-    assertTrue(ownersSet.contains(USER_C_ID));
-
-    // expect that more specific configuration overwrites the label definition
-    Truth8.assertThat(owners.getLabel().map(LabelDefinition::getName)).hasValue(EXPECTED_LABEL);
-  }
-
-  @Test
-  public void testParsingYamlWithLabelWithScore() throws IOException {
-    String yamlString =
-        "inherited: true\nlabel: " + EXPECTED_LABEL + ",1\nowners:\n- " + USER_C_EMAIL_COM;
-    OwnersConfig ownersConfig = getOwnersConfig(yamlString);
-
-    assertTrue(ownersConfig.isInherited());
-    Truth8.assertThat(ownersConfig.getLabel()).isPresent();
-
-    LabelDefinition label = ownersConfig.getLabel().get();
-    assertThat(label.getName()).isEqualTo(EXPECTED_LABEL);
-    Truth8.assertThat(label.getScore()).hasValue(1);
-
-    Set<String> owners = ownersConfig.getOwners();
-    assertEquals(1, owners.size());
-    assertTrue(owners.contains(USER_C_EMAIL_COM));
-  }
-
-  @Test
-  public void testParsingYamlWithLabelWithoutScore() throws IOException {
-    String yamlString =
-        "inherited: true\nlabel: " + EXPECTED_LABEL + "\nowners:\n- " + USER_C_EMAIL_COM;
-    OwnersConfig ownersConfig = getOwnersConfig(yamlString);
-
-    assertTrue(ownersConfig.isInherited());
-    Truth8.assertThat(ownersConfig.getLabel()).isPresent();
-
-    LabelDefinition label = ownersConfig.getLabel().get();
-    assertThat(label.getName()).isEqualTo(EXPECTED_LABEL);
-    Truth8.assertThat(label.getScore()).isEmpty();
-
-    Set<String> owners = ownersConfig.getOwners();
-    assertEquals(1, owners.size());
-    assertTrue(owners.contains(USER_C_EMAIL_COM));
-  }
-
-  @Test
-  public void testPathOwnersEntriesCacheIsCalled() throws Exception {
-    expectConfig("OWNERS", "master", createConfig(true, Optional.of(EXPECTED_LABEL), owners()));
-    expectConfig(
-        "OWNERS",
-        RefNames.REFS_CONFIG,
-        repository,
-        createConfig(true, Optional.of("foo"), owners()));
-    expectConfig("dir/OWNERS", createConfig(true, Optional.of(A_LABEL), owners(USER_B_EMAIL_COM)));
-    expectConfig(
-        "dir/subdir/OWNERS",
-        createConfig(true, Optional.of(EXPECTED_LABEL), owners(USER_A_EMAIL_COM)));
-    expectConfig(
-        "OWNERS",
-        RefNames.REFS_CONFIG,
-        parentRepository1,
-        createConfig(true, Optional.of("bar"), owners()));
-
-    mockParentRepository(parentRepository1NameKey, parentRepository1);
-    replayAll();
-
-    PathOwnersEntriesCacheMock cacheMock = new PathOwnersEntriesCacheMock();
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            Arrays.asList(parentRepository1NameKey),
-            branch,
-            Set.of("dir/subdir/file.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            cacheMock,
-            Optional.empty());
-
-    assertThat(owners.getFileOwners()).isNotEmpty();
-    int expectedCacheCalls =
-        1 /* for refs/meta/config/OWNERS */
-            + 3 /* for each parent directory of 'file.txt' */
-            + 1 /* for parent's refs/meta/config/OWNERS */;
-    assertThat(cacheMock.hit).isEqualTo(expectedCacheCalls);
-  }
-
-  @Test
-  public void testAutoOwnersMisconfigured() throws Exception {
-    expectConfig("OWNERS", "inherited: true\nauto-owners-approved: \"some wrong value\"");
-
-    replayAll();
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of("file.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-
-    assertThat(owners.getFileOwnersAllowedAutoApproval()).isEmpty();
-    assertThat(owners.getFileOwners()).isEmpty();
-  }
-
-  @Test
-  public void testAutoOwnersApprovedInheritedFromRoot() throws Exception {
-    expectConfig(
-        "OWNERS",
-        "inherited: true\nauto-owners-approved: true\nowners:\n- " + USER_A_EMAIL_COM + "\n");
-    expectConfig("dir/OWNERS", "inherited: true\nowners:\n- " + USER_B_EMAIL_COM + "\n");
-
-    replayAll();
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of("dir/file.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-
-    assertThat(owners.getFileOwnersAllowedAutoApproval()).contains("dir/file.txt");
-  }
-
-  @Test
-  public void testAutoOwnersApprovedDefaultsWhenInheritanceStopped() throws Exception {
-    expectConfig(
-        "OWNERS",
-        "inherited: true\nauto-owners-approved: true\nowners:\n- " + USER_A_EMAIL_COM + "\n");
-    expectConfig("dir/OWNERS", "inherited: false\nowners:\n- " + USER_B_EMAIL_COM + "\n");
-
-    replayAll();
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of("dir/file.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-
-    assertThat(owners.getFileOwnersAllowedAutoApproval()).isEmpty();
-  }
-
-  @Test
-  public void testAutoOwnersApprovedInheritedFromParentProjectOwners() throws Exception {
-    expectConfig("OWNERS", "master", createConfig(true, owners()));
-    expectConfig("OWNERS", RefNames.REFS_CONFIG, repository, createConfig(true, owners()));
-    expectConfig(
-        "OWNERS",
-        RefNames.REFS_CONFIG,
-        parentRepository1,
-        "inherited: true\nauto-owners-approved: true\nowners:\n- " + USER_A_EMAIL_COM + "\n");
-
-    mockParentRepository(parentRepository1NameKey, parentRepository1);
-    replayAll();
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            Arrays.asList(parentRepository1NameKey),
-            branch,
-            Set.of("file.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-
-    assertThat(owners.getFileOwnersAllowedAutoApproval()).contains("file.txt");
-  }
-
-  @Test
-  public void testExplicitAutoOwnersApprovedInRootOverridesProjectOwners() throws Exception {
-    expectConfig(
-        "OWNERS",
-        "master",
-        "inherited: true\nauto-owners-approved: false\nowners:\n- " + USER_A_EMAIL_COM + "\n");
-    expectConfig(
-        "OWNERS",
-        RefNames.REFS_CONFIG,
-        repository,
-        "inherited: true\nauto-owners-approved: true\nowners:\n- " + USER_B_EMAIL_COM + "\n");
-
-    replayAll();
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of("file.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            CACHE_MOCK,
-            Optional.empty());
-
-    assertThat(owners.getFileOwnersAllowedAutoApproval()).isEmpty();
-  }
-
-  private void mockOwners(String... owners) throws IOException {
-    expectNoConfig("OWNERS");
-    expectConfig(CLASSIC_OWNERS, createConfig(false, owners(owners)));
-
-    replayAll();
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/PluginSettingsTest.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/PluginSettingsTest.java
deleted file mode 100644
index 2aecd88..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/PluginSettingsTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright (C) 2022 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Mockito.when;
-
-import com.google.gerrit.server.config.PluginConfigFactory;
-import java.util.Optional;
-import org.eclipse.jgit.lib.Config;
-import org.eclipse.jgit.lib.Constants;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-
-@RunWith(MockitoJUnitRunner.class)
-public class PluginSettingsTest {
-  private static final String PLUGIN_NAME = "plugin-name";
-  @Mock PluginConfigFactory mockPluginConfigFactory;
-
-  private PluginSettings pluginSettings;
-
-  public void setupMocks(Config pluginConfig) {
-    when(mockPluginConfigFactory.getGlobalPluginConfig(PLUGIN_NAME)).thenReturn(pluginConfig);
-    pluginSettings = new PluginSettings(mockPluginConfigFactory, PLUGIN_NAME);
-  }
-
-  @Test
-  public void allBranchesAreEnabledByDefault() {
-    setupMocks(new Config());
-
-    assertThat(pluginSettings.disabledBranchPatterns()).isEmpty();
-    assertThat(pluginSettings.isBranchDisabled("some-branch")).isFalse();
-  }
-
-  @Test
-  public void branchRefShouldBeDisabled() {
-    String branchName = "refs/heads/some-branch";
-    Config pluginConfig = new Config();
-    pluginConfig.setString("owners", "disable", "branch", branchName);
-    setupMocks(pluginConfig);
-
-    assertThat(pluginSettings.disabledBranchPatterns()).contains(branchName);
-    assertThat(pluginSettings.isBranchDisabled(branchName)).isTrue();
-  }
-
-  @Test
-  public void branchNameShouldBeDisabled() {
-    String branchName = "some-branch";
-    String branchRefName = Constants.R_HEADS + branchName;
-    Config pluginConfig = new Config();
-    pluginConfig.setString("owners", "disable", "branch", branchRefName);
-    setupMocks(pluginConfig);
-
-    assertThat(pluginSettings.disabledBranchPatterns()).contains(branchRefName);
-    assertThat(pluginSettings.isBranchDisabled(branchName)).isTrue();
-  }
-
-  @Test
-  public void branchNameShouldBeDisabledByRegex() {
-    String branchName1 = "some-branch-1";
-    String branchName2 = "some-branch-2";
-    String branchRefRegex = Constants.R_HEADS + "some-branch-\\d";
-    Config pluginConfig = new Config();
-    pluginConfig.setString("owners", "disable", "branch", branchRefRegex);
-    setupMocks(pluginConfig);
-
-    assertThat(pluginSettings.disabledBranchPatterns()).contains(branchRefRegex);
-    assertThat(pluginSettings.isBranchDisabled(branchName1)).isTrue();
-    assertThat(pluginSettings.isBranchDisabled(branchName2)).isTrue();
-  }
-
-  @Test
-  public void globalLabelIsEmptyByDefault() {
-    setupMocks(new Config());
-
-    assertThat(pluginSettings.globalLabel()).isEqualTo(Optional.empty());
-  }
-
-  @Test
-  public void globalLabelSetByConfig() {
-    LabelDefinition globalLabelName = new LabelDefinition("Custom-Label", (short) 2);
-    Config pluginConfig = new Config();
-    pluginConfig.setString("owners", null, "label", "Custom-Label,2");
-    setupMocks(pluginConfig);
-
-    assertThat(pluginSettings.globalLabel()).isEqualTo(Optional.of(globalLabelName));
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/RegexMatcherTest.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/RegexMatcherTest.java
deleted file mode 100644
index d157ebb..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/RegexMatcherTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class RegexMatcherTest {
-  @Test
-  public void testRegex() {
-    RegExMatcher matcher = new RegExMatcher(".*/a.*", null, null, null, null);
-    assertTrue(matcher.matches("xxxxxx/axxxx"));
-    assertFalse(matcher.matches("axxxx"));
-    assertFalse(matcher.matches("xxxxx/bxxxx"));
-
-    RegExMatcher matcher2 = new RegExMatcher("a.*.sql", null, null, null, null);
-    assertFalse(matcher2.matches("xxxxxx/alfa.sql"));
-  }
-
-  @Test
-  public void testFloatingRegex() {
-    PartialRegExMatcher matcher = new PartialRegExMatcher("a.*.sql", null, null, null, null);
-    assertTrue(matcher.matches("xxxxxxx/alfa.sql"));
-    assertTrue(matcher.matches("alfa.sqlxxxxx"));
-    assertFalse(matcher.matches("alfa.bar"));
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/RegexTest.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/RegexTest.java
deleted file mode 100644
index a6e10a6..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/RegexTest.java
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import static com.google.common.truth.Truth.assertThat;
-import static com.googlesource.gerrit.owners.common.MatcherConfig.exactMatcher;
-import static com.googlesource.gerrit.owners.common.MatcherConfig.genericMatcher;
-import static com.googlesource.gerrit.owners.common.MatcherConfig.partialRegexMatcher;
-import static com.googlesource.gerrit.owners.common.MatcherConfig.regexMatcher;
-import static com.googlesource.gerrit.owners.common.MatcherConfig.suffixMatcher;
-import static com.googlesource.gerrit.owners.common.StreamUtils.iteratorStream;
-import static java.util.Collections.emptyList;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.powermock.api.easymock.PowerMock.replayAll;
-
-import com.google.gerrit.entities.Account;
-import com.google.gerrit.extensions.client.InheritableBoolean;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.powermock.core.classloader.annotations.PowerMockIgnore;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PowerMockIgnore("jdk.internal.reflect.*")
-@PrepareForTest(JgitWrapper.class)
-public class RegexTest extends Config {
-
-  private static final String ACCOUNT_A = "a";
-  private static final String ACCOUNT_B = "b";
-  private static final String ACCOUNT_C = "c";
-  private static final String ACCOUNT_D = "d";
-  private static final String ACCOUNT_E = "e";
-  private static final String ACCOUNT_F = "f";
-  private static final Account.Id ACCOUNT_A_ID = Account.id(1);
-  private static final Account.Id ACCOUNT_B_ID = Account.id(2);
-  private static final Account.Id ACCOUNT_C_ID = Account.id(3);
-  private static final Account.Id ACCOUNT_D_ID = Account.id(4);
-  private static final Account.Id ACCOUNT_E_ID = Account.id(5);
-  private static final Account.Id ACCOUNT_F_ID = Account.id(6);
-  private static final boolean EXPAND_GROUPS = true;
-
-  @Override
-  @Before
-  public void setup() throws Exception {
-    accounts.put(ACCOUNT_A, ACCOUNT_A_ID);
-    accounts.put(ACCOUNT_B, ACCOUNT_B_ID);
-    accounts.put(ACCOUNT_C, ACCOUNT_C_ID);
-    accounts.put(ACCOUNT_D, ACCOUNT_D_ID);
-    accounts.put(ACCOUNT_E, ACCOUNT_E_ID);
-    accounts.put(ACCOUNT_F, ACCOUNT_F_ID);
-
-    super.setup();
-  }
-
-  @Test
-  public void testNewParsingYaml() throws Exception {
-    replayAll();
-
-    String fullConfig =
-        createConfig(
-            true,
-            owners(ACCOUNT_A),
-            suffixMatcher(".sql", ACCOUNT_B, ACCOUNT_C),
-            regexMatcher(".*/a.*", ACCOUNT_D),
-            partialRegexMatcher("Product.sql", ACCOUNT_A));
-    // the function to test
-    OwnersConfig config = getOwnersConfig(fullConfig);
-    // check classical configuration
-    assertTrue(config.isInherited());
-
-    Set<String> owners = config.getOwners();
-    assertEquals(1, owners.size());
-    assertTrue(owners.contains(ACCOUNT_A));
-    // check matchers
-    Map<String, Matcher> matchers = config.getMatchers();
-    assertEquals(3, matchers.size());
-    assertTrue(matchers.containsKey(".sql"));
-    assertTrue(matchers.containsKey(".*/a.*"));
-    assertTrue(matchers.containsKey("Product.sql"));
-
-    // suffix .sql matcher
-    Matcher advMatcher = matchers.get(".sql");
-    assertEquals(2, advMatcher.getOwners().size());
-    Set<Account.Id> advOwners = advMatcher.getOwners();
-    assertTrue(advOwners.contains(ACCOUNT_B_ID));
-    assertTrue(advOwners.contains(ACCOUNT_C_ID));
-
-    // regex matcher
-    Matcher dbMatcher = matchers.get(".*/a.*");
-    assertEquals(1, dbMatcher.getOwners().size());
-    Set<Account.Id> dbOwners = dbMatcher.getOwners();
-    assertTrue(dbOwners.contains(ACCOUNT_D_ID));
-
-    // partial_regex matcher
-    Matcher partial = matchers.get("Product.sql");
-    assertEquals(1, partial.getOwners().size());
-    Set<Account.Id> partialOwners = partial.getOwners();
-    assertTrue(partialOwners.contains(ACCOUNT_A_ID));
-  }
-
-  @Test
-  public void checkMatchers() throws Exception {
-    String parentConfig =
-        createConfig(
-            true,
-            owners(ACCOUNT_A),
-            suffixMatcher(".sql", ACCOUNT_B, ACCOUNT_C),
-            regexMatcher(".*/a.*", ACCOUNT_D));
-    String childConfig =
-        createConfig(
-            true,
-            owners(ACCOUNT_F),
-            exactMatcher("project/file.txt", ACCOUNT_D, ACCOUNT_E),
-            partialRegexMatcher("alfa", ACCOUNT_A));
-
-    expectConfig("OWNERS", parentConfig);
-    expectConfig("project/OWNERS", childConfig);
-
-    replayAll();
-
-    // function under test
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of(
-                "project/file.txt", // matches exact in
-                // project owners d,e
-                "file1.txt", // no matches so nothing for this
-                "project/afile2.sql", // matches two matchers so we have b,c,d
-                "project/bfile.txt", // no matching
-                "projectalfa", // matches PartialRegex
-                "project/file.sql"), // only .sql matching b,c
-            EXPAND_GROUPS,
-            "foo",
-            new PathOwnersEntriesCacheMock(),
-            Optional.empty());
-
-    // assertions on classic owners
-    Set<Account.Id> ownersSet = owners.get().get("project/OWNERS");
-    assertEquals(2, ownersSet.size());
-
-    // get matchers
-    Map<String, Matcher> matchers = owners.getMatchers();
-    assertEquals(4, matchers.size());
-
-    // asserts we have 1 exact matcher
-    List<Entry<String, Matcher>> onlyExacts =
-        iteratorStream(matchers.entrySet().iterator())
-            .filter(entry -> entry.getValue() instanceof ExactMatcher)
-            .collect(Collectors.toList());
-    assertEquals(1, onlyExacts.size());
-    assertEquals("project/file.txt", onlyExacts.get(0).getKey());
-
-    // ... 1 regex matcher
-    List<Entry<String, Matcher>> regexList =
-        StreamUtils.iteratorStream(matchers.entrySet().iterator())
-            .filter(entry -> entry.getValue() instanceof RegExMatcher)
-            .collect(Collectors.toList());
-    assertEquals(1, regexList.size());
-    assertEquals(".*/a.*", regexList.get(0).getKey());
-
-    // ... 1 partial regex matcher
-    List<Entry<String, Matcher>> partialRegexList =
-        iteratorStream(matchers.entrySet().iterator())
-            .filter(entry -> entry.getValue() instanceof PartialRegExMatcher)
-            .collect(Collectors.toList());
-    assertEquals(1, partialRegexList.size());
-    assertEquals("alfa", partialRegexList.get(0).getKey());
-
-    // .... 1 suffix matcher
-    List<Entry<String, Matcher>> suffixList =
-        iteratorStream(matchers.entrySet().iterator())
-            .filter(entry -> entry.getValue() instanceof SuffixMatcher)
-            .collect(Collectors.toList());
-    assertEquals(1, suffixList.size());
-    assertEquals(".sql", suffixList.get(0).getKey());
-
-    // now checks file owners as well
-    Map<String, Set<Account.Id>> fileOwners = owners.getFileOwners();
-    assertEquals(6, fileOwners.size());
-
-    Set<Account.Id> set1 = fileOwners.get("project/file.txt");
-    assertEquals(4, set1.size()); // includes classic owners a and f
-    assertTrue(set1.contains(ACCOUNT_A_ID));
-    assertTrue(set1.contains(ACCOUNT_D_ID));
-    assertTrue(set1.contains(ACCOUNT_E_ID));
-    assertTrue(set1.contains(ACCOUNT_F_ID));
-
-    Set<Account.Id> set2 = fileOwners.get("project/afile2.sql");
-    assertEquals(5, set2.size());
-    assertTrue(set2.contains(ACCOUNT_A_ID));
-    assertTrue(set2.contains(ACCOUNT_B_ID));
-    assertTrue(set2.contains(ACCOUNT_C_ID));
-    assertTrue(set2.contains(ACCOUNT_D_ID));
-    assertTrue(set2.contains(ACCOUNT_F_ID));
-
-    Set<Account.Id> set3 = fileOwners.get("project/file.sql");
-    assertEquals(4, set3.size());
-    assertTrue(set3.contains(ACCOUNT_A_ID));
-    assertTrue(set3.contains(ACCOUNT_B_ID));
-    assertTrue(set3.contains(ACCOUNT_C_ID));
-    assertTrue(set3.contains(ACCOUNT_F_ID));
-
-    Set<Account.Id> set4 = fileOwners.get("projectalfa");
-    assertEquals(1, set4.size()); // only 1 because a is class and alfa owner
-    assertTrue(set4.contains(ACCOUNT_A_ID));
-  }
-
-  @Test
-  public void testMatchersOnlyConfig() throws Exception {
-    replayAll();
-
-    OwnersConfig ownersConfig =
-        getOwnersConfig(
-            createConfig(
-                false,
-                new String[0],
-                suffixMatcher(".txt", ACCOUNT_B),
-                genericMatcher(".*", ACCOUNT_A)));
-
-    assertThat(ownersConfig.getOwners()).isEmpty();
-    assertThat(ownersConfig.getMatchers()).isNotEmpty();
-  }
-
-  @Test
-  public void testkRegexShouldMatchOnlyOnSuffix() throws Exception {
-    String configString = createConfig(false, new String[0], suffixMatcher(".sql", ACCOUNT_B));
-
-    expectConfig("OWNERS", configString);
-    expectNoConfig("project/OWNERS");
-    replayAll();
-
-    PathOwners owners =
-        new PathOwners(
-            accounts,
-            repositoryManager,
-            repository,
-            emptyList(),
-            branch,
-            Set.of("project/file.sql", "another.txt"),
-            EXPAND_GROUPS,
-            "foo",
-            new PathOwnersEntriesCacheMock(),
-            Optional.empty());
-
-    Set<String> ownedFiles = owners.getFileOwners().keySet();
-    assertThat(ownedFiles).containsExactly("project/file.sql");
-  }
-
-  @Test
-  public void testParsingAutoOwnersApprovedFlags() throws Exception {
-    replayAll();
-
-    String configString =
-        "inherited: true\n"
-            + "auto-owners-approved: false\n"
-            + "owners:\n"
-            + "- a\n"
-            + "matchers:\n"
-            + "- suffix: .sql\n"
-            + "  auto-owners-approved: true\n"
-            + "  owners:\n"
-            + "  - b\n"
-            + "- exact: project/a.txt\n"
-            + "  auto-owners-approved: false\n"
-            + "  owners:\n"
-            + "  - c\n"
-            + "- regex: .*\\.md\n"
-            + "  owners:\n"
-            + "  - d\n";
-
-    OwnersConfig config = getOwnersConfig(configString);
-
-    assertThat(config.getMatchers().get(".sql").getAutoOwnersApproved())
-        .isEqualTo(InheritableBoolean.TRUE);
-    assertThat(config.getMatchers().get("project/a.txt").getAutoOwnersApproved())
-        .isEqualTo(InheritableBoolean.FALSE);
-    assertThat(config.getMatchers().get(".*\\.md").getAutoOwnersApproved())
-        .isEqualTo(InheritableBoolean.INHERIT);
-  }
-}
diff --git a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/TestAccounts.java b/owners-common/src/test/java/com/googlesource/gerrit/owners/common/TestAccounts.java
deleted file mode 100644
index c450f01..0000000
--- a/owners-common/src/test/java/com/googlesource/gerrit/owners/common/TestAccounts.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.owners.common;
-
-import com.google.gerrit.entities.Account;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Optional;
-import java.util.Set;
-import org.junit.Ignore;
-
-@Ignore
-public class TestAccounts extends HashMap<String, Account.Id> implements Accounts {
-  private static final long serialVersionUID = 1L;
-
-  @Override
-  public Set<Account.Id> find(String nameOrEmail) {
-    return Optional.ofNullable(get(nameOrEmail))
-        .map(id -> new HashSet<>(Arrays.asList(id)))
-        .orElse(new HashSet<Account.Id>());
-  }
-}
diff --git a/owners/BUILD b/owners/BUILD
deleted file mode 100644
index 59a8c5d..0000000
--- a/owners/BUILD
+++ /dev/null
@@ -1,94 +0,0 @@
-load("//tools/bzl:plugin.bzl", "PLUGIN_DEPS", "PLUGIN_DEPS_NEVERLINK", "PLUGIN_TEST_DEPS", "gerrit_plugin")
-load("//lib/prolog:prolog.bzl", "prolog_cafe_library")
-load("//owners-common:common.bzl", "EXTERNAL_DEPS", "EXTERNAL_TEST_DEPS")
-load("//tools/bzl:junit.bzl", "junit_tests")
-
-PROLOG_PREDICATES = glob(["src/main/java/gerrit_owners/**/*.java"]) + [
-    "src/main/java/com/googlesource/gerrit/owners/OwnersMetrics.java",
-    "src/main/java/com/googlesource/gerrit/owners/OwnersStoredValues.java",
-]
-
-java_library(
-    name = "gerrit-owners-predicates",
-    srcs = PROLOG_PREDICATES,
-    deps = [
-        "//owners-common",
-        ":prolog-runtime-neverlink",
-    ] + PLUGIN_DEPS_NEVERLINK,
-)
-
-java_library(
-    name = "prolog-runtime-neverlink",
-    neverlink = 1,
-    exports = ["@external_deps//:com_googlecode_prolog_cafe_prolog_runtime"],
-)
-
-prolog_cafe_library(
-    name = "gerrit-owners-prolog-rules",
-    srcs = glob(["src/main/prolog/*.pl"]),
-    deps = PLUGIN_DEPS_NEVERLINK + [
-        ":gerrit-owners-predicates",
-    ],
-)
-
-gerrit_plugin(
-    name = "owners",
-    srcs = glob(
-        [
-            "src/main/java/**/*.java",
-        ],
-        exclude = PROLOG_PREDICATES,
-    ),
-    manifest_entries = [
-        "Implementation-Title: Gerrit OWNERS plugin",
-        "Implementation-URL: https://gerrit.googlesource.com/plugins/owners",
-        "Gerrit-PluginName: owners",
-        "Gerrit-Module: com.googlesource.gerrit.owners.OwnersModule",
-        "Gerrit-HttpModule: com.googlesource.gerrit.owners.HttpModule",
-    ],
-    resource_jars = ["//plugins/owners/web:gr-owners"],
-    resources = glob(["src/main/resources/**/*"]),
-    deps = [
-        ":gerrit-owners-predicates",
-        ":gerrit-owners-prolog-rules",
-        "//owners-common",
-    ],
-)
-
-java_library(
-    name = "owners__plugin_test_deps",
-    testonly = 1,
-    srcs = glob(
-        ["src/test/java/**/*.java"],
-        exclude = [
-            "src/test/java/**/*Test.java",
-            "src/test/java/**/*IT.java",
-        ],
-    ),
-    visibility = ["//visibility:public"],
-    exports = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
-        ":owners",
-    ],
-    deps = PLUGIN_DEPS + PLUGIN_TEST_DEPS + [
-        ":owners",
-    ],
-)
-
-junit_tests(
-    name = "owners_tests",
-    srcs = glob(["src/test/java/**/*Test.java"]),
-    tags = ["owners"],
-    deps = [
-        ":owners__plugin_test_deps",
-    ],
-)
-
-[junit_tests(
-    name = f[:f.index(".")].replace("/", "_"),
-    srcs = [f],
-    tags = ["owners"],
-    visibility = ["//visibility:public"],
-    deps = [
-        ":owners__plugin_test_deps",
-    ],
-) for f in glob(["src/test/java/**/*IT.java"])]
diff --git a/plugins/owners-api b/plugins/owners-api
deleted file mode 120000
index d90303f..0000000
--- a/plugins/owners-api
+++ /dev/null
@@ -1 +0,0 @@
-../owners-api
\ No newline at end of file
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/AlreadyApprovedByOperand.java b/src/main/java/com/googlesource/gerrit/owners/AlreadyApprovedByOperand.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/AlreadyApprovedByOperand.java
rename to src/main/java/com/googlesource/gerrit/owners/AlreadyApprovedByOperand.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/AlreadyApprovedByPredicate.java b/src/main/java/com/googlesource/gerrit/owners/AlreadyApprovedByPredicate.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/AlreadyApprovedByPredicate.java
rename to src/main/java/com/googlesource/gerrit/owners/AlreadyApprovedByPredicate.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/AutoOwnersApprovalFunctions.java b/src/main/java/com/googlesource/gerrit/owners/AutoOwnersApprovalFunctions.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/AutoOwnersApprovalFunctions.java
rename to src/main/java/com/googlesource/gerrit/owners/AutoOwnersApprovalFunctions.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/CompileStub.java b/src/main/java/com/googlesource/gerrit/owners/CompileStub.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/CompileStub.java
rename to src/main/java/com/googlesource/gerrit/owners/CompileStub.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/HttpModule.java b/src/main/java/com/googlesource/gerrit/owners/HttpModule.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/HttpModule.java
rename to src/main/java/com/googlesource/gerrit/owners/HttpModule.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/OwnerPredicateProvider.java b/src/main/java/com/googlesource/gerrit/owners/OwnerPredicateProvider.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/OwnerPredicateProvider.java
rename to src/main/java/com/googlesource/gerrit/owners/OwnerPredicateProvider.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/OwnersApprovalHasOperand.java b/src/main/java/com/googlesource/gerrit/owners/OwnersApprovalHasOperand.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/OwnersApprovalHasOperand.java
rename to src/main/java/com/googlesource/gerrit/owners/OwnersApprovalHasOperand.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/OwnersApprovalHasPredicate.java b/src/main/java/com/googlesource/gerrit/owners/OwnersApprovalHasPredicate.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/OwnersApprovalHasPredicate.java
rename to src/main/java/com/googlesource/gerrit/owners/OwnersApprovalHasPredicate.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/OwnersMetrics.java b/src/main/java/com/googlesource/gerrit/owners/OwnersMetrics.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/OwnersMetrics.java
rename to src/main/java/com/googlesource/gerrit/owners/OwnersMetrics.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/OwnersModule.java b/src/main/java/com/googlesource/gerrit/owners/OwnersModule.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/OwnersModule.java
rename to src/main/java/com/googlesource/gerrit/owners/OwnersModule.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/OwnersRestApiModule.java b/src/main/java/com/googlesource/gerrit/owners/OwnersRestApiModule.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/OwnersRestApiModule.java
rename to src/main/java/com/googlesource/gerrit/owners/OwnersRestApiModule.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/OwnersStoredValues.java b/src/main/java/com/googlesource/gerrit/owners/OwnersStoredValues.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/OwnersStoredValues.java
rename to src/main/java/com/googlesource/gerrit/owners/OwnersStoredValues.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/OwnersSubmitRequirement.java b/src/main/java/com/googlesource/gerrit/owners/OwnersSubmitRequirement.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/OwnersSubmitRequirement.java
rename to src/main/java/com/googlesource/gerrit/owners/OwnersSubmitRequirement.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/entities/FilesOwnersResponse.java b/src/main/java/com/googlesource/gerrit/owners/entities/FilesOwnersResponse.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/entities/FilesOwnersResponse.java
rename to src/main/java/com/googlesource/gerrit/owners/entities/FilesOwnersResponse.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/entities/GroupOwner.java b/src/main/java/com/googlesource/gerrit/owners/entities/GroupOwner.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/entities/GroupOwner.java
rename to src/main/java/com/googlesource/gerrit/owners/entities/GroupOwner.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/entities/Owner.java b/src/main/java/com/googlesource/gerrit/owners/entities/Owner.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/entities/Owner.java
rename to src/main/java/com/googlesource/gerrit/owners/entities/Owner.java
diff --git a/owners/src/main/java/com/googlesource/gerrit/owners/restapi/GetFilesOwners.java b/src/main/java/com/googlesource/gerrit/owners/restapi/GetFilesOwners.java
similarity index 100%
rename from owners/src/main/java/com/googlesource/gerrit/owners/restapi/GetFilesOwners.java
rename to src/main/java/com/googlesource/gerrit/owners/restapi/GetFilesOwners.java
diff --git a/owners/src/main/java/gerrit_owners/PRED_code_review_user_1.java b/src/main/java/gerrit_owners/PRED_code_review_user_1.java
similarity index 100%
rename from owners/src/main/java/gerrit_owners/PRED_code_review_user_1.java
rename to src/main/java/gerrit_owners/PRED_code_review_user_1.java
diff --git a/owners/src/main/java/gerrit_owners/PRED_file_owners_2.java b/src/main/java/gerrit_owners/PRED_file_owners_2.java
similarity index 100%
rename from owners/src/main/java/gerrit_owners/PRED_file_owners_2.java
rename to src/main/java/gerrit_owners/PRED_file_owners_2.java
diff --git a/owners/src/main/java/gerrit_owners/PRED_matcher_owner_2.java b/src/main/java/gerrit_owners/PRED_matcher_owner_2.java
similarity index 100%
rename from owners/src/main/java/gerrit_owners/PRED_matcher_owner_2.java
rename to src/main/java/gerrit_owners/PRED_matcher_owner_2.java
diff --git a/owners/src/main/java/gerrit_owners/PRED_matcher_path_1.java b/src/main/java/gerrit_owners/PRED_matcher_path_1.java
similarity index 100%
rename from owners/src/main/java/gerrit_owners/PRED_matcher_path_1.java
rename to src/main/java/gerrit_owners/PRED_matcher_path_1.java
diff --git a/owners/src/main/java/gerrit_owners/PRED_owner_2.java b/src/main/java/gerrit_owners/PRED_owner_2.java
similarity index 100%
rename from owners/src/main/java/gerrit_owners/PRED_owner_2.java
rename to src/main/java/gerrit_owners/PRED_owner_2.java
diff --git a/owners/src/main/java/gerrit_owners/PRED_owner_path_1.java b/src/main/java/gerrit_owners/PRED_owner_path_1.java
similarity index 100%
rename from owners/src/main/java/gerrit_owners/PRED_owner_path_1.java
rename to src/main/java/gerrit_owners/PRED_owner_path_1.java
diff --git a/owners/src/main/prolog/gerrit_owners.pl b/src/main/prolog/gerrit_owners.pl
similarity index 100%
rename from owners/src/main/prolog/gerrit_owners.pl
rename to src/main/prolog/gerrit_owners.pl
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-1.1.png b/src/main/resources/Documentation/auto-owners-approval-images/example-1.1.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-1.1.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-1.1.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-1.2.png b/src/main/resources/Documentation/auto-owners-approval-images/example-1.2.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-1.2.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-1.2.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-2.1.png b/src/main/resources/Documentation/auto-owners-approval-images/example-2.1.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-2.1.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-2.1.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-2.2.png b/src/main/resources/Documentation/auto-owners-approval-images/example-2.2.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-2.2.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-2.2.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-3.1.png b/src/main/resources/Documentation/auto-owners-approval-images/example-3.1.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-3.1.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-3.1.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-3.2.png b/src/main/resources/Documentation/auto-owners-approval-images/example-3.2.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-3.2.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-3.2.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-4.1.png b/src/main/resources/Documentation/auto-owners-approval-images/example-4.1.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-4.1.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-4.1.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-4.2.png b/src/main/resources/Documentation/auto-owners-approval-images/example-4.2.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-4.2.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-4.2.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-5.1.png b/src/main/resources/Documentation/auto-owners-approval-images/example-5.1.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-5.1.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-5.1.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-5.2.png b/src/main/resources/Documentation/auto-owners-approval-images/example-5.2.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-5.2.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-5.2.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-6.1.png b/src/main/resources/Documentation/auto-owners-approval-images/example-6.1.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-6.1.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-6.1.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-6.2.png b/src/main/resources/Documentation/auto-owners-approval-images/example-6.2.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-6.2.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-6.2.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/auto-owners-approval-images/example-6.3.png b/src/main/resources/Documentation/auto-owners-approval-images/example-6.3.png
similarity index 100%
rename from owners/src/main/resources/Documentation/auto-owners-approval-images/example-6.3.png
rename to src/main/resources/Documentation/auto-owners-approval-images/example-6.3.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/config.md b/src/main/resources/Documentation/config.md
similarity index 100%
rename from owners/src/main/resources/Documentation/config.md
rename to src/main/resources/Documentation/config.md
diff --git a/owners/src/main/resources/Documentation/copy-conditions.md b/src/main/resources/Documentation/copy-conditions.md
similarity index 100%
rename from owners/src/main/resources/Documentation/copy-conditions.md
rename to src/main/resources/Documentation/copy-conditions.md
diff --git a/owners/src/main/resources/Documentation/files-owners-status-not-ready-hover.png b/src/main/resources/Documentation/files-owners-status-not-ready-hover.png
similarity index 100%
rename from owners/src/main/resources/Documentation/files-owners-status-not-ready-hover.png
rename to src/main/resources/Documentation/files-owners-status-not-ready-hover.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/files-owners-status-ready-hover.png b/src/main/resources/Documentation/files-owners-status-ready-hover.png
similarity index 100%
rename from owners/src/main/resources/Documentation/files-owners-status-ready-hover.png
rename to src/main/resources/Documentation/files-owners-status-ready-hover.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/files-owners-status.png b/src/main/resources/Documentation/files-owners-status.png
similarity index 100%
rename from owners/src/main/resources/Documentation/files-owners-status.png
rename to src/main/resources/Documentation/files-owners-status.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/how-to-use.md b/src/main/resources/Documentation/how-to-use.md
similarity index 100%
rename from owners/src/main/resources/Documentation/how-to-use.md
rename to src/main/resources/Documentation/how-to-use.md
diff --git a/owners/src/main/resources/Documentation/metrics.md b/src/main/resources/Documentation/metrics.md
similarity index 100%
rename from owners/src/main/resources/Documentation/metrics.md
rename to src/main/resources/Documentation/metrics.md
diff --git a/owners/src/main/resources/Documentation/owned-files.png b/src/main/resources/Documentation/owned-files.png
similarity index 100%
rename from owners/src/main/resources/Documentation/owned-files.png
rename to src/main/resources/Documentation/owned-files.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/owner-details.png b/src/main/resources/Documentation/owner-details.png
similarity index 100%
rename from owners/src/main/resources/Documentation/owner-details.png
rename to src/main/resources/Documentation/owner-details.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/rest-api.md b/src/main/resources/Documentation/rest-api.md
similarity index 100%
rename from owners/src/main/resources/Documentation/rest-api.md
rename to src/main/resources/Documentation/rest-api.md
diff --git a/owners/src/main/resources/Documentation/submit-requirement-hover.png b/src/main/resources/Documentation/submit-requirement-hover.png
similarity index 100%
rename from owners/src/main/resources/Documentation/submit-requirement-hover.png
rename to src/main/resources/Documentation/submit-requirement-hover.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/submit-requirement.png b/src/main/resources/Documentation/submit-requirement.png
similarity index 100%
rename from owners/src/main/resources/Documentation/submit-requirement.png
rename to src/main/resources/Documentation/submit-requirement.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/submit-rule-hover.png b/src/main/resources/Documentation/submit-rule-hover.png
similarity index 100%
rename from owners/src/main/resources/Documentation/submit-rule-hover.png
rename to src/main/resources/Documentation/submit-rule-hover.png
Binary files differ
diff --git a/owners/src/main/resources/Documentation/submit-rule.png b/src/main/resources/Documentation/submit-rule.png
similarity index 100%
rename from owners/src/main/resources/Documentation/submit-rule.png
rename to src/main/resources/Documentation/submit-rule.png
Binary files differ
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/AlreadyApprovedByCopyConditionIT.java b/src/test/java/com/googlesource/gerrit/owners/AlreadyApprovedByCopyConditionIT.java
similarity index 100%
rename from owners/src/test/java/com/googlesource/gerrit/owners/AlreadyApprovedByCopyConditionIT.java
rename to src/test/java/com/googlesource/gerrit/owners/AlreadyApprovedByCopyConditionIT.java
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersApprovalHasOperandIT.java b/src/test/java/com/googlesource/gerrit/owners/OwnersApprovalHasOperandIT.java
similarity index 100%
rename from owners/src/test/java/com/googlesource/gerrit/owners/OwnersApprovalHasOperandIT.java
rename to src/test/java/com/googlesource/gerrit/owners/OwnersApprovalHasOperandIT.java
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersMetricsIT.java b/src/test/java/com/googlesource/gerrit/owners/OwnersMetricsIT.java
similarity index 100%
rename from owners/src/test/java/com/googlesource/gerrit/owners/OwnersMetricsIT.java
rename to src/test/java/com/googlesource/gerrit/owners/OwnersMetricsIT.java
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersRegressionIT.java b/src/test/java/com/googlesource/gerrit/owners/OwnersRegressionIT.java
similarity index 100%
rename from owners/src/test/java/com/googlesource/gerrit/owners/OwnersRegressionIT.java
rename to src/test/java/com/googlesource/gerrit/owners/OwnersRegressionIT.java
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementIT.java b/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementIT.java
similarity index 100%
rename from owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementIT.java
rename to src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementIT.java
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementITAbstract.java b/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementITAbstract.java
similarity index 100%
rename from owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementITAbstract.java
rename to src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementITAbstract.java
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementTest.java b/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementTest.java
similarity index 100%
rename from owners/src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementTest.java
rename to src/test/java/com/googlesource/gerrit/owners/OwnersSubmitRequirementTest.java
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersIT.java b/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersIT.java
similarity index 100%
rename from owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersIT.java
rename to src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersIT.java
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersITAbstract.java b/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersITAbstract.java
similarity index 100%
rename from owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersITAbstract.java
rename to src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersITAbstract.java
diff --git a/owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersSubmitRequirementsIT.java b/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersSubmitRequirementsIT.java
similarity index 100%
rename from owners/src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersSubmitRequirementsIT.java
rename to src/test/java/com/googlesource/gerrit/owners/restapi/GetFilesOwnersSubmitRequirementsIT.java
diff --git a/tools/BUILD b/tools/BUILD
deleted file mode 100644
index c5ed0b7..0000000
--- a/tools/BUILD
+++ /dev/null
@@ -1 +0,0 @@
-# Empty file required by Bazel
diff --git a/tools/bzl/BUILD b/tools/bzl/BUILD
deleted file mode 100644
index c5ed0b7..0000000
--- a/tools/bzl/BUILD
+++ /dev/null
@@ -1 +0,0 @@
-# Empty file required by Bazel
diff --git a/tools/bzl/classpath.bzl b/tools/bzl/classpath.bzl
deleted file mode 100644
index c921d01..0000000
--- a/tools/bzl/classpath.bzl
+++ /dev/null
@@ -1,6 +0,0 @@
-load(
-    "@com_googlesource_gerrit_bazlets//tools:classpath.bzl",
-    _classpath_collector = "classpath_collector",
-)
-
-classpath_collector = _classpath_collector
diff --git a/tools/bzl/junit.bzl b/tools/bzl/junit.bzl
deleted file mode 100644
index 97307bd..0000000
--- a/tools/bzl/junit.bzl
+++ /dev/null
@@ -1,6 +0,0 @@
-load(
-    "@com_googlesource_gerrit_bazlets//tools:junit.bzl",
-    _junit_tests = "junit_tests",
-)
-
-junit_tests = _junit_tests
diff --git a/tools/bzl/maven_jar.bzl b/tools/bzl/maven_jar.bzl
deleted file mode 100644
index ed1504d..0000000
--- a/tools/bzl/maven_jar.bzl
+++ /dev/null
@@ -1,4 +0,0 @@
-load("@com_googlesource_gerrit_bazlets//tools:maven_jar.bzl", _gerrit = "GERRIT", _maven_jar = "maven_jar")
-
-maven_jar = _maven_jar
-GERRIT = _gerrit
diff --git a/tools/bzl/plugin.bzl b/tools/bzl/plugin.bzl
deleted file mode 100644
index a271493..0000000
--- a/tools/bzl/plugin.bzl
+++ /dev/null
@@ -1,12 +0,0 @@
-load(
-    "@com_googlesource_gerrit_bazlets//:gerrit_plugin.bzl",
-    _gerrit_plugin = "gerrit_plugin",
-    _plugin_deps = "PLUGIN_DEPS",
-    _plugin_deps_neverlink = "PLUGIN_DEPS_NEVERLINK",
-    _plugin_test_deps = "PLUGIN_TEST_DEPS",
-)
-
-gerrit_plugin = _gerrit_plugin
-PLUGIN_DEPS = _plugin_deps
-PLUGIN_DEPS_NEVERLINK = _plugin_deps_neverlink
-PLUGIN_TEST_DEPS = _plugin_test_deps
diff --git a/tools/eclipse/BUILD b/tools/eclipse/BUILD
deleted file mode 100644
index a53253f..0000000
--- a/tools/eclipse/BUILD
+++ /dev/null
@@ -1,9 +0,0 @@
-load("//tools/bzl:classpath.bzl", "classpath_collector")
-
-classpath_collector(
-    name = "main_classpath_collect",
-    testonly = 1,
-    deps = [
-        "//:owners_classpath_deps",
-    ],
-)
diff --git a/tools/eclipse/project.sh b/tools/eclipse/project.sh
deleted file mode 100755
index 100cc75..0000000
--- a/tools/eclipse/project.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-#Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-`bazel query @com_googlesource_gerrit_bazlets//tools/eclipse:project --output location | sed s/BUILD:.*//`project.py -n owners -r .
-
-
diff --git a/tools/genrule2.bzl b/tools/genrule2.bzl
deleted file mode 100644
index 61c4e18..0000000
--- a/tools/genrule2.bzl
+++ /dev/null
@@ -1,3 +0,0 @@
-load("@com_googlesource_gerrit_bazlets//tools:genrule2.bzl", _genrule2 = "genrule2")
-
-genrule2 = _genrule2
diff --git a/tools/workspace-status.sh b/tools/workspace-status.sh
deleted file mode 100755
index 83f9cdc..0000000
--- a/tools/workspace-status.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-# This script will be run by bazel when the build process starts to
-# generate key-value information that represents the status of the
-# workspace. The output should be like
-#
-# KEY1 VALUE1
-# KEY2 VALUE2
-#
-# If the script exits with non-zero code, it's considered as a failure
-# and the output will be discarded.
-
-function rev() {
-  cd $1; git describe --always --match "v[0-9].*" --dirty
-}
-
-echo STABLE_BUILD_OWNERS_LABEL $(rev .)
diff --git a/owners/web/.eslintrc.js b/web/.eslintrc.js
similarity index 100%
rename from owners/web/.eslintrc.js
rename to web/.eslintrc.js
diff --git a/owners/web/BUILD b/web/BUILD
similarity index 100%
rename from owners/web/BUILD
rename to web/BUILD
diff --git a/owners/web/eslint.config.js b/web/eslint.config.js
similarity index 100%
rename from owners/web/eslint.config.js
rename to web/eslint.config.js
diff --git a/owners/web/gerrit-model.ts b/web/gerrit-model.ts
similarity index 100%
rename from owners/web/gerrit-model.ts
rename to web/gerrit-model.ts
diff --git a/owners/web/gr-files.ts b/web/gr-files.ts
similarity index 100%
rename from owners/web/gr-files.ts
rename to web/gr-files.ts
diff --git a/owners/web/gr-files_test.ts b/web/gr-files_test.ts
similarity index 100%
rename from owners/web/gr-files_test.ts
rename to web/gr-files_test.ts
diff --git a/owners/web/gr-owned-files.ts b/web/gr-owned-files.ts
similarity index 100%
rename from owners/web/gr-owned-files.ts
rename to web/gr-owned-files.ts
diff --git a/owners/web/gr-owned-files_test.ts b/web/gr-owned-files_test.ts
similarity index 100%
rename from owners/web/gr-owned-files_test.ts
rename to web/gr-owned-files_test.ts
diff --git a/owners/web/owners-mixin.ts b/web/owners-mixin.ts
similarity index 100%
rename from owners/web/owners-mixin.ts
rename to web/owners-mixin.ts
diff --git a/owners/web/owners-model.ts b/web/owners-model.ts
similarity index 100%
rename from owners/web/owners-model.ts
rename to web/owners-model.ts
diff --git a/owners/web/owners-service.ts b/web/owners-service.ts
similarity index 100%
rename from owners/web/owners-service.ts
rename to web/owners-service.ts
diff --git a/owners/web/owners-service_test.ts b/web/owners-service_test.ts
similarity index 100%
rename from owners/web/owners-service_test.ts
rename to web/owners-service_test.ts
diff --git a/owners/web/plugin.ts b/web/plugin.ts
similarity index 100%
rename from owners/web/plugin.ts
rename to web/plugin.ts
diff --git a/owners/web/test-utils.ts b/web/test-utils.ts
similarity index 100%
rename from owners/web/test-utils.ts
rename to web/test-utils.ts
diff --git a/owners/web/tsconfig.json b/web/tsconfig.json
similarity index 100%
rename from owners/web/tsconfig.json
rename to web/tsconfig.json
diff --git a/owners/web/utils.ts b/web/utils.ts
similarity index 100%
rename from owners/web/utils.ts
rename to web/utils.ts
diff --git a/owners/web/web_test_runner.sh b/web/web_test_runner.sh
similarity index 100%
rename from owners/web/web_test_runner.sh
rename to web/web_test_runner.sh