Skip to content

Set approval rule as invalid if there are not enough approvers

What does this MR do and why?

This MR builds on top of !116969 (merged)

It fixes approval rules that were not marked as invalid, even though the required approvals count was higher than the number of eligible approvers. Before, the rule became invalid only when there were no approvers. Now, it checks the number of approvers against the required approvals.

Screenshots or screen recordings

Before: CleanShot_2023-04-13_at_17.03.59_2x

After: CleanShot_2023-04-13_at_17.05.11_2x

How to set up and validate locally

  1. Add a new file, create MR
  2. In the approval rules for the MR, create a new rule, select 1 approver and require 2 approvals
  3. The rule should be marked as invalid and automatically approved

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #389905 (closed)

Merge request reports