Skip to content

Check mergability of all MRs in queue at each run

Arvid Jakobsson requested to merge arvid@preensure-mr-mergeability into master

Before merging any MR, marge-bot checks whether the MR fulfills the basic criteria for mergability (no open discussions, not wip, etc ...). However, it only does so for the first MR in the queue of MRs. That means that if you assign a non-mergable MR to marge-bot, you'll have to wait until they process all previous items before you'll be notified that your MR cannot be merged for some trivial reason (like you accidentally left it in the draft state).

This MR changes the behavior of marge slightly so that on each run, it checks the full queue of MRs whether they fill the basic criteria for mergability (no open discussions, not wip, etc ...). If not, it behaves if the MR was the first in the queue: she reassigns the MR back to the author and leaves an explanatory comment.

Testing

I found it prohibivitely difficult to add a new unit test for this behavior. There are no tests covering bot.py and how marge processes the queue. However, I've performed some integration tests by running marge against a test repo and assigning it to queues of MRs, where some of them are draft, and assured that marge behaves as expected (re-assigns, comments).

Edited by Arvid Jakobsson

Merge request reports