summaryrefslogtreecommitdiff
path: root/misc/dashboard/app/build/notify.go
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-03-04 21:27:36 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-03-04 21:27:36 +0100
commit04b08da9af0c450d645ab7389d1467308cfc2db8 (patch)
treedb247935fa4f2f94408edc3acd5d0d4f997aa0d8 /misc/dashboard/app/build/notify.go
parent917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff)
downloadgolang-upstream/1.1_hg20130304.tar.gz
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
Diffstat (limited to 'misc/dashboard/app/build/notify.go')
-rw-r--r--misc/dashboard/app/build/notify.go29
1 files changed, 22 insertions, 7 deletions
diff --git a/misc/dashboard/app/build/notify.go b/misc/dashboard/app/build/notify.go
index e02344ca8..52b91f6c1 100644
--- a/misc/dashboard/app/build/notify.go
+++ b/misc/dashboard/app/build/notify.go
@@ -21,6 +21,13 @@ const (
domain = "build.golang.org"
)
+// failIgnore is a set of builders that we don't email about because
+// they're too flaky.
+var failIgnore = map[string]bool{
+ "netbsd-386-bsiegert": true,
+ "netbsd-amd64-bsiegert": true,
+}
+
// notifyOnFailure checks whether the supplied Commit or the subsequent
// Commit (if present) breaks the build for this builder.
// If either of those commits break the build an email notification is sent
@@ -30,6 +37,10 @@ const (
// This must be run in a datastore transaction, and the provided *Commit must
// have been retrieved from the datastore within that transaction.
func notifyOnFailure(c appengine.Context, com *Commit, builder string) error {
+ if failIgnore[builder] {
+ return nil
+ }
+
// TODO(adg): implement notifications for packages
if com.PackagePath != "" {
return nil
@@ -37,15 +48,15 @@ func notifyOnFailure(c appengine.Context, com *Commit, builder string) error {
p := &Package{Path: com.PackagePath}
var broken *Commit
- ok, present := com.OK(builder, "")
- if !present {
+ cr := com.Result(builder, "")
+ if cr == nil {
return fmt.Errorf("no result for %s/%s", com.Hash, builder)
}
q := datastore.NewQuery("Commit").Ancestor(p.Key(c))
- if ok {
+ if cr.OK {
// This commit is OK. Notify if next Commit is broken.
next := new(Commit)
- q.Filter("ParentHash=", com.Hash)
+ q = q.Filter("ParentHash=", com.Hash)
if err := firstMatch(c, q, next); err != nil {
if err == datastore.ErrNoSuchEntity {
// OK at tip, no notification necessary.
@@ -53,13 +64,15 @@ func notifyOnFailure(c appengine.Context, com *Commit, builder string) error {
}
return err
}
- if ok, present := next.OK(builder, ""); present && !ok {
+ if nr := next.Result(builder, ""); nr != nil && !nr.OK {
+ c.Debugf("commit ok: %#v\nresult: %#v", com, cr)
+ c.Debugf("next commit broken: %#v\nnext result:%#v", next, nr)
broken = next
}
} else {
// This commit is broken. Notify if the previous Commit is OK.
prev := new(Commit)
- q.Filter("Hash=", com.ParentHash)
+ q = q.Filter("Hash=", com.ParentHash)
if err := firstMatch(c, q, prev); err != nil {
if err == datastore.ErrNoSuchEntity {
// No previous result, let the backfill of
@@ -68,7 +81,9 @@ func notifyOnFailure(c appengine.Context, com *Commit, builder string) error {
}
return err
}
- if ok, present := prev.OK(builder, ""); present && ok {
+ if pr := prev.Result(builder, ""); pr != nil && pr.OK {
+ c.Debugf("commit broken: %#v\nresult: %#v", com, cr)
+ c.Debugf("previous commit ok: %#v\nprevious result:%#v", prev, pr)
broken = com
}
}