diff --git a/joj3_config_generator/models/task.py b/joj3_config_generator/models/task.py index 73c1ac1..d8ec64b 100644 --- a/joj3_config_generator/models/task.py +++ b/joj3_config_generator/models/task.py @@ -272,6 +272,12 @@ class Config(BaseModel): None, validation_alias=AliasChoices("max-total-score", "max_total_score") ) scoreboard: str = "scoreboard.csv" + scoreboard_column_by_ref: bool = Field( + False, + validation_alias=AliasChoices( + "scoreboard-column-by-ref", "scoreboard_column_by_ref" + ), + ) time: SubmissionTime = SubmissionTime() # Valid time configuration release: Release = Release() # Release configuration groups: Groups = Groups() diff --git a/joj3_config_generator/transformers/repo.py b/joj3_config_generator/transformers/repo.py index 5c1a719..fa3bb67 100644 --- a/joj3_config_generator/transformers/repo.py +++ b/joj3_config_generator/transformers/repo.py @@ -45,6 +45,8 @@ def get_teapot_post_stage( "--scoreboard-filename", task_conf.scoreboard, ] + if task_conf.scoreboard_column_by_ref: + args.append("--scoreboard-column-by-ref") if repo_conf.issue.label.exclusive: args.append("--issue-label-exclusive") if not repo_conf.issue.show_submitter: diff --git a/tests/convert/full/task.json b/tests/convert/full/task.json index 44b5f5c..f74a5bf 100644 --- a/tests/convert/full/task.json +++ b/tests/convert/full/task.json @@ -446,6 +446,7 @@ "#795548", "--scoreboard-filename", "scoreboard-hw7.csv", + "--scoreboard-column-by-ref", "--end-time", "2024-12-30T23:59:59", "--penalty-config", diff --git a/tests/convert/full/task.toml b/tests/convert/full/task.toml index b412cc5..6668a76 100644 --- a/tests/convert/full/task.toml +++ b/tests/convert/full/task.toml @@ -4,6 +4,9 @@ name = "hw7 ex3" # task name, will be shown in the issue title scoreboard = "auto" # scoreboard = "scoreboard-42.csv" # use this if you want to specify a custom scoreboard +# whether to use gitea ref as scoreboard column, instead of the task name, default: false +scoreboard-column-by-ref = true + # task triggered not in this time period will not pass the health check time.begin = 2024-12-29 23:59:59 # begin time, default: no start time, do not check time.end = 2024-12-30 23:59:59 # end time, default: no end time, do not check