Skip to content

Store the correct approvals required for code owner rules post merge

What does this MR do and why?

When we are finalizing the code owner rules, we need to store if they were required or not in the rule itself, then when we access the wrapped rules, we need to use the approvals required attribute when its merged.

To Test:

  • bundle exec rails c, and enable Feature.enable(:use_new_rule_finalize_approach)
  • Create a codeowners file, example, `*md @colette`
  • Settings -> Repository -> Protected branches
  • Turn on Code Owner Approval Required
  • Create an MR with a file matching the codeowner rule, targetting the protected branch
  • Approve, and merge the MR
  • Turn off Code Owner Approval Required for the branch
  • Reload the MR, and ensure that the code owner rule is still required (1 of1 approvals)
  • Turn off feature flag
  • Reload the MR, and check that it shows that it is incorrectly optional

Related to #433098 (closed)

Edited by Marc Shaw

Merge request reports