Integrate group level to project level MR approval rules

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Why are we doing this work

Users would like to integrate group-level MR approval settings into children projects.

Relevant links

  • See #293957 for high-level design.
  • Configure project approval rule via UI

Functional requirements

  • Allow retrieving group-level approval rules via project-level approval rules API
    • Public endpoint GET /api/:version/project/:id/approval_rules
    • Public endpoint GET /api/:version/project/:id/approval_rules/:approval_rule_id
    • Internal endpoint GET /api/:version/project/:id/approval_settings
  • Group-level approval rules should display on Project > Settings > Merge request approvals
  • User can edit/delete group-level approval rules

Non-functional requirements

  • [-] Documentation: Not needed as it is behind a feature flag
  • Feature flag: group_merge_request_approval_settings_feature_flag
  • [-] Performance:
  • Testing: Ensure that the project approval rules works with feature flag/licensed disabled

Implementation plan

  • backend Extend ApprovalState to support group (ie. user_defined_rules should account for group approval rules)
graph LR
  API::ProjectApprovalRules --> Project --> ApprovalState
  ApprovalState --> ApprovalProjectRule
  ApprovalState --> ApprovalGroupRule
Edited by 🤖 GitLab Bot 🤖