}
}
-// OK returns the Commit's build state for a specific builder and goHash.
-func (c *Commit) OK(builder, goHash string) (ok, present bool) {
- r := c.Result(builder, goHash)
- if r == nil {
- return false, false
- }
- return r.OK, true
-}
-
// A Result describes a build result for a Commit on an OS/architecture.
//
// Each Result entity is a descendant of its associated Commit entity.
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)
}
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 {
}
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
}
}