You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to be checking for the ApprovalsMissing or in the JSON equivalent the approvals_missing property which does not exist in the API endpoint that is being pulled from the client
Issue
I have submitted a Merge Request (MR) in Gitlab Enterprise. The Merge Request shows that it "Requires 1 more approval by X" before it can be merged.
Yet the creator of the MR was able to still run
atlantis apply
.Repro Steps
atlantis plan
atlantis apply
Expected Behaviour
atlantis apply
should be denied since the MR is not yet approved for merging.Logs
API JSON
JSON Sample of MR approval from
api/v4/projects/:id/merge_requests/:iid/approvals
Environment
atlantis 0.3.8
GitLab 10.5.4-ee
GitLab API v4
Possible Solution
It may seem that the the Gitlab Client Code might be looking at the wrong API property to determine if the MR is approved at
atlantis/server/events/vcs/gitlab_client.go
Line 75 in 566febe
It seems to be checking for the
ApprovalsMissing
or in the JSON equivalent theapprovals_missing
property which does not exist in the API endpoint that is being pulled from the clienthttps://github.com/lkysow/go-gitlab/blob/master/merge_requests.go#L261
It would seem that property
approvals_missing
was a mistake in the documentation that Gitlab has now fixed - https://gitlab.com/gitlab-org/gitlab-ee/issues/1118#note_17875041The suggestion is instead fo checking
ApprovalsMissing
to instead check forApprovalsLeft == 0
to determine if an MR is approved.The text was updated successfully, but these errors were encountered: