From 37f89ae57b6f7e13bf3e5d2f3e3f686b814b3525 Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Wed, 30 Oct 2024 18:59:44 -0400 Subject: [PATCH] feat: joj3 show run ID in issue body --- joint_teapot/app.py | 5 +++++ joint_teapot/utils/joj3.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/joint_teapot/app.py b/joint_teapot/app.py index 91233db..907e1d3 100644 --- a/joint_teapot/app.py +++ b/joint_teapot/app.py @@ -464,6 +464,10 @@ def joj3_all( "", help="commit hash that triggers gitea actions", ), + run_ID: str = Argument( + "unknown", + help="JOJ3 run ID", + ), skip_result_issue: bool = Option( False, help="skip creating result issue on gitea", @@ -503,6 +507,7 @@ def joj3_all( submitter, commit_hash, submitter_in_issue_title, + run_ID, ) title_prefix = joj3.get_title_prefix(title) joj3_issue: focs_gitea.Issue diff --git a/joint_teapot/utils/joj3.py b/joint_teapot/utils/joj3.py index a0b24e9..2ead66f 100644 --- a/joint_teapot/utils/joj3.py +++ b/joint_teapot/utils/joj3.py @@ -187,6 +187,7 @@ def generate_title_and_comment( submitter: str, commit_hash: str, submitter_in_title: bool = True, + run_ID: str = "unknown", ) -> Tuple[str, str]: with open(score_file_path) as json_file: stages: List[Dict[str, Any]] = json.load(json_file) @@ -201,7 +202,8 @@ def generate_title_and_comment( comment = ( f"Generated at {now} from [Gitea Actions #{run_number}]({action_link}), " f"commit {commit_hash}, " - f"triggered by @{submitter}.\n" + f"triggered by @{submitter}, " + f"run ID {run_ID}.\n" "Powered by [JOJ3](https://github.com/joint-online-judge/JOJ3) and " "[Joint-Teapot](https://github.com/BoYanZh/Joint-Teapot) with ❤️.\n" )