From f06bc21eeb2f744460c22dbd231560544b0d77c1 Mon Sep 17 00:00:00 2001 From: Nuvole Date: Wed, 23 Oct 2024 22:45:25 +0800 Subject: [PATCH] feat: combine dummy & result-staus --- joj3_config_generator/lib/task.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/joj3_config_generator/lib/task.py b/joj3_config_generator/lib/task.py index 7a29cf7..caa45ff 100644 --- a/joj3_config_generator/lib/task.py +++ b/joj3_config_generator/lib/task.py @@ -252,3 +252,15 @@ def fix_diff( conf_stage.executor.with_.cases = stage_cases return conf_stage + + +def fix_comment(task_stage: TaskStage, conf_stage: ResultStage) -> ResultStage: + comment_parser = ["dummy", "result-status"] + for parser in task_stage.parsers: + if parser in comment_parser: + comment_parser_ = next(p for p in conf_stage.parsers if p.name == parser) + if getattr(task_stage, parser, None) is not None: + comment_parser_.with_.update(getattr(task_stage, parser)) + else: + continue + return conf_stage