diff --git a/approval/approval.go b/approval/approval.go index b673dfb..c1b8d85 100644 --- a/approval/approval.go +++ b/approval/approval.go @@ -25,7 +25,7 @@ func Register(name string, f Func) error { func Lookup(name string) (Func, error) { log.Debug("approvalMap has",approvalMap) - log.Debug("looking for '%s'\n",name) + log.Debugf("looking for '%s'\n",name) f, ok := approvalMap[strings.ToLower(name)] if !ok { return nil, fmt.Errorf("Unknown Approval Algorithm %s", name) diff --git a/remote/github/github.go b/remote/github/github.go index d042b82..b317021 100644 --- a/remote/github/github.go +++ b/remote/github/github.go @@ -441,6 +441,17 @@ func (g *Github) GetPullRequestsForCommit(u *model.User, r *model.Repo, sha *str log.Debug("current pr ==", *pr) log.Debug("combined status ==",*status) + combinedState := *status.State + if combinedState == "success" { + log.Debug("overall status is success -- checking to see if all status checks returned success") + for _, v := range status.Statuses { + log.Debugf("status check %s returned %s",*v.Context, *v.State) + if *v.State != "success" { + log.Debugf("setting combined status check to %s",*v.State) + combinedState = *v.State + } + } + } out[k] = model.PullRequest{ Issue: model.Issue{ Number: *v.Number, @@ -449,7 +460,7 @@ func (g *Github) GetPullRequestsForCommit(u *model.User, r *model.Repo, sha *str }, Branch: model.Branch { Name: *pr.Head.Ref, - BranchStatus: *status.State, + BranchStatus: combinedState, Mergeable: mergeable, },