From 253be18e52786978cd536dda76f11b0aba044826 Mon Sep 17 00:00:00 2001 From: Douglas Yang Date: Tue, 2 Dec 2025 14:24:25 -0800 Subject: [PATCH] Fix nonetype error for ci failure monitor (#14319) --- scripts/ci_monitor/ci_failures_analysis.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/ci_monitor/ci_failures_analysis.py b/scripts/ci_monitor/ci_failures_analysis.py index ad63a6867..69650ddd0 100644 --- a/scripts/ci_monitor/ci_failures_analysis.py +++ b/scripts/ci_monitor/ci_failures_analysis.py @@ -179,14 +179,13 @@ class SGLangFailuresAnalyzer: f"Processing run {i}/{total_runs_processed} for runner analysis: #{run.get('run_number')}" ) + head_commit = run.get("head_commit") or {} run_info = { "run_number": run.get("run_number"), "run_id": run.get("id"), "created_at": run.get("created_at"), "head_sha": run.get("head_sha", "")[:8], - "author": run.get("head_commit", {}) - .get("author", {}) - .get("name", "Unknown"), + "author": head_commit.get("author", {}).get("name", "Unknown"), "url": f"https://github.com/{self.repo}/actions/runs/{run.get('id')}", } @@ -750,14 +749,13 @@ class SGLangFailuresAnalyzer: f"Processing run {i}/{total_runs_processed}: #{run.get('run_number')}" ) + head_commit = run.get("head_commit") or {} run_info = { "run_number": run.get("run_number"), "run_id": run.get("id"), "created_at": run.get("created_at"), "head_sha": run.get("head_sha", "")[:8], - "author": run.get("head_commit", {}) - .get("author", {}) - .get("name", "Unknown"), + "author": head_commit.get("author", {}).get("name", "Unknown"), "url": f"https://github.com/{self.repo}/actions/runs/{run.get('id')}", }