Compare commits

..

6 Commits

Author SHA1 Message Date
240cc571bd Merge branch 'master' into fix/forbidden
All checks were successful
build / build (push) Successful in 1m14s
build / build (pull_request) Successful in 1m13s
build / trigger-build-image (push) Has been skipped
build / trigger-build-image (pull_request) Has been skipped
2024-10-18 14:31:02 +08:00
ff0b0957eb
refactor(cmd/joj3): backward compatible arg order [force build]
All checks were successful
build / build (push) Successful in 1m2s
build / trigger-build-image (push) Successful in 7s
2024-10-16 23:40:39 -04:00
fcc1f1856f
feat(cmd/joj3): pass commit hash to teapot [force build]
All checks were successful
build / build (push) Successful in 1m7s
build / trigger-build-image (push) Successful in 6s
2024-10-16 21:00:03 -04:00
7ff6dfb002 fix(parser/clangtidy): ignore empty lines
All checks were successful
build / build (push) Successful in 1m8s
build / trigger-build-image (push) Successful in 7s
2024-10-16 16:15:54 -04:00
e44537ea95 feat(cmd/joj3): issue with actor [force build]
All checks were successful
build / build (push) Successful in 1m4s
build / trigger-build-image (push) Successful in 7s
2024-10-17 03:15:40 +08:00
1e83ba4b87
fix(parser/resultdetail): format on empty error
All checks were successful
build / build (push) Successful in 1m3s
build / trigger-build-image (push) Successful in 7s
2024-10-15 20:56:04 -04:00
4 changed files with 14 additions and 10 deletions

View File

@ -21,8 +21,7 @@ func Run(conf *conf.Conf) error {
os.Setenv("LOG_FILE_PATH", conf.Teapot.LogPath)
os.Setenv("_TYPER_STANDARD_TRACEBACK", "1")
envFilePath := "/home/tt/.config/teapot/teapot.env"
// TODO: pass sha to joint-teapot
// sha := os.Getenv("GITHUB_SHA")
sha := os.Getenv("GITHUB_SHA")
actor := os.Getenv("GITHUB_ACTOR")
repository := os.Getenv("GITHUB_REPOSITORY")
runNumber := os.Getenv("GITHUB_RUN_NUMBER")
@ -55,7 +54,7 @@ func Run(conf *conf.Conf) error {
err := execCommand("joint-teapot", []string{
"joj3-scoreboard", envFilePath, conf.Stage.OutputPath, actor,
conf.Teapot.GradingRepoName, repoName, runNumber,
conf.Teapot.ScoreboardPath, conf.Name,
conf.Teapot.ScoreboardPath, conf.Name, sha,
})
if err != nil {
scoreboardErr = err
@ -65,7 +64,7 @@ func Run(conf *conf.Conf) error {
err := execCommand("joint-teapot", []string{
"joj3-failed-table", envFilePath, conf.Stage.OutputPath, actor,
conf.Teapot.GradingRepoName, repoName, runNumber,
conf.Teapot.FailedTablePath, conf.Name,
conf.Teapot.FailedTablePath, conf.Name, sha,
})
if err != nil {
failedTableErr = err
@ -77,7 +76,7 @@ func Run(conf *conf.Conf) error {
if !conf.Teapot.SkipIssue {
err := execCommand("joint-teapot", []string{
"joj3-create-result-issue", envFilePath, conf.Stage.OutputPath,
repoName, runNumber, conf.Name,
repoName, runNumber, conf.Name, actor, sha,
})
if err != nil {
issueErr = err

View File

@ -6,6 +6,7 @@ import (
"path/filepath"
"regexp"
"strconv"
"strings"
)
type Level int
@ -68,6 +69,9 @@ func levelFromString(levelString string) Level {
}
func isIgnored(line string) bool {
if strings.TrimSpace(line) == "" {
return true
}
ignoreRegex := regexp.MustCompile("^error:.*$")
return ignoreRegex.MatchString(line)
}

View File

@ -24,11 +24,6 @@ type ClangTidy struct{}
func Parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
stdout := executorResult.Files["stdout"]
stderr := executorResult.Files["stderr"]
lines := strings.SplitAfter(stdout, "\n")
messages := ParseLines(lines, conf)
formattedMessages := Format(messages)
if executorResult.Status != stage.Status(envexec.StatusAccepted) {
if !((executorResult.Status == stage.Status(envexec.StatusNonzeroExitStatus)) &&
(executorResult.ExitStatus == 1)) {
@ -41,6 +36,9 @@ func Parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
}
}
}
lines := strings.SplitAfter(stdout, "\n")
messages := ParseLines(lines, conf)
formattedMessages := Format(messages)
score, comment := GetResult(formattedMessages, conf)
return stage.ParserResult{
Score: score,

View File

@ -33,6 +33,9 @@ func (*ResultDetail) Run(results []stage.ExecutorResult, confAny any) (
comment += fmt.Sprintf("Exit Status: `%d`\n", result.ExitStatus)
}
if conf.ShowError {
if result.Error == "" {
result.Error = "nil"
}
comment += fmt.Sprintf("Error: `%s`\n", result.Error)
}
if conf.ShowTime {