From fb58377700da8ab8c580d906e8e7b19f720a5a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Hadnagy?= Date: Fri, 18 Jul 2025 13:45:47 +0200 Subject: [PATCH] Slack CI bot: set default result for non-existing artifacts (#39499) * Set default result for non-existing artifacts * FMT * Address review comments --- utils/notification_service.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/notification_service.py b/utils/notification_service.py index 5d33389dbc..2848c5670c 100644 --- a/utils/notification_service.py +++ b/utils/notification_service.py @@ -1426,7 +1426,17 @@ if __name__ == "__main__": if len(matrix_job_results) > 0: target_results = matrix_job_results else: - target_results = additional_results[job_to_test_map[job_name]] + default_result = { + "failed": {"unclassified": 0, "single": 0, "multi": 0}, + "success": 0, + "time_spent": "", + "error": False, + "failures": {}, + "job_link": {}, + } + + key = job_to_test_map.get(job_name) + target_results = additional_results.get(key, default_result) if key is not None else default_result # Make the format uniform between `model_results` and `additional_results[XXX]` if "failures" in target_results: