Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions github_scripts/suite_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"""

import re
import os
import shutil
import sqlite3
import subprocess
Expand Down Expand Up @@ -317,6 +318,21 @@ def get_workflow_id(self) -> str:

return "unknown_workflow_id"

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={encoded_workflow_id})"
)

return cylc_review


def get_suite_starttime(self) -> str:
"""
Read the suite starttime from the suite database
Expand Down
6 changes: 5 additions & 1 deletion github_scripts/suite_report_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)),
Expand Down Expand Up @@ -185,6 +186,9 @@ def create_task_tables(self, parsed_tasks: Dict[str, List[str]]) -> None:
for state in order:
emoji = state_emojis[state]
tasks = parsed_tasks[state]
if state == "succeeded":
self.trac_log.append(f"{emoji} {state} tasks - {len(tasks)}")
continue
if not tasks:
continue
if state == "pink failure":
Expand Down