Implement create service for v2 approval rules

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

  • Close this issue

Implement create service for v2 approval rules.

The service should:

  • Check authorization and validation
  • Create MergeRequests::ApprovalRule with:
    • origin: :merge_request
    • project_id from merge request's target project
    • Default approvals_required: 0 if not specified
    • Default rule_type: :regular if not specified
  • Associate rule with merge request via MergeRequests::ApprovalRulesMergeRequest join table
  • Assign user approvers (if user_ids provided)
  • Assign group approvers (if group_ids provided)
  • Return ServiceResponse with success/error

Reference: POC implementation in poc/v2-approval-rules-complete branch.

Edited Feb 12, 2026 by Gavin Hinfey
Assignee Loading
Time tracking Loading