diff --git a/dashboard/app/app.yaml b/dashboard/app/app.yaml
index 8424cd0c..48ba8052 100644
--- a/dashboard/app/app.yaml
+++ b/dashboard/app/app.yaml
@@ -11,11 +11,11 @@ api_version: go1
handlers:
- url: /static
static_dir: static
-- url: /(|gccgo/)log/.+
+- url: /(|gccgo/|git/)log/.+
script: _go_app
-- url: /(|gccgo/)(|commit|packages|result|perf-result|tag|todo|perf|perfdetail|perfgraph|updatebenchmark)
+- url: /(|gccgo/|git/)(|commit|packages|result|perf-result|tag|todo|perf|perfdetail|perfgraph|updatebenchmark)
script: _go_app
-- url: /(|gccgo/)(init|buildtest|key|perflearn|_ah/queue/go/delay)
+- url: /(|gccgo/|git/)(init|buildtest|key|perflearn|_ah/queue/go/delay)
script: _go_app
login: admin
diff --git a/dashboard/app/build/dash.go b/dashboard/app/build/dash.go
index 52ca74da..9c092e78 100644
--- a/dashboard/app/build/dash.go
+++ b/dashboard/app/build/dash.go
@@ -13,18 +13,27 @@ import (
"appengine"
)
+func handleFunc(path string, h http.HandlerFunc) {
+ for _, d := range dashboards {
+ http.HandleFunc(d.Prefix+path, h)
+ }
+}
+
// Dashboard describes a unique build dashboard.
type Dashboard struct {
Name string // This dashboard's name and namespace
- RelPath string // The relative url path
+ Prefix string // The path prefix (no trailing /)
Packages []*Package // The project's packages to build
}
// dashboardForRequest returns the appropriate dashboard for a given URL path.
func dashboardForRequest(r *http.Request) *Dashboard {
- if strings.HasPrefix(r.URL.Path, gccgoDash.RelPath) {
+ if strings.HasPrefix(r.URL.Path, gccgoDash.Prefix) {
return gccgoDash
}
+ if strings.HasPrefix(r.URL.Path, gitDash.Prefix) {
+ return gitDash
+ }
return goDash
}
@@ -43,12 +52,12 @@ func (d *Dashboard) Context(c appengine.Context) appengine.Context {
}
// the currently known dashboards.
-var dashboards = []*Dashboard{goDash, gccgoDash}
+var dashboards = []*Dashboard{goDash, gitDash, gccgoDash}
// goDash is the dashboard for the main go repository.
var goDash = &Dashboard{
Name: "Go",
- RelPath: "/",
+ Prefix: "",
Packages: goPackages,
}
@@ -105,10 +114,71 @@ var goPackages = []*Package{
},
}
+// gitDash is the dashboard for the main go repository on git.
+var gitDash = &Dashboard{
+ Name: "Git",
+ Prefix: "/git",
+ Packages: gitPackages,
+}
+
+// gitPackages is a list of all of the packages built by the main go repository
+// on git.
+var gitPackages = []*Package{
+ {
+ Kind: "go",
+ Name: "Go",
+ },
+ {
+ Kind: "subrepo",
+ Name: "blog",
+ Path: "golang.org/x/blog",
+ },
+ {
+ Kind: "subrepo",
+ Name: "codereview",
+ Path: "golang.org/x/codereview",
+ },
+ {
+ Kind: "subrepo",
+ Name: "crypto",
+ Path: "golang.org/x/crypto",
+ },
+ {
+ Kind: "subrepo",
+ Name: "exp",
+ Path: "golang.org/x/exp",
+ },
+ {
+ Kind: "subrepo",
+ Name: "image",
+ Path: "golang.org/x/image",
+ },
+ {
+ Kind: "subrepo",
+ Name: "net",
+ Path: "golang.org/x/net",
+ },
+ {
+ Kind: "subrepo",
+ Name: "sys",
+ Path: "golang.org/x/sys",
+ },
+ {
+ Kind: "subrepo",
+ Name: "talks",
+ Path: "golang.org/x/talks",
+ },
+ {
+ Kind: "subrepo",
+ Name: "tools",
+ Path: "golang.org/x/tools",
+ },
+}
+
// gccgoDash is the dashboard for gccgo.
var gccgoDash = &Dashboard{
- Name: "Gccgo",
- RelPath: "/gccgo/",
+ Name: "Gccgo",
+ Prefix: "/gccgo",
Packages: []*Package{
{
Kind: "gccgo",
diff --git a/dashboard/app/build/handler.go b/dashboard/app/build/handler.go
index 5d06815c..ee75ba9b 100644
--- a/dashboard/app/build/handler.go
+++ b/dashboard/app/build/handler.go
@@ -841,22 +841,20 @@ func keyHandler(w http.ResponseWriter, r *http.Request) {
}
func init() {
- for _, d := range dashboards {
- // admin handlers
- http.HandleFunc(d.RelPath+"init", initHandler)
- http.HandleFunc(d.RelPath+"key", keyHandler)
+ // admin handlers
+ handleFunc("/init", initHandler)
+ handleFunc("/key", keyHandler)
- // authenticated handlers
- http.HandleFunc(d.RelPath+"commit", AuthHandler(commitHandler))
- http.HandleFunc(d.RelPath+"packages", AuthHandler(packagesHandler))
- http.HandleFunc(d.RelPath+"result", AuthHandler(resultHandler))
- http.HandleFunc(d.RelPath+"perf-result", AuthHandler(perfResultHandler))
- http.HandleFunc(d.RelPath+"tag", AuthHandler(tagHandler))
- http.HandleFunc(d.RelPath+"todo", AuthHandler(todoHandler))
+ // authenticated handlers
+ handleFunc("/commit", AuthHandler(commitHandler))
+ handleFunc("/packages", AuthHandler(packagesHandler))
+ handleFunc("/result", AuthHandler(resultHandler))
+ handleFunc("/perf-result", AuthHandler(perfResultHandler))
+ handleFunc("/tag", AuthHandler(tagHandler))
+ handleFunc("/todo", AuthHandler(todoHandler))
- // public handlers
- http.HandleFunc(d.RelPath+"log/", logHandler)
- }
+ // public handlers
+ handleFunc("/log/", logHandler)
}
func validHash(hash string) bool {
diff --git a/dashboard/app/build/init.go b/dashboard/app/build/init.go
index e7d63ed5..9654d183 100644
--- a/dashboard/app/build/init.go
+++ b/dashboard/app/build/init.go
@@ -33,6 +33,7 @@ func initHandler(w http.ResponseWriter, r *http.Request) {
logErr(w, r, err)
return
}
+ p.NextNum = 1 // So we can add the first commit.
if _, err := datastore.Put(c, p.Key(c), p); err != nil {
logErr(w, r, err)
return
diff --git a/dashboard/app/build/perf_changes.go b/dashboard/app/build/perf_changes.go
index 4abbf1a4..f52f2113 100644
--- a/dashboard/app/build/perf_changes.go
+++ b/dashboard/app/build/perf_changes.go
@@ -19,7 +19,7 @@ import (
)
func init() {
- http.HandleFunc("/perf", perfChangesHandler)
+ handleFunc("/perf", perfChangesHandler)
}
// perfSummaryHandler draws the main benchmarking page.
diff --git a/dashboard/app/build/perf_changes.html b/dashboard/app/build/perf_changes.html
index 24f0534d..16819e14 100644
--- a/dashboard/app/build/perf_changes.html
+++ b/dashboard/app/build/perf_changes.html
@@ -8,9 +8,9 @@
Go Dashboard
Go Dashboard