From 41fc4e6d7e268617af6d8efdf62ff0a83e83d6fc Mon Sep 17 00:00:00 2001 From: a-maurice Date: Mon, 11 May 2026 14:13:30 -0700 Subject: [PATCH] Handle retries in build reporting --- scripts/gha/report_build_status.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/gha/report_build_status.py b/scripts/gha/report_build_status.py index 42586b35aa..6bfcf887b7 100644 --- a/scripts/gha/report_build_status.py +++ b/scripts/gha/report_build_status.py @@ -482,8 +482,13 @@ def main(argv): sorted_artifacts = sorted(artifacts, key=lambda art: dateutil.parser.parse(art['created_at']), reverse=True) with tempfile.TemporaryDirectory() as tmpdir: + downloaded_artifact_names = set() for a in sorted_artifacts: # Iterate over sorted artifacts if 'log-artifact' in a['name']: + if a['name'] in downloaded_artifact_names: + logging.debug("Skipping older attempt of artifact: %s (ID: %s, Created: %s)", a['name'], a['id'], a['created_at']) + continue + downloaded_artifact_names.add(a['name']) logging.debug("Attempting to download artifact: %s (ID: %s, Created: %s)", a['name'], a['id'], a['created_at']) # Pass tmpdir to download_artifact to save directly artifact_downloaded_path = os.path.join(tmpdir, f"{a['id']}.zip")