feat(cmd/joj): conf with name (#53)
All checks were successful
submodules sync / sync (push) Successful in 36s
build / build (push) Successful in 2m3s
build / trigger-build-image (push) Successful in 8s

Reviewed-on: #53
Co-authored-by: Boming Zhang <bomingzh@sjtu.edu.cn>
Co-committed-by: Boming Zhang <bomingzh@sjtu.edu.cn>
This commit is contained in:
张泊明518370910136 2024-10-09 15:32:53 +08:00 committed by 张泊明518370910136
parent f785950053
commit 995c32efaf
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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") {