From 0009128de92a56e1a2bd7c1079c3d012ab5a0f69 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Wed, 30 Oct 2024 17:50:57 -0400 Subject: [PATCH] feat(cmd/joj3): option to remove submitter in issue title --- cmd/joj3/conf/conf.go | 17 +++++++++-------- cmd/joj3/teapot/run.go | 6 +++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/cmd/joj3/conf/conf.go b/cmd/joj3/conf/conf.go index cb79bd6..225588c 100644 --- a/cmd/joj3/conf/conf.go +++ b/cmd/joj3/conf/conf.go @@ -46,14 +46,15 @@ type Conf struct { Stages []ConfStage } Teapot struct { - LogPath string `default:"/home/tt/.cache/joint-teapot-debug.log"` - EnvFilePath string `default:"/home/tt/.config/teapot/teapot.env"` - ScoreboardPath string `default:"scoreboard.csv"` - FailedTablePath string `default:"failed-table.md"` - GradingRepoName string `default:""` - SkipIssue bool `default:"false"` - SkipScoreboard bool `default:"false"` - SkipFailedTable bool `default:"false"` + LogPath string `default:"/home/tt/.cache/joint-teapot-debug.log"` + EnvFilePath string `default:"/home/tt/.config/teapot/teapot.env"` + ScoreboardPath string `default:"scoreboard.csv"` + FailedTablePath string `default:"failed-table.md"` + GradingRepoName string `default:""` + SkipIssue bool `default:"false"` + SkipScoreboard bool `default:"false"` + SkipFailedTable bool `default:"false"` + SubmitterInIssueTitle bool `default:"true"` } // TODO: remove the following backward compatibility fields SandboxExecServer string `default:"localhost:5051"` diff --git a/cmd/joj3/teapot/run.go b/cmd/joj3/teapot/run.go index 1cf51a7..5b35f4b 100644 --- a/cmd/joj3/teapot/run.go +++ b/cmd/joj3/teapot/run.go @@ -70,12 +70,16 @@ func Run(conf *conf.Conf) error { if conf.Teapot.SkipFailedTable { skipFailedTableArg = "--skip-failed-table" } + submitterInIssueTitleArg := "--no-submitter-in-issue-title" + if conf.Teapot.SubmitterInIssueTitle { + submitterInIssueTitleArg = "--submitter-in-issue-title" + } if err := execCommand("joint-teapot", []string{ "joj3-all", conf.Teapot.EnvFilePath, conf.Stage.OutputPath, actor, conf.Teapot.GradingRepoName, repoName, runNumber, conf.Teapot.ScoreboardPath, conf.Teapot.FailedTablePath, conf.Name, sha, skipIssueArg, skipScoreboardArg, - skipFailedTableArg, + skipFailedTableArg, submitterInIssueTitleArg, }); err != nil { slog.Error("teapot exit", "error", err) return fmt.Errorf("teapot exit")