From 995c32efaf149a19b449494d2b9dbfeb29776ac2 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Wed, 9 Oct 2024 15:32:53 +0800 Subject: [PATCH] feat(cmd/joj): conf with name (#53) Reviewed-on: https://focs.ji.sjtu.edu.cn/git/JOJ/JOJ3/pulls/53 Co-authored-by: Boming Zhang Co-committed-by: Boming Zhang --- cmd/joj3/conf/conf.go | 1 + cmd/joj3/teapot/main.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/joj3/conf/conf.go b/cmd/joj3/conf/conf.go index e0a332d..944e62c 100644 --- a/cmd/joj3/conf/conf.go +++ b/cmd/joj3/conf/conf.go @@ -22,6 +22,7 @@ type Conf struct { SkipTeapot bool `default:"true"` ScoreboardPath string `default:"scoreboard.csv"` FailedTablePath string `default:"failed-table.md"` + Name string `default:"unknown"` Stages []struct { Name string Group string diff --git a/cmd/joj3/teapot/main.go b/cmd/joj3/teapot/main.go index 67ff1c4..74a4a60 100644 --- a/cmd/joj3/teapot/main.go +++ b/cmd/joj3/teapot/main.go @@ -31,7 +31,7 @@ func Run(conf conf.Conf) error { re := regexp.MustCompile(`\x1b\[[0-9;]*[a-zA-Z]`) cmd := exec.Command("joint-teapot", "joj3-scoreboard", envFilePath, conf.OutputPath, actor, conf.GradingRepoName, repoName, - runNumber, conf.ScoreboardPath) // #nosec G204 + runNumber, conf.ScoreboardPath, conf.Name) // #nosec G204 outputBytes, err := cmd.CombinedOutput() output := re.ReplaceAllString(string(outputBytes), "") for _, line := range strings.Split(output, "\n") { @@ -46,7 +46,7 @@ func Run(conf conf.Conf) error { } cmd = exec.Command("joint-teapot", "joj3-failed-table", envFilePath, conf.OutputPath, actor, conf.GradingRepoName, repoName, - runNumber, conf.FailedTablePath) // #nosec G204 + runNumber, conf.FailedTablePath, conf.Name) // #nosec G204 outputBytes, err = cmd.CombinedOutput() output = re.ReplaceAllString(string(outputBytes), "") for _, line := range strings.Split(output, "\n") { @@ -60,7 +60,7 @@ func Run(conf conf.Conf) error { return err } cmd = exec.Command("joint-teapot", "joj3-create-result-issue", - envFilePath, conf.OutputPath, repoName, runNumber) // #nosec G204 + envFilePath, conf.OutputPath, repoName, runNumber, conf.Name) // #nosec G204 outputBytes, err = cmd.CombinedOutput() output = re.ReplaceAllString(string(outputBytes), "") for _, line := range strings.Split(output, "\n") {