Skip to content

Auto merge doesn't work when approval becomes optional

Summary

Auto merge doesn't work when one of the required approval becomes optional due to a policy. It waits for the previously required but now optional approval.

Steps to reproduce

  1. Every merge needs to be approved by A.
  2. Make a MR policy that if a vulnerability is found additional approval from B is required.
  3. Make a MR that has no vulnerability.
  4. Click on auto merge before tests are done.
  5. The policy made in step 2 makes the one of the required approval from B optional.
  6. A gives approval

What is the current bug behavior?

Auto merge doesn't merge the MR when the pipeline is done and required approvals are given.

What is the expected correct behavior?

MR automatically merges after the pipeline ends and required approvals are given.

Edited by Lundaajamts Gansukh