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>
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			887 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
	
		
			887 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
# Check protobuf breaking. Lints already happen in individual targets.
 | 
						|
#
 | 
						|
{ depot, pkgs, lib, ... }:
 | 
						|
 | 
						|
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";
 | 
						|
    };
 | 
						|
  };
 | 
						|
})
 |