about summary refs log tree commit diff
path: root/third_party/gerrit_plugins/code-owners/default.nix
diff options
context:
space:
mode:
authorLuke Granger-Brown <git@lukegb.com>2022-09-19T05·25+0000
committerlukegb <lukegb@tvl.fyi>2022-09-19T11·04+0000
commitae98240df2f9a9d11be85d61697532e17c1ed5f8 (patch)
treecfe362e090bfa963bce111631551cff9ee9b5a9c /third_party/gerrit_plugins/code-owners/default.nix
parentf358be4a1d44eb989c8a1eb293b1233cf653911e (diff)
feat(gerrit): add code-owners plugin r/4921
This is the New Thing that is intended to replace the find-owners
and owners plugins.

In particular:

* It inserts a submit requirement rather than providing a Prolog
  predicate.
* The default OWNERS file formats are suspiciously Googley.
* It provides a neat UI for finding OWNERS and tracking approval
  state on a per-file basis.

When we fully migrate to using the code-owners plugin, a few
things will need to land, which I will likely do "offline"
directly to the Gerrit backing Git repos:

* Add the corresponding Gerrit config
* Replace OWNERS files depot-wide
* Add OWNERS files to the refs/meta/config branch
* Introduce the Owners-Override label, settable by depot-interventions

The enclosed patch adds two extra pieces of functionality that
we need in tvldepot but aren't upstream:

1. The ability to just specify usernames rather than email addresses
2. The ability to specify `group:GROUPNAME`, _as long as_ that group is
   visible to everyone. This is a restriction intended to avoid having
   the plugin just leak group membership.

Change-Id: I27d92b6cb7449af83030b9015f09a1571aa8452f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6664
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'third_party/gerrit_plugins/code-owners/default.nix')
-rw-r--r--third_party/gerrit_plugins/code-owners/default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/third_party/gerrit_plugins/code-owners/default.nix b/third_party/gerrit_plugins/code-owners/default.nix
new file mode 100644
index 000000000000..377a2a0471cd
--- /dev/null
+++ b/third_party/gerrit_plugins/code-owners/default.nix
@@ -0,0 +1,17 @@
+{ depot, pkgs, ... }@args:
+
+let
+  inherit (import ../builder.nix args) buildGerritBazelPlugin;
+in
+buildGerritBazelPlugin rec {
+  name = "code-owners";
+  depsOutputHash = "sha256:0fpv5yavgki5nv84lg5zykp6v7pv9xll1glmz5dwnz5z11axj4g9";
+  src = pkgs.fetchgit {
+    url = "https://gerrit.googlesource.com/plugins/code-owners";
+    rev = "6fdf3ce2e52904b35e2a5824a4197155c2c6b4e4";
+    sha256 = "sha256:17k6310py71wax3881mf3vsf9zas648j4xzs9h0d7migv5nzsdzs";
+  };
+  patches = [
+    ./using-usernames.patch
+  ];
+}