From 0779f96687cb66d7b4948861804dc36dec9dcb7e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 16 Jan 2022 15:55:36 +0300 Subject: feat(nix/buildkite): Check target map of parent to determine skips This changes the logic for build pipeline generation to inspect an (optional) parentTargetMap attribute which contains the derivation map of a target commit. Targets that existed in a parent commit with the same drv hash will be skipped, as they are not considered to have changed. This does not yet wire up any logic for retrieving the target map from storage, meaning that at this commit all targets are always built. The intention is that we will have logic to fetch the target map (initially from Buildkite artefact storage), which we then pass to the depot via externalArgs when actually generating the pipeline. Change-Id: I3373c60aaf4b56b94c6ab64e2e5eef68dea9287c Reviewed-on: https://cl.tvl.fyi/c/depot/+/4946 Tested-by: BuildkiteCI Reviewed-by: sterni --- ops/pipelines/depot.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ops/pipelines') diff --git a/ops/pipelines/depot.nix b/ops/pipelines/depot.nix index 8cc4b5691f..232d229b90 100644 --- a/ops/pipelines/depot.nix +++ b/ops/pipelines/depot.nix @@ -1,6 +1,6 @@ # This file configures the primary build pipeline used for the # top-level list of depot targets. -{ depot, pkgs, ... }: +{ depot, pkgs, externalArgs, ... }: let # Protobuf check step which validates that changes to .proto files @@ -17,11 +17,15 @@ let command = "${depot.tools.depotfmt.check}"; label = ":evergreen_tree: (tools/depotfmt)"; }; + pipeline = depot.nix.buildkite.mkPipeline { headBranch = "refs/heads/canon"; drvTargets = depot.ci.targets; - skipIfBuilt = true; additionalSteps = [ depotfmtCheck protoCheck ]; + + parentTargetMap = if (externalArgs ? parentTargetMap) + then builtins.fromJSON (builtins.readFile externalArgs.parentTargetMap) + else {}; }; drvmap = depot.nix.buildkite.mkDrvmap depot.ci.targets; -- cgit 1.4.1