From 1cd7678bdbbc160c13afb28a7ea31c01c9904432 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 24 Oct 2022 10:16:40 -0400 Subject: feat(ops/buildkite): Support "soft failures" Example Usage: ```nix { pkgs, ... }: (pkgs.writeText "foo" "bar").overrideAttrs (_: { meta.ci.extraSteps.bar = { label = "testing soft_fail"; softFail = [ { exit_status = 253; } { exit_status = 251; } ]; command = pkgs.writeShellScript "fail" '' # Trigger a soft failure by exiting 253 or 251 exit 253 ''; }; }) ``` Buildkite Documentation: https://buildkite.com/changelog/56-command-steps-can-now-be-made-to-soft-fail Change-Id: Idfce15a8d9cde568aa24ebd03956ada399bba5d2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7076 Tested-by: BuildkiteCI Reviewed-by: tazjin --- nix/buildkite/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nix/buildkite/default.nix b/nix/buildkite/default.nix index ccd98e532c..b04dc55a0b 100644 --- a/nix/buildkite/default.nix +++ b/nix/buildkite/default.nix @@ -331,6 +331,7 @@ rec { , branches ? null , alwaysRun ? false , prompt ? false + , softFail ? false # TODO(tazjin): Default to 'build' after 2022-10-01. , phase ? if (isNull postBuild || !postBuild) then "build" else "release" @@ -363,6 +364,7 @@ rec { needsOutput parent parentLabel + softFail skip agents; @@ -430,6 +432,8 @@ rec { echo '+++ Running extra step command' exec ${cfg.command} ''; + + soft_fail = cfg.softFail; } // (lib.optionalAttrs (cfg.agents != null) { inherit (cfg) agents; }) // (lib.optionalAttrs (cfg.branches != null) { branches = lib.concatStringsSep " " cfg.branches; -- cgit 1.4.1