From 37bd5dd7beb39268fb7a9f491f78c00daa6a0f75 Mon Sep 17 00:00:00 2001 From: vdimir Date: Fri, 29 Sep 2023 08:46:23 +0000 Subject: [PATCH 1/2] Add links to check reports in status comment --- tests/ci/commit_status_helper.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/ci/commit_status_helper.py b/tests/ci/commit_status_helper.py index 2ed4ae7b59c..32351bb2855 100644 --- a/tests/ci/commit_status_helper.py +++ b/tests/ci/commit_status_helper.py @@ -240,9 +240,16 @@ def generate_status_comment(pr_info: PRInfo, statuses: CommitStatuses) -> str: hidden_table_rows = [] # type: List[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}]({target_url})" table_row = ( f"{desc.name}{desc.description}" - f"{STATUS_ICON_MAP[state]} {state}\n" + f"{state_text}\n" ) if state == SUCCESS: hidden_table_rows.append(table_row) From 7c471be846333b00d3c49981d54f5a135811e487 Mon Sep 17 00:00:00 2001 From: vdimir Date: Fri, 29 Sep 2023 12:00:07 +0200 Subject: [PATCH 2/2] Fix link in table in status comment --- tests/ci/commit_status_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci/commit_status_helper.py b/tests/ci/commit_status_helper.py index 32351bb2855..a24eaf4700d 100644 --- a/tests/ci/commit_status_helper.py +++ b/tests/ci/commit_status_helper.py @@ -246,7 +246,7 @@ def generate_status_comment(pr_info: PRInfo, statuses: CommitStatuses) -> str: (status.target_url for status in gs if status.target_url), None ) if target_url: - state_text = f"[{state_text}]({target_url})" + state_text = f'{state_text}' table_row = ( f"{desc.name}{desc.description}" f"{state_text}\n"