Implement create service for v2 approval rules
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Implement create service for v2 approval rules.
The service should:
- Check authorization and validation
- Create
MergeRequests::ApprovalRulewith:origin: :merge_request-
project_idfrom merge request's target project - Default
approvals_required: 0if not specified - Default
rule_type: :regularif not specified
- Associate rule with merge request via
MergeRequests::ApprovalRulesMergeRequestjoin 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 by Gavin Hinfey