Skip to content

Merge request approvals before merge should be nil if unavailable

What does this MR do?

Fix merge requests so that their approvals_before_merge is nil instead of 0 when the merge_request_approvers feature is unlicensed. This bug was introduced in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2324

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Project approvals_before_merge has an empty value of 0, but the same is not true of merge requests, which use nil instead. Merge request validations fail with some licenses if MR approvals_before_merge returns 0 instead of nil.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/35082

Edited by Nick Thomas

Merge request reports