bazel: Exit early in recipe testing if failing
If the builder is failing in CI, don't block recipe changes on it
passing in CQ.
The pw_presubmit recipe has a similar check:
https://pigweed.googlesource.com/infra/recipes/+/main/recipes/pw_presubmit.py#90
Change-Id: I10fd5ee8fcf5f36f704f314f7124336259f12049
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/240143
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/recipes/bazel.py b/recipes/bazel.py
index 44220ad..271cbdd 100644
--- a/recipes/bazel.py
+++ b/recipes/bazel.py
@@ -28,6 +28,7 @@
DEPS = [
'pigweed/bazel',
'pigweed/checkout',
+ 'pigweed/ci_status',
'pigweed/environment',
'recipe_engine/properties',
]
@@ -36,6 +37,9 @@
def RunSteps(api: recipe_api.RecipeScriptApi, props: InputProperties):
+ if res := api.ci_status.exit_early_in_recipe_testing_if_failing():
+ return res # pragma: no cover
+
checkout: api.checkout.CheckoutContext = api.checkout(
props.checkout_options
)