Fix bug with GitLab approvals not being required

Updated to a patched version of go-gitlab with the correct fields set.
This commit is contained in:
Luke Kysow
2018-04-26 10:54:27 -06:00
parent c8fa9fc2d0
commit 64ebc8dd2f
3 changed files with 3 additions and 3 deletions

2
Gopkg.lock generated
View File

@@ -99,7 +99,7 @@
branch = "master"
name = "github.com/lkysow/go-gitlab"
packages = ["."]
revision = "5aba7769280ffa5408f98e1b95290989cc1428c5"
revision = "fcd13266e57eb071cbedfe8efc7969a7bc4c8f22"
[[projects]]
name = "github.com/magiconair/properties"

View File

@@ -72,7 +72,7 @@ func (g *GitlabClient) PullIsApproved(repo models.Repo, pull models.PullRequest)
if err != nil {
return false, err
}
if approvals.ApprovalsMissing > 0 {
if approvals.ApprovalsLeft > 0 {
return false, nil
}
return true, nil

View File

@@ -114,7 +114,7 @@ type MergeRequestApprovals struct {
UpdatedAt *time.Time `json:"updated_at"`
MergeStatus string `json:"merge_status"`
ApprovalsRequired int `json:"approvals_required"`
ApprovalsMissing int `json:"approvals_missing"`
ApprovalsLeft int `json:"approvals_left"`
ApprovedBy []struct {
User struct {
Name string `json:"name"`