about summary refs log tree commit diff
path: root/nix/bufCheck/default.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2024-03-14T22·13+0100
committerclbot <clbot@tvl.fyi>2024-03-15T11·55+0000
commitd5b6704d3d82c1c1acf45aba71ab1a337f94defd (patch)
tree7d414d82e6d62b62ef22b85685a8dee4ba452700 /nix/bufCheck/default.nix
parent5fccbe5939b376d56690cdf8ebcab61f7e852d86 (diff)
chore: move protoCheck into extraStep of //nix/bufCheck r/7698
Resolves b/385. I have a feeling bufCheck should be moved to
//tools as well.

Change-Id: I2a2b63d135a2f8bcc982aa1138ff3213c6012f20
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11152
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'nix/bufCheck/default.nix')
-rw-r--r--nix/bufCheck/default.nix29
1 files changed, 23 insertions, 6 deletions
diff --git a/nix/bufCheck/default.nix b/nix/bufCheck/default.nix
index d0f07d996b73..ec98cfc3760c 100644
--- a/nix/bufCheck/default.nix
+++ b/nix/bufCheck/default.nix
@@ -1,9 +1,26 @@
 # Check protobuf breaking. Lints already happen in individual targets.
 #
-{ depot, pkgs, ... }:
+{ depot, pkgs, lib, ... }:
 
-pkgs.writeShellScriptBin "ci-buf-check" ''
-  export PATH="$PATH:${pkgs.lib.makeBinPath [ pkgs.buf ]}"
-  # Report-only
-  (cd $(git rev-parse --show-toplevel) && (buf breaking . --against "./.git#ref=HEAD~1" || true))
-''
+let
+  inherit (depot.nix) bufCheck;# self reference
+
+  script = pkgs.writeShellScriptBin "ci-buf-check" ''
+    export PATH="$PATH:${pkgs.lib.makeBinPath [ pkgs.buf ]}"
+    # Report-only
+    (cd $(git rev-parse --show-toplevel) && (buf breaking . --against "./.git#ref=HEAD~1" || true))
+  '';
+in
+
+script.overrideAttrs (old: {
+  meta = lib.recursiveUpdate old.meta {
+    # Protobuf check step executed in the buildkite pipeline which
+    # validates that changes to .proto files between revisions
+    # don't cause backwards-incompatible or otherwise flawed changes.
+    ci.extraSteps.protoCheck = {
+      alwaysRun = true;
+      label = ":water_buffalo: protoCheck";
+      command = pkgs.writeShellScript "ci-buf-check-step" "exec ${depot.nix.bufCheck}/bin/ci-buf-check";
+    };
+  };
+})