diff --git a/dashboard/app/build/handler.go b/dashboard/app/build/handler.go index 94504766..7834afa4 100644 --- a/dashboard/app/build/handler.go +++ b/dashboard/app/build/handler.go @@ -46,7 +46,13 @@ func commitHandler(r *http.Request) (interface{}, error) { if r.Method == "GET" { com.PackagePath = r.FormValue("packagePath") com.Hash = r.FormValue("hash") - if err := datastore.Get(c, com.Key(c), com); err != nil { + err := datastore.Get(c, com.Key(c), com) + if com.Num == 0 && com.Desc == "" { + // Perf builder might have written an incomplete Commit. + // Pretend it doesn't exist, so that we can get complete details. + err = datastore.ErrNoSuchEntity + } + if err != nil { if err == datastore.ErrNoSuchEntity { // This error string is special. // The commit watcher expects it. diff --git a/dashboard/app/build/notify.go b/dashboard/app/build/notify.go index bb12b21b..bbd710e7 100644 --- a/dashboard/app/build/notify.go +++ b/dashboard/app/build/notify.go @@ -15,6 +15,7 @@ import ( "net/http" "net/url" "regexp" + "runtime" "sort" "text/template" @@ -216,6 +217,13 @@ func sendPerfFailMail(c appengine.Context, builder string, res *PerfResult) erro } func commonNotify(c appengine.Context, com *Commit, builder, logHash string) error { + if com.Num == 0 || com.Desc == "" { + stk := make([]byte, 10000) + n := runtime.Stack(stk, false) + stk = stk[:n] + c.Errorf("refusing to notify with com=%+v\n%s", *com, string(stk)) + return fmt.Errorf("misuse of commonNotify") + } if com.FailNotificationSent { return nil }