Skip to content

Commit

Permalink
Merge pull request #23541 from chaodaiG/deck-debug-no-startedjson
Browse files Browse the repository at this point in the history
Deck: log debug instead of warning when started.json not exist
  • Loading branch information
k8s-ci-robot authored Sep 10, 2021
2 parents c04b53d + 0d02a18 commit 6f3637f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions prow/cmd/deck/job_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func getBuildData(ctx context.Context, bucket storageBucket, dir string) (buildD
started := gcs.Started{}
err := readJSON(ctx, bucket, path.Join(dir, prowv1.StartedStatusFile), &started)
if err != nil {
return b, fmt.Errorf("failed to read started.json: %v", err)
return b, fmt.Errorf("failed to read started.json: %w", err)
}
b.Started = time.Unix(started.Timestamp, 0)
finished := gcs.Finished{}
Expand Down Expand Up @@ -495,7 +495,11 @@ func getJobHistory(ctx context.Context, url *url.URL, cfg config.Getter, opener
}
b, err := getBuildData(ctx, bucket, dir)
if err != nil {
logrus.WithError(err).Warningf("build %d information incomplete", buildID)
if pkgio.IsNotExist(err) {
logrus.WithError(err).WithField("build-id", buildID).Debug("Build information incomplete.")
} else {
logrus.WithError(err).WithField("build-id", buildID).Warning("Build information incomplete.")
}
}
b.index = i
b.ID = id
Expand Down
7 changes: 6 additions & 1 deletion prow/cmd/deck/pr_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"k8s.io/test-infra/prow/gcsupload"
"k8s.io/test-infra/prow/git/v2"
"k8s.io/test-infra/prow/io"
pkgio "k8s.io/test-infra/prow/io"
"k8s.io/test-infra/prow/pod-utils/downwardapi"
)

Expand Down Expand Up @@ -143,7 +144,11 @@ func getPRBuildData(ctx context.Context, bucket storageBucket, jobs []jobBuilds)
go func(j int, jobName, buildPrefix string) {
build, err := getBuildData(ctx, bucket, buildPrefix)
if err != nil {
logrus.WithError(err).Warningf("build %s information incomplete", buildPrefix)
if pkgio.IsNotExist(err) {
logrus.WithError(err).WithField("prefix", buildPrefix).Debug("Build information incomplete.")
} else {
logrus.WithError(err).WithField("prefix", buildPrefix).Warning("Build information incomplete.")
}
}
split := strings.Split(strings.TrimSuffix(buildPrefix, "/"), "/")
build.SpyglassLink = path.Join(spyglassPrefix, bucket.getStorageProvider(), bucket.getName(), buildPrefix)
Expand Down

0 comments on commit 6f3637f

Please sign in to comment.