[go: up one dir, main page]

Skip to content

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:

  1. User goes to merge request create page
  2. Frontend makes a query to load approval rules from the project: api/v4/projects/:id/approval_settings?target_branch=master
  3. Frontend selects only regular or any_approver rules
  4. Frontend generates a list of approval rules that need to be created (approval_rules_attributes)
  5. 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