From 06e39149e9611679efe9834ef3a08e97c471ea36 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 7 Jan 2026 11:51:31 +0000 Subject: [PATCH 01/15] Skip success and implement cylc_review url --- github_scripts/suite_data.py | 5 ++++- github_scripts/suite_report_git.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index 706c90d..3b7f91b 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -9,6 +9,7 @@ """ import re +import os import shutil import sqlite3 import subprocess @@ -309,10 +310,12 @@ def get_workflow_id(self) -> str: match = re.search(r"INFO - Workflow: (\S+\/\w+)", line) try: workflow_id = match.group(1) - return workflow_id except IndexError: continue + cylc_review = f"https://cylchub/services/cylc-review/{os.environ['USER']}/?suite={workflow_id.replace("/","%2")}" + return cylc_review + return "unknown_workflow_id" def get_suite_starttime(self) -> str: diff --git a/github_scripts/suite_report_git.py b/github_scripts/suite_report_git.py index 6d5069a..37521dd 100755 --- a/github_scripts/suite_report_git.py +++ b/github_scripts/suite_report_git.py @@ -184,6 +184,8 @@ def create_task_tables(self, parsed_tasks: Dict[str, List[str]]) -> None: # Create Collapsed task tables for state in order: + if state == "succeeded": + continue emoji = state_emojis[state] tasks = parsed_tasks[state] if not tasks: From 852fc608dd6692d6acaf7cee9431e7632c01d142 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 7 Jan 2026 12:36:56 +0000 Subject: [PATCH 02/15] Apply black formatting --- github_scripts/suite_data.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index 3b7f91b..3f080d9 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -313,7 +313,12 @@ def get_workflow_id(self) -> str: except IndexError: continue - cylc_review = f"https://cylchub/services/cylc-review/{os.environ['USER']}/?suite={workflow_id.replace("/","%2")}" + suite_user = os.environ["USER"] + workflow_id_encoded = workflow_id.replace("/", "%2F") + + cylc_review = f"""https://cylchub/services/cylc-review/ + {suite_user}/?suite={workflow_id_encoded}""" + return cylc_review return "unknown_workflow_id" From ac402e0bb6724124c291cdd765ec3ffe23ef3f04 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 7 Jan 2026 13:24:00 +0000 Subject: [PATCH 03/15] Add break statement --- github_scripts/suite_data.py | 1 + 1 file changed, 1 insertion(+) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index 3f080d9..0fb5f57 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -310,6 +310,7 @@ def get_workflow_id(self) -> str: match = re.search(r"INFO - Workflow: (\S+\/\w+)", line) try: workflow_id = match.group(1) + break except IndexError: continue From c733758abc3744a36393b568d6e8fb920f2cc242 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Thu, 8 Jan 2026 09:39:03 +0000 Subject: [PATCH 04/15] update suite name link --- github_scripts/suite_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index 0fb5f57..558c232 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -318,7 +318,7 @@ def get_workflow_id(self) -> str: workflow_id_encoded = workflow_id.replace("/", "%2F") cylc_review = f"""https://cylchub/services/cylc-review/ - {suite_user}/?suite={workflow_id_encoded}""" + cycles/{suite_user}/?suite={workflow_id_encoded}""" return cylc_review From e5b7cf3eb0f82fbfc944bcab1cbe04b6fa062432 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 10:27:29 +0000 Subject: [PATCH 05/15] Print number of succeeded tasks --- github_scripts/suite_report_git.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/github_scripts/suite_report_git.py b/github_scripts/suite_report_git.py index 17a8761..4bfa35b 100755 --- a/github_scripts/suite_report_git.py +++ b/github_scripts/suite_report_git.py @@ -183,10 +183,11 @@ def create_task_tables(self, parsed_tasks: Dict[str, List[str]]) -> None: # Create Collapsed task tables for state in order: - if state == "succeeded": - continue emoji = state_emojis[state] tasks = parsed_tasks[state] + if state == "succeeded": + continue + self.trac_log.append(f"{emoji} {state} tasks - {len(tasks)}") if not tasks: continue if state == "pink failure": From b4cf12731f221c0484110e012c8cc4b503624554 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 11:59:22 +0000 Subject: [PATCH 06/15] generate cylc review page link in markdown --- github_scripts/suite_data.py | 19 +++++++++++++------ github_scripts/suite_report_git.py | 3 ++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index a2f0aa8..f1f84a0 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -316,15 +316,22 @@ def get_workflow_id(self) -> str: except IndexError: continue - suite_user = os.environ["USER"] - workflow_id_encoded = workflow_id.replace("/", "%2F") + return workflow_id - cylc_review = f"""https://cylchub/services/cylc-review/ - cycles/{suite_user}/?suite={workflow_id_encoded}""" + return "unknown_workflow_id" + + def generate_cylc_url(self) -> str: + """ + Generate a markdown url to the cylc review page of a workflow + """ + workflow_id = self.get_workflow_id() + suite_user = os.environ["USER"] - return cylc_review + cylc_review = f"""[{workflow_id}](https://cylchub/services/cylc-review/cycles + /{suite_user}/?suite={workflow_id.replace("/","%2F")})""" + + return cylc_review - return "unknown_workflow_id" def get_suite_starttime(self) -> str: """ diff --git a/github_scripts/suite_report_git.py b/github_scripts/suite_report_git.py index 4bfa35b..9c6f314 100755 --- a/github_scripts/suite_report_git.py +++ b/github_scripts/suite_report_git.py @@ -73,6 +73,7 @@ def __init__(self, suite_path: Path) -> None: self.suite_user = suite_path.owner() self.suite_starttime: str = self.get_suite_starttime() self.workflow_id: str = self.get_workflow_id() + self.cylc_url: str = self.generate_cylc_url() self.task_states: Dict[str, str] = self.get_task_states() self.groups: List[str] = self.read_groups_run() self.rose_data: Dict[str, str] = self.read_rose_conf() @@ -118,7 +119,7 @@ def create_suite_info_table(self) -> None: self.trac_log.extend(create_markdown_row("Item", "Value", header=True)) rows = ( - ("Suite Name", self.workflow_id), + ("Suite Name", self.cylc_url), ("Suite User", self.suite_user), ("Workflow Start", self.suite_starttime), ("Groups Run", ",".join(g for g in self.groups)), From b3fa7c59a49576319b576bbd5a722b240dfbe208 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:48:32 +0000 Subject: [PATCH 07/15] remove break function --- github_scripts/suite_data.py | 1 - 1 file changed, 1 deletion(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index f1f84a0..e7548d8 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -312,7 +312,6 @@ def get_workflow_id(self) -> str: match = re.search(r"INFO - Workflow: (\S+\/\w+)", line) try: workflow_id = match.group(1) - break except IndexError: continue From 7f26ef99fb9910ad27f3fe756ec6c82c786824ce Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:52:23 +0000 Subject: [PATCH 08/15] reformat cylc review url --- github_scripts/suite_data.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index e7548d8..abf161b 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -326,8 +326,10 @@ def generate_cylc_url(self) -> str: workflow_id = self.get_workflow_id() suite_user = os.environ["USER"] - cylc_review = f"""[{workflow_id}](https://cylchub/services/cylc-review/cycles - /{suite_user}/?suite={workflow_id.replace("/","%2F")})""" + cylc_review = ( + f"[{workflow_id}](https://cylchub/services/cylc-review/cycles" + f"/{suite_user}/?suite={workflow_id.replace("/","%2F")})" + ) return cylc_review From fbb411d76831d5583d9d6a25287b374021a234b3 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:54:54 +0000 Subject: [PATCH 09/15] use workflow id attribute to construct url --- github_scripts/suite_data.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index abf161b..f9f13e4 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -323,12 +323,11 @@ def generate_cylc_url(self) -> str: """ Generate a markdown url to the cylc review page of a workflow """ - workflow_id = self.get_workflow_id() suite_user = os.environ["USER"] cylc_review = ( - f"[{workflow_id}](https://cylchub/services/cylc-review/cycles" - f"/{suite_user}/?suite={workflow_id.replace("/","%2F")})" + f"[{self.workflow_id}](https://cylchub/services/cylc-review/cycles" + f"/{suite_user}/?suite={self.workflow_id.replace("/","%2F")})" ) return cylc_review From 55a0e4b036afa28689bfe6dbc15d0770c14b8479 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 14:44:56 +0000 Subject: [PATCH 10/15] Reshuffle trac log append into if statement --- github_scripts/suite_report_git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github_scripts/suite_report_git.py b/github_scripts/suite_report_git.py index 9c6f314..0f472f6 100755 --- a/github_scripts/suite_report_git.py +++ b/github_scripts/suite_report_git.py @@ -187,8 +187,8 @@ def create_task_tables(self, parsed_tasks: Dict[str, List[str]]) -> None: emoji = state_emojis[state] tasks = parsed_tasks[state] if state == "succeeded": + self.trac_log.append(f"{emoji} {state} tasks - {len(tasks)}") continue - self.trac_log.append(f"{emoji} {state} tasks - {len(tasks)}") if not tasks: continue if state == "pink failure": From 554e073e72cf8312348f4fe7e04280414bf38645 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 14:46:33 +0000 Subject: [PATCH 11/15] apply black formatting --- github_scripts/suite_data.py | 1 - 1 file changed, 1 deletion(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index f9f13e4..3591c86 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -332,7 +332,6 @@ def generate_cylc_url(self) -> str: return cylc_review - def get_suite_starttime(self) -> str: """ Read the suite starttime from the suite database From bc4a8b593303bdda17c018d4890b73b10d27e556 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 15:21:29 +0000 Subject: [PATCH 12/15] Revert "apply black formatting" This reverts commit 554e073e72cf8312348f4fe7e04280414bf38645. --- github_scripts/suite_data.py | 1 + 1 file changed, 1 insertion(+) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index 3591c86..f9f13e4 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -332,6 +332,7 @@ def generate_cylc_url(self) -> str: return cylc_review + def get_suite_starttime(self) -> str: """ Read the suite starttime from the suite database From 78f3cf14f7da1fa491183bc8c4143741ef6d5a65 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 16:02:09 +0000 Subject: [PATCH 13/15] Fix quotation issue --- github_scripts/suite_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index f9f13e4..5140c0d 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -327,7 +327,7 @@ def generate_cylc_url(self) -> str: cylc_review = ( f"[{self.workflow_id}](https://cylchub/services/cylc-review/cycles" - f"/{suite_user}/?suite={self.workflow_id.replace("/","%2F")})" + f"/{suite_user}/?suite={self.workflow_id.replace('/','%2F')})" ) return cylc_review From d069931f27a587a13e5c7e29cf47f48296e3a660 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 16:18:08 +0000 Subject: [PATCH 14/15] Fix f-string evaluation --- github_scripts/suite_data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index 5140c0d..df225a3 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -324,10 +324,11 @@ def generate_cylc_url(self) -> str: Generate a markdown url to the cylc review page of a workflow """ suite_user = os.environ["USER"] + encoded_workflow_id = self.workflow_id.replace('/','%2F') cylc_review = ( f"[{self.workflow_id}](https://cylchub/services/cylc-review/cycles" - f"/{suite_user}/?suite={self.workflow_id.replace('/','%2F')})" + f"/{suite_user}/?suite={encoded_workflow_id})" ) return cylc_review From af94d821dd125855751615b1872da4cb7cc818f6 Mon Sep 17 00:00:00 2001 From: Pierre Siddall <43399998+Pierre-siddall@users.noreply.github.com> Date: Wed, 14 Jan 2026 16:26:45 +0000 Subject: [PATCH 15/15] revert to return in try except block --- github_scripts/suite_data.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/github_scripts/suite_data.py b/github_scripts/suite_data.py index df225a3..add597f 100644 --- a/github_scripts/suite_data.py +++ b/github_scripts/suite_data.py @@ -312,11 +312,10 @@ def get_workflow_id(self) -> str: match = re.search(r"INFO - Workflow: (\S+\/\w+)", line) try: workflow_id = match.group(1) + return workflow_id except IndexError: continue - return workflow_id - return "unknown_workflow_id" def generate_cylc_url(self) -> str: