Skip to content

Optional configuration for marge to only process MRs that have all approvals

Enhancement request:

We've been using marge-bot for about 2 weeks and a couple of engineers have queried about some functionality. I had a look through existing issues and the code and can't see it implemented, but wonder if it could be an enhancement implemented as an optional configuration.

The details...

A couple of engineers came across this error when using marge-bot I couldn't merge this branch: Insufficient approvals (have: [] missing: 1), which is a valid error, I'm glad marge-bot doesn't merge without approvals 😀

However, we have a pretty common usecase in which we previously would use GitLab's Set to auto-merge to handle this (but of course, this doesn't handle the rebase like marge does!).

Here's the flow we'd love marge to handle:

  1. Engineer has an MR and assigns to to another engineer/s for review
  2. Engineer assigns marge-bot to the MR, knowing the MR is not approved yet, but the engineer would love the MR to be merged as soon as it IS approved!

I wondered if this logic might sit in merge_request.py fetch_all_mine.. Maybe there could be an alternate path where marge only fetches MRs that are both assigned to her AND all approval/s are obtained. This way marge only picks up and loops over MRs that have all the approvals then rebases/merges as needed. (I wouldn't worry about other cases just yet e.g. unresolved comments, just keeping it simple for only processing MRs that have all the approvals).

Cheers Tegan

Edited by Tegan Krebbekx