Use approved approvers post merge
What does this MR do and why?
Post merge, we save the list of approvals
as approved_approvers
.
In the any_approver wrapped rule, we still use the approvals
table, which can (for unknown reasons at the moment) be changed post merge, so it is not reliable information to use post merge.
We need to change the any_approver wrapped rule to use the correct information when the MR is merged.
To test:
- Create an MR with only any_approver rule and required approval = 1
- Approve
- Merge the MR
- Go into rails console
bundle exec rails c
MergeRequest.last.approvals.delete_all
- Go onto master branch
- Load
http://gdk.test:3000/api/v4/projects/PROJECT_ID/merge_requests/MR_IID/approval_state
- It will be empty
- Go to this branch
- Reload the api call, and it should show the rule
Edited by Marc Shaw