Compare commits
No commits in common. "2a3ccb71df70fe986c7995fd418a644dd0a9d18d" and "31c310960ff478823500fb2b101a275657270477" have entirely different histories.
2a3ccb71df
...
31c310960f
|
@ -14,6 +14,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/env"
|
||||||
"github.com/joint-online-judge/JOJ3/internal/stage"
|
"github.com/joint-online-judge/JOJ3/internal/stage"
|
||||||
"github.com/koding/multiconfig"
|
"github.com/koding/multiconfig"
|
||||||
)
|
)
|
||||||
|
@ -164,7 +165,7 @@ func parseConventionalCommit(commit string) (*ConventionalCommit, error) {
|
||||||
return cc, nil
|
return cc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseConfFile(path string) (conf *Conf, name string, err error) {
|
func ParseConfFile(path string) (conf *Conf, err error) {
|
||||||
conf = new(Conf)
|
conf = new(Conf)
|
||||||
d := &multiconfig.DefaultLoader{}
|
d := &multiconfig.DefaultLoader{}
|
||||||
d.Loader = multiconfig.MultiLoader(
|
d.Loader = multiconfig.MultiLoader(
|
||||||
|
@ -180,7 +181,7 @@ func ParseConfFile(path string) (conf *Conf, name string, err error) {
|
||||||
slog.Error("validate stages conf", "error", err)
|
slog.Error("validate stages conf", "error", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
name = conf.Name
|
env.Attr.ConfName = conf.Name
|
||||||
// TODO: remove the following backward compatibility codes
|
// TODO: remove the following backward compatibility codes
|
||||||
if conf.MaxTotalScore < 0 && conf.Teapot.MaxTotalScore >= 0 {
|
if conf.MaxTotalScore < 0 && conf.Teapot.MaxTotalScore >= 0 {
|
||||||
conf.MaxTotalScore = conf.Teapot.MaxTotalScore
|
conf.MaxTotalScore = conf.Teapot.MaxTotalScore
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/conf"
|
||||||
"github.com/joint-online-judge/JOJ3/cmd/joj3/env"
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/env"
|
||||||
"github.com/joint-online-judge/JOJ3/internal/conf"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var runningTest bool
|
var runningTest bool
|
||||||
|
|
|
@ -6,10 +6,9 @@ import (
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/joint-online-judge/JOJ3/cmd/joj3/env"
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/conf"
|
||||||
"github.com/joint-online-judge/JOJ3/cmd/joj3/stage"
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/stage"
|
||||||
"github.com/joint-online-judge/JOJ3/cmd/joj3/teapot"
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/teapot"
|
||||||
"github.com/joint-online-judge/JOJ3/internal/conf"
|
|
||||||
internalStage "github.com/joint-online-judge/JOJ3/internal/stage"
|
internalStage "github.com/joint-online-judge/JOJ3/internal/stage"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -86,12 +85,11 @@ func mainImpl() (err error) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
slog.Info("try to load conf", "path", confPath)
|
slog.Info("try to load conf", "path", confPath)
|
||||||
confObj, confName, err := conf.ParseConfFile(confPath)
|
confObj, err = conf.ParseConfFile(confPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("parse conf", "error", err)
|
slog.Error("parse conf", "error", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
env.Attr.ConfName = confName
|
|
||||||
slog.Debug("conf loaded", "conf", confObj)
|
slog.Debug("conf loaded", "conf", confObj)
|
||||||
if err := setupSlog(confObj); err != nil { // after conf is loaded
|
if err := setupSlog(confObj); err != nil { // after conf is loaded
|
||||||
slog.Error("setup slog", "error", err)
|
slog.Error("setup slog", "error", err)
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/conf"
|
||||||
"github.com/joint-online-judge/JOJ3/cmd/joj3/teapot"
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/teapot"
|
||||||
"github.com/joint-online-judge/JOJ3/internal/conf"
|
|
||||||
executors "github.com/joint-online-judge/JOJ3/internal/executor"
|
executors "github.com/joint-online-judge/JOJ3/internal/executor"
|
||||||
_ "github.com/joint-online-judge/JOJ3/internal/parser"
|
_ "github.com/joint-online-judge/JOJ3/internal/parser"
|
||||||
"github.com/joint-online-judge/JOJ3/internal/stage"
|
"github.com/joint-online-judge/JOJ3/internal/stage"
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/conf"
|
||||||
"github.com/joint-online-judge/JOJ3/cmd/joj3/env"
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/env"
|
||||||
"github.com/joint-online-judge/JOJ3/internal/conf"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type CheckResult struct {
|
type CheckResult struct {
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/conf"
|
||||||
"github.com/joint-online-judge/JOJ3/cmd/joj3/env"
|
"github.com/joint-online-judge/JOJ3/cmd/joj3/env"
|
||||||
"github.com/joint-online-judge/JOJ3/internal/conf"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type RunResult struct {
|
type RunResult struct {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user