From d30a33e34685200965aae5e1d315a118b46db29a Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 5 Sep 2014 14:48:12 -0700 Subject: [PATCH] dashboard/builder: finish the previous -report=false change We weren't using the *report flag enough. LGTM=proppy R=proppy CC=golang-codereviews https://golang.org/cl/132650043 --- dashboard/builder/http.go | 9 +++++++++ dashboard/builder/main.go | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dashboard/builder/http.go b/dashboard/builder/http.go index 52785ab1..d9f95976 100644 --- a/dashboard/builder/http.go +++ b/dashboard/builder/http.go @@ -123,6 +123,9 @@ func (b *Builder) todo(kinds []string, pkg, goHash string) (kind, rev string, be // recordResult sends build results to the dashboard func (b *Builder) recordResult(ok bool, pkg, hash, goHash, buildLog string, runTime time.Duration) error { + if !*report { + return nil + } req := obj{ "Builder": b.name, "PackagePath": pkg, @@ -158,12 +161,18 @@ type PerfArtifact struct { // recordPerfResult sends benchmarking results to the dashboard func (b *Builder) recordPerfResult(req *PerfResult) error { + if !*report { + return nil + } req.Builder = b.name args := url.Values{"key": {b.key}, "builder": {b.name}} return dash("POST", "perf-result", args, req, nil) } func postCommit(key, pkg string, l *HgLog) error { + if !*report { + return nil + } t, err := time.Parse(time.RFC3339, l.Date) if err != nil { return fmt.Errorf("parsing %q: %v", l.Date, t) diff --git a/dashboard/builder/main.go b/dashboard/builder/main.go index ec58ba30..0cfca74f 100644 --- a/dashboard/builder/main.go +++ b/dashboard/builder/main.go @@ -625,7 +625,11 @@ func isFile(name string) bool { // commitWatcher polls hg for new commits and tells the dashboard about them. func commitWatcher(goroot *Repo) { if *commitInterval == 0 { - log.Printf("commitInterval is %s, disabling commitWatcher", *commitInterval) + log.Printf("commitInterval is 0; disabling commitWatcher") + return + } + if !*report { + log.Printf("-report is false; disabling commitWatcher") return } // Create builder just to get master key.