Skip to content

Commit

Permalink
Only fail last green update for build/test failures (#1998)
Browse files Browse the repository at this point in the history
  • Loading branch information
fweikert authored Jul 9, 2024
1 parent 0f3deb9 commit cb00eea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions buildkite/bazelci.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@
BUILD_LABEL_PATTERN = re.compile(r"^Build label: (\S+)$", re.MULTILINE)

BUILDIFIER_STEP_NAME = "Buildifier"
SHARD_SUMMARY_STEP_NAME = "Print Test Summary for Shards"

SKIP_TASKS_ENV_VAR = "CI_SKIP_TASKS"

Expand Down Expand Up @@ -3058,7 +3059,7 @@ def print_project_pipeline(
if actually_print_shard_summary:
pipeline_steps.append(
create_step(
label="Print Test Summary for Shards",
label=SHARD_SUMMARY_STEP_NAME,
commands=[
fetch_bazelcipy_command(),
PLATFORMS[DEFAULT_PLATFORM]["python"] + " bazelci.py print_shard_summary",
Expand Down Expand Up @@ -3722,11 +3723,11 @@ def has_failed(job):
state = job.get("state")
# Ignore steps that don't have a state (like "wait").
return (
state is not None
state
and state != "passed"
and not job.get("soft_failed")
and job["id"] != current_job_id
and job["name"] != BUILDIFIER_STEP_NAME
and job["name"] not in (BUILDIFIER_STEP_NAME, SHARD_SUMMARY_STEP_NAME)
)

failing_jobs = [j["name"] for j in build_info["jobs"] if has_failed(j)]
Expand Down

0 comments on commit cb00eea

Please sign in to comment.