diff --git a/joint_teapot/app.py b/joint_teapot/app.py index 0db1851..eb69963 100644 --- a/joint_teapot/app.py +++ b/joint_teapot/app.py @@ -325,7 +325,9 @@ def joj3_create_result_issue( + f"{settings.gitea_org_name}/{submitter_repo_name}/" + f"actions/runs/{run_number}" ) - title, comment = joj3.generate_title_and_comment(score_file_path, action_link) + title, comment = joj3.generate_title_and_comment( + score_file_path, action_link, run_number + ) tea.pot.gitea.create_issue(submitter_repo_name, title, comment, False) diff --git a/joint_teapot/utils/joj3.py b/joint_teapot/utils/joj3.py index 8ca09bf..088957b 100644 --- a/joint_teapot/utils/joj3.py +++ b/joint_teapot/utils/joj3.py @@ -166,23 +166,22 @@ def generate_failed_table( def generate_title_and_comment( - score_file_path: str, action_link: str + score_file_path: str, action_link: str, run_number: str ) -> Tuple[str, str]: with open(score_file_path) as json_file: stages: List[Dict[str, Any]] = json.load(json_file) total_score = 0 - comment = f"Generated by [Gitea Actions]({action_link})\n" + comment = f"Generated by [Gitea Actions #{run_number}]({action_link})\n" for stage in stages: - comment += f"## {stage['name']}\n" + comment += f"## {stage['name']}" single_case = len(stage["results"]) == 1 + if single_case: + comment += f" - Score: {stage['results'][0]['score']}" + comment += "\n" for i, result in enumerate(stage["results"]): - comment += "### " if not single_case: - comment += f"Case {i} - Score: {result['score']}" - else: - comment += f"Score: {result['score']}" - comment += "\n" + comment += f"### Case {i} - Score: {result['score']}\n" if result["comment"].strip() != "": comment += f"{result['comment']}\n" total_score += result["score"]