Skip to content

Commit

Permalink
[CI] Detect step failures in metrics job (#122564)
Browse files Browse the repository at this point in the history
This patch makes the metrics job also detect failures in individual
steps. This is necessary now that we are setting continue-on-error in
the premerge jobs to prevent sending out unnecessary email to detect
what jobs actually fail.
  • Loading branch information
boomanaiden154 authored Jan 11, 2025
1 parent 4f4e2ab commit eabf931
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .ci/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ def get_metrics(github_repo: github.Repository, workflows_to_track: dict[str, in
completed_at = workflow_jobs[0].completed_at

job_result = int(workflow_jobs[0].conclusion == "success")
if job_result:
# We still might want to mark the job as a failure if one of the steps
# failed. This is required due to use setting continue-on-error in
# the premerge pipeline to prevent sending emails while we are
# testing the infrastructure.
# TODO(boomanaiden154): Remove this once the premerge pipeline is no
# longer in a testing state and we can directly assert the workflow
# result.
for step in workflow_jobs[0].steps:
if step.conclusion != "success":
job_result = 0
break

queue_time = started_at - created_at
run_time = completed_at - started_at
Expand Down

0 comments on commit eabf931

Please sign in to comment.