Remove `approval_settings` request on merge request create page
Problem
Frontend provides a list of project approval rules that needs to be created. However, it's inefficient because backend already knows what approval rules need to be copied to the new merge request.
Current flow:
- User goes to merge request create page
- Frontend makes a query to load approval rules from the project:
api/v4/projects/:id/approval_settings?target_branch=master
- Frontend selects only
regular
orany_approver
rules - Frontend generates a list of approval rules that need to be created (
approval_rules_attributes
) - Frontend sends a POST request to
MergeRequestContoller
and provides the list of approval rules.
Proposal
The fix from !118235 (merged) by default creates necessary approval rules from the project when approval_rules_attributes
is missing.
We can improve the creation flow. Frontend does not have to make a request to approval_settings
endpoint and generate the list of approval rules anymore.
- Remove the request to
approval_settings
endpoint on merge request creation page - Don't provide
approval_rules_attributes
in merge request creation request
Edited by Vasilii Iakliushin