1
0
mirror of https://github.com/golang/go synced 2024-11-22 11:54:50 -07:00

misc/dashboard/app: fix build failure notifications

The datastore.Query methods once mutated the Query value, but now they return
a derivative query, so the Hash= and ParentHash= filters were not being
applied.

R=golang-dev, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/6300058
This commit is contained in:
Andrew Gerrand 2012-06-07 09:27:39 +10:00
parent 42a76efc92
commit 5528211158

View File

@ -45,7 +45,7 @@ func notifyOnFailure(c appengine.Context, com *Commit, builder string) error {
if cr.OK { if cr.OK {
// This commit is OK. Notify if next Commit is broken. // This commit is OK. Notify if next Commit is broken.
next := new(Commit) next := new(Commit)
q.Filter("ParentHash=", com.Hash) q = q.Filter("ParentHash=", com.Hash)
if err := firstMatch(c, q, next); err != nil { if err := firstMatch(c, q, next); err != nil {
if err == datastore.ErrNoSuchEntity { if err == datastore.ErrNoSuchEntity {
// OK at tip, no notification necessary. // OK at tip, no notification necessary.
@ -61,7 +61,7 @@ func notifyOnFailure(c appengine.Context, com *Commit, builder string) error {
} else { } else {
// This commit is broken. Notify if the previous Commit is OK. // This commit is broken. Notify if the previous Commit is OK.
prev := new(Commit) prev := new(Commit)
q.Filter("Hash=", com.ParentHash) q = q.Filter("Hash=", com.ParentHash)
if err := firstMatch(c, q, prev); err != nil { if err := firstMatch(c, q, prev); err != nil {
if err == datastore.ErrNoSuchEntity { if err == datastore.ErrNoSuchEntity {
// No previous result, let the backfill of // No previous result, let the backfill of