Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mergify delays merges indefinitely #8442

Closed
ulysses4ever opened this issue Aug 31, 2022 · 2 comments · Fixed by #8444
Closed

Mergify delays merges indefinitely #8442

ulysses4ever opened this issue Aug 31, 2022 · 2 comments · Fixed by #8444

Comments

@ulysses4ever
Copy link
Collaborator

In #8285 we attempted to implement an automatic mandatory delay for all merge requests against master (exceptional cases rquire manual merge). This is done by the Mergify bot. Unfortunately, this doesn't exactly works as expected, as it seems that when 2 day delay is passed Mergify may find that the branch needs a rebase before the merge, and that counts as an update that resets the delay timer.

The problem was reported upstream Mergifyio/mergify#5036. The advice there was implement a workaround based on additional label (proposed name: merge delay passed). In particular, after 2 day period we order Mergify to apply the new label instead of trying to merge (and fail as described above). Adding label is atomic, so it will reset the timer but we don't consult the timer for the merge, so the merge won't get delayed. Instead, the new label becomes additional condition for a merge (instead of the timer).

How does that sound?

In code:

--- orig.yml	2022-08-29 13:43:24.000000000 +0200
+++ target.yml	2022-08-29 13:43:12.000000000 +0200
@@ -1,4 +1,12 @@
 pull_request_rules:
+  - actions:
+      label:
+        add:
+          - merge delay passed
+    name: Wait for 2 days before validating merge
+    conditions:
+      - updated-at<2 days ago
+
   # rebase+merge strategy
   - actions:
       queue:
@@ -11,8 +19,9 @@
     conditions:
       - base=master
       - label=merge me
+      - label=merge delay passed
       - '#approved-reviews-by>=2'
-      - updated-at<2 days ago
+
   # merge+squash strategy
   - actions:
       queue:
@@ -25,8 +34,9 @@
     conditions:
       - base=master
       - label=squash+merge me
+      - label=merge delay passed
       - '#approved-reviews-by>=2'
-      - updated-at<2 days ago
+
   # rebase+merge strategy for backports: require 1 approver instead of 2
   - actions:
       queue:
@ulysses4ever
Copy link
Collaborator Author

Bonus: you can apply the merge delay passed label manually, and get Mergify to merge immediately but respecting its merge queue.

@Mikolaj
Copy link
Member

Mikolaj commented Aug 31, 2022

Let's try this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants