Skip to content

Commit efee326

Browse files
[CI] Gracefully Fail when Job Completion Timestamp is None (#168457)
There seem to be cases where the workflow status is completed but the jobs have not completed. We need to gracefully handle these changes to avoid a crash loop in the metrics container.
1 parent eb20b53 commit efee326

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.ci/metrics/metrics.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,13 @@ def github_get_metrics(
370370
started_at = job.started_at
371371
completed_at = job.completed_at
372372

373+
if completed_at is None:
374+
logging.info(
375+
f"Workflow {task.id} is marked completed but has a job without a "
376+
"completion timestamp."
377+
)
378+
continue
379+
373380
# GitHub API can return results where the started_at is slightly
374381
# later then the created_at (or completed earlier than started).
375382
# This would cause a -23h59mn delta, which will show up as +24h

0 commit comments

Comments
 (0)