From 4dd236be53536e851d2dcb7fab205e999970517f Mon Sep 17 00:00:00 2001 From: Kane York Date: Thu, 16 Jul 2020 21:27:05 -0700 Subject: [PATCH] feat(ci): run buf check lint in CI Breaking change detection will run but not enforce. Emoji of water buffalo was chosen by @pedge fiat in the bufbuild slack. Change-Id: Ie292f2bfddc0e3bc512e4a138c0b5d0fa2603bad Reviewed-on: https://cl.tvl.fyi/c/depot/+/1247 Tested-by: BuildkiteCI Reviewed-by: tazjin Reviewed-by: glittershark --- nix/bufCheck/default.nix | 9 +++++++++ ops/pipelines/depot.nix | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 nix/bufCheck/default.nix diff --git a/nix/bufCheck/default.nix b/nix/bufCheck/default.nix new file mode 100644 index 000000000..6d17cb460 --- /dev/null +++ b/nix/bufCheck/default.nix @@ -0,0 +1,9 @@ +# Check protobuf syntax and breaking. +# +{ depot, pkgs, ... }: + +pkgs.writeShellScriptBin "ci-buf-check" '' + ${depot.third_party.bufbuild}/bin/buf check lint --input "${depot.depotPath}" + # Report-only + ${depot.third_party.bufbuild}/bin/buf check breaking --input "${depot.depotPath}" --against-input "${depot.depotPath}/.git#branch=canon" || true +'' diff --git a/ops/pipelines/depot.nix b/ops/pipelines/depot.nix index 3c9ee6b21..ad5a3faab 100644 --- a/ops/pipelines/depot.nix +++ b/ops/pipelines/depot.nix @@ -17,5 +17,9 @@ let command = "nix-build -A ciBuilds.__allTargets --show-trace"; label = ":duck:"; } + { + command = "${depot.nix.bufCheck}/bin/ci-buf-check"; + label = ":water_buffalo:"; + } ]; in writeText "depot.yaml" (toJSON pipeline)