Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cmd/pj-rehearse/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,9 @@ func rehearseMain() int {
return gracefulExit(o.noFail, misconfigurationOutput)
}
}
metrics.JobSpec = jobSpec

prFields := logrus.Fields{prowgithub.OrgLogField: jobSpec.Refs.Org, prowgithub.RepoLogField: jobSpec.Refs.Repo}
metrics.Org = jobSpec.Refs.Org
metrics.Repo = jobSpec.Refs.Repo
logger := logrus.WithFields(prFields)

if jobSpec.Type != pjapi.PresubmitJob {
Expand All @@ -149,7 +148,7 @@ func rehearseMain() int {
if o.local {
prNumber = int(time.Now().Unix())
}
metrics.Pr = prNumber

logger = logrus.WithField(prowgithub.PrLogField, prNumber)
logger.Info("Rehearsing Prow jobs for a configuration PR")

Expand Down
10 changes: 7 additions & 3 deletions pkg/rehearse/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/sirupsen/logrus"
prowconfig "k8s.io/test-infra/prow/config"
"k8s.io/test-infra/prow/pod-utils/downwardapi"

"github.com/openshift/ci-operator-prowgen/pkg/config"
)
Expand All @@ -17,9 +18,7 @@ type ExecutionMetrics struct {
}

type Metrics struct {
Org string `json:"org"`
Repo string `json:"repo"`
Pr int `json:"pr"`
JobSpec *downwardapi.JobSpec `json:"spec"`

ChangedCiopConfigs []string `json:"changed_ciop_configs"`
ChangedPresubmits []string `json:"changed_presubmits"`
Expand All @@ -34,6 +33,11 @@ type Metrics struct {

logger logrus.Entry
file string

// DEPRECATED (we need to keep these to read old artifacts)
Org string `json:"org"`
Repo string `json:"repo"`
Pr int `json:"pr"`
}

func NewMetrics(file string) *Metrics {
Expand Down