Skip to content

Commit

Permalink
check all statuses to see if we are really in success mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Bodner committed May 13, 2016
1 parent d5043a7 commit 357af8c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion remote/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,

},
Expand Down

0 comments on commit 357af8c

Please sign in to comment.