From 7c6fb3aa2d3554bee6895a63b394432b719c04a9 Mon Sep 17 00:00:00 2001 From: Douglas Yang Date: Tue, 9 Dec 2025 13:41:09 -0800 Subject: [PATCH] fix: making rate limit a warning instead of error (#14753) Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- scripts/ci/publish_traces.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/ci/publish_traces.py b/scripts/ci/publish_traces.py index e024c7bba..31e18bcf0 100644 --- a/scripts/ci/publish_traces.py +++ b/scripts/ci/publish_traces.py @@ -8,6 +8,7 @@ import json import os import sys import time +import warnings from urllib.error import HTTPError from urllib.request import Request, urlopen @@ -338,6 +339,15 @@ def publish_traces(traces_dir, run_id, run_number): is_retryable = True error_type = f"HTTP {e.code}" + # Check for rate limit errors (non-fatal - just warn and skip) + if ( + isinstance(e, HTTPError) + and e.code in [403, 429] + and "rate limit exceeded" in getattr(e, "error_body", "").lower() + ): + warnings.warn("GitHub API rate limit exceeded. Skipping trace upload.") + return + if is_retryable and attempt < max_retries - 1: print( f"Attempt {attempt + 1}/{max_retries} failed ({error_type}). Retrying in {retry_delay} seconds..."