From 12f2c93fb82911868a81ec0ae4ddeed002c6a42a Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Fri, 1 Nov 2024 02:40:20 -0400 Subject: [PATCH] feat(cmd/joj3): support max total score [force build] --- cmd/joj3/conf/conf.go | 1 + cmd/joj3/teapot/run.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/joj3/conf/conf.go b/cmd/joj3/conf/conf.go index 5d22248..eaaad3e 100644 --- a/cmd/joj3/conf/conf.go +++ b/cmd/joj3/conf/conf.go @@ -54,6 +54,7 @@ type Conf struct { SkipScoreboard bool `default:"false"` SkipFailedTable bool `default:"false"` SubmitterInIssueTitle bool `default:"true"` + MaxTotalScore int `default:"-1"` } // 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 e0bb042..04f0ca6 100644 --- a/cmd/joj3/teapot/run.go +++ b/cmd/joj3/teapot/run.go @@ -7,6 +7,7 @@ import ( "os" "os/exec" "regexp" + "strconv" "strings" "sync" @@ -78,7 +79,8 @@ func Run(conf *conf.Conf, runID string) error { "joj3-all", conf.Teapot.EnvFilePath, conf.Stage.OutputPath, actor, conf.Teapot.GradingRepoName, repoName, runNumber, conf.Teapot.ScoreboardPath, conf.Teapot.FailedTablePath, - conf.Name, sha, runID, skipIssueArg, skipScoreboardArg, + conf.Name, sha, runID, strconv.Itoa(conf.Teapot.MaxTotalScore), + skipIssueArg, skipScoreboardArg, skipFailedTableArg, submitterInIssueTitleArg, }); err != nil { slog.Error("teapot exit", "error", err)