From 1dd13c247803be82f1d52c909e33f4d37ed70665 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Fri, 22 Nov 2013 10:12:51 +0400 Subject: [PATCH] dashboard/builder: minor fixes and enhancements - do not print secret key - log app responses - allow to customize go repo R=adg, bradfitz CC=golang-dev https://golang.org/cl/29990046 --- dashboard/builder/http.go | 5 ++++- dashboard/builder/main.go | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dashboard/builder/http.go b/dashboard/builder/http.go index b50e84551b..1a3d15612f 100644 --- a/dashboard/builder/http.go +++ b/dashboard/builder/http.go @@ -27,7 +27,7 @@ func dash(meth, cmd string, args url.Values, req, resp interface{}) error { var r *http.Response var err error if *verbose { - log.Println("dash", meth, cmd, args, req) + log.Println("dash <-", meth, cmd, args, req) } cmd = "http://" + *dashboard + "/" + cmd if len(args) > 0 { @@ -79,6 +79,9 @@ func dash(meth, cmd string, args url.Values, req, resp interface{}) error { log.Printf("json unmarshal %#q: %s\n", body.Bytes(), err) return err } + if *verbose { + log.Println("dash ->", result) + } if result.Error != "" { return errors.New(result.Error) } diff --git a/dashboard/builder/main.go b/dashboard/builder/main.go index 404d0595e6..4759db4bb7 100644 --- a/dashboard/builder/main.go +++ b/dashboard/builder/main.go @@ -24,7 +24,6 @@ import ( const ( codeProject = "go" codePyScript = "misc/dashboard/googlecode_upload.py" - goImportPath = "code.google.com/p/go" gofrontendImportPath = "code.google.com/p/gofrontend" mkdirPerm = 0750 waitInterval = 30 * time.Second // time to wait before checking for new revs @@ -46,6 +45,7 @@ var ( buildRevision = flag.String("rev", "", "Build specified revision and exit") buildCmd = flag.String("cmd", filepath.Join(".", allCmd), "Build command (specify relative to go/src/)") buildTool = flag.String("tool", "go", "Tool to build.") + gcPath = flag.String("gcpath", "code.google.com/p/go", "Path to download gc from") gccPath = flag.String("gccpath", "svn://gcc.gnu.org/svn/gcc/trunk", "Path to download gcc from") failAll = flag.Bool("fail", false, "fail all builds") parallel = flag.Bool("parallel", false, "Build multiple targets in parallel") @@ -451,7 +451,7 @@ func (b *Builder) buildSubrepo(goRoot, goPath, pkg, hash string) (string, error) func repoForTool() (*vcs.RepoRoot, error) { switch *buildTool { case "go": - return vcs.RepoRootForImportPath(goImportPath, *verbose) + return vcs.RepoRootForImportPath(*gcPath, *verbose) case "gccgo": return vcs.RepoRootForImportPath(gofrontendImportPath, *verbose) default: @@ -538,7 +538,7 @@ func commitPoll(repo *Repo, pkg, key string) { return } - // Pass 1. Fill in parents and add new log entries to logsByHash. + // Pass 1. Fill in parents and add new log entries to logByHash. // Empty parent means take parent from next log entry. // Non-empty parent has form 1234:hashhashhash; we want full hash. for i := range logs { @@ -596,7 +596,7 @@ func addCommit(pkg, hash, key string) bool { // Create commit. if err := postCommit(key, pkg, l); err != nil { - log.Printf("failed to add %s to dashboard: %v", key, err) + log.Printf("failed to add %s to dashboard: %v", hash, err) return false } return true