Remove approvals_before_merge support

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

  • Close this issue

Problem

In the past we extracted approval rules from the field approvals_before_merge in merge_requests table into a separate approval_rules table.

For backward compatibility, we added DeprecatedApprovalsBeforeMerge module that updates ApprovalRules for each update of approvals_before_merge field.

It's time to remove this abstraction and delete the field from the merge_requests table.

Proposal

We still have some endpoints that directly update approvals_before_merge field. But we can adapt them to skip this step and update ApprovalRules instead. See an example.

There are a few usages left:

  • In ProjectsHelpers
  • In API::ProjectApprovals
  • In API::MergeRequests
  • In MergeRequests::ApplicationController

Each of this steps can be a separate issue, because they are independent from one another.

After replacing old approvals_before_merge code with ApprovalRules services calls, we can remove DeprecatedApprovalsBeforeMerge module and delete the approvals_before_merge field from the database.

Edited Sep 22, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading