2023-10-17 14:49:03 +02:00
|
|
|
# Check protobuf breaking. Lints already happen in individual targets.
|
2020-07-17 06:27:05 +02:00
|
|
|
#
|
2024-03-14 23:13:01 +01:00
|
|
|
{ depot, pkgs, lib, ... }:
|
2020-07-17 06:27:05 +02:00
|
|
|
|
2024-03-14 23:13:01 +01:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|