From 9021667f82eace29da4cb60d59070b3a3bb7a0cd Mon Sep 17 00:00:00 2001 From: vdimir Date: Thu, 2 Nov 2023 08:44:03 +0000 Subject: [PATCH] Fix link to failed check report in status commit --- tests/ci/commit_status_helper.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/ci/commit_status_helper.py b/tests/ci/commit_status_helper.py index aeeb8531aac..09e3478b3fc 100644 --- a/tests/ci/commit_status_helper.py +++ b/tests/ci/commit_status_helper.py @@ -242,12 +242,12 @@ def generate_status_comment(pr_info: PRInfo, statuses: CommitStatuses) -> str: for desc, gs in grouped_statuses.items(): state = get_worst_state(gs) state_text = f"{STATUS_ICON_MAP[state]} {state}" - # take the first target_url - target_url = next( - (status.target_url for status in gs if status.target_url), None - ) - if target_url: - state_text = f'{state_text}' + # take the first target_url with the worst state + for status in gs: + if status.target_url and status.state == state: + state_text = f'{state_text}' + break + table_row = ( f"{desc.name}{desc.description}" f"{state_text}\n"