Skip to content

Commit

Permalink
ci: removed deprecated fields in mergify (#9825)
Browse files Browse the repository at this point in the history
closes: #9836

## Description

This PR removes the following deprecated fields in the queue action in mergify:
- `merge_method`
- `update_method`

Mergify recommends using these fields in the `queue_rules` section instead. each queue can only have a single update/merge method, so In order to have different update/merge methods for different pull_requests we must create multiple queues 

This creates two issues in priority:
- Each queue has its own priority level i.e. queues defined first are executed first. This creates a difference in priority that we do no intend. 
- since we have to create multiple queues our previous method of creating a high priority queue will not work, instead we'll have to duplicate the queues again, creating one queue for high_priority and one for normal priority. 

As of now there exists no way around these problems. After some discussion with the Mergify team this is what they recommend: 
>  We’re WIP in removing the priorities between queues, but in the meantime you can mitigate this with `allow_checks_interruption`  set to false and `disallow_checks_interruption_from_queues` 

### Testing of PR:
I tested this PR to verify that all queues work as expected. these 3 PRs were created for this purpose:
frazarshad/mergify-experiements#20
frazarshad/mergify-experiements#21
frazarshad/mergify-experiements#22
![image](https://github.com/user-attachments/assets/145c2e6b-a97b-4c0a-bcfb-912eb9916482)

The new priority_rules were also checked and work as expected:
![Screenshot 2024-08-05 at 4 33 22 PM](https://github.com/user-attachments/assets/f49bcdce-5fcf-44cd-b117-074952fdc38a)


### Security Considerations


### Scaling Considerations


### Documentation Considerations


### Testing Considerations


### Upgrade Considerations
  • Loading branch information
mergify[bot] authored Aug 11, 2024
2 parents 644c210 + 4b6924f commit f98da63
Showing 1 changed file with 94 additions and 51 deletions.
145 changes: 94 additions & 51 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,10 @@
# Linear queue for the main branch.
queue_rules:
- name: high_priority_main
commit_message_template: |-
{{ title }} (#{{ number }})
{{ body | trim }}
queue_conditions:
- base=master
- label=priority:high
- or:
- check-pending=integration-test-result
- check-success=integration-test-result
- label=bypass:integration
- or:
- and: # breakage succeeds like we thought
- check-success=breakage
- -label=proto:expect-breakage
- and: # breakage fails like we thought
- check-failure=breakage
- label=proto:expect-breakage
merge_conditions:
- base=master
# Rebase PRs with fixup commits are allowed to enter the merge queue but
# should not be allowed to merge if there are leftover fixup commits after rebase
- or:
- label=bypass:linear-history
- check-success=no-fixup-commits
- check-skipped=no-fixup-commits
# Require integration tests before merging only
- or:
- label=bypass:integration
- check-success=integration-test-result
- name: main
commit_message_template: |-
shared:
commit_message_template: &commit-message-template |-
{{ title }} (#{{ number }})

{{ body | trim }}
queue_conditions:
queue_conditions: &queue-conditions
- base=master
- or:
- check-pending=integration-test-result
Expand All @@ -49,7 +17,10 @@ queue_rules:
- and: # breakage fails like we thought
- check-failure=breakage
- label=proto:expect-breakage
merge_conditions:
high_priority_queue_conditions: &high-priority-queue-conditions
- and: *queue-conditions
- label=priority:high
merge_conditions: &merge-conditions
- base=master
# Rebase PRs with fixup commits are allowed to enter the merge queue but
# should not be allowed to merge if there are leftover fixup commits after rebase
Expand All @@ -61,36 +32,108 @@ queue_rules:
- or:
- label=bypass:integration
- check-success=integration-test-result

pull_request_rules:
- name: merge to master
conditions:
pr_queue_merge_conditions: &pr-queue-merge-conditions
- base=master
- label=automerge:no-update
- or:
- '#commits-behind=0'
- label=bypass:linear-history
actions:
queue:
merge_method: merge
- name: rebase updates then merge to master
conditions:
pr_queue_rebase_conditions: &pr-queue-rebase-conditions
- base=master
- label=automerge:rebase
- or:
- '#commits-behind>0'
- linear-history
pr_queue_squash_conditions: &pr-queue-squash-conditions
- base=master
- label=automerge:squash

queue_rules:
- name: high_priority_rebase
commit_message_template: *commit-message-template
queue_conditions: *high-priority-queue-conditions
merge_conditions: *merge-conditions
merge_method: merge
update_method: rebase

- name: high_priority_merge
commit_message_template: *commit-message-template
queue_conditions: *high-priority-queue-conditions
merge_conditions: *merge-conditions
disallow_checks_interruption_from_queues:
- high_priority_rebase
merge_method: merge

- name: high_priority_squash
commit_message_template: *commit-message-template
queue_conditions: *high-priority-queue-conditions
merge_conditions: *merge-conditions
disallow_checks_interruption_from_queues:
- high_priority_rebase
- high_priority_merge
merge_method: squash

- name: rebase
commit_message_template: *commit-message-template
queue_conditions: *queue-conditions
merge_conditions: *merge-conditions
merge_method: merge
update_method: rebase

- name: merge
commit_message_template: *commit-message-template
queue_conditions: *queue-conditions
merge_conditions: *merge-conditions
disallow_checks_interruption_from_queues:
- rebase
merge_method: merge

- name: squash
commit_message_template: *commit-message-template
queue_conditions: *queue-conditions
merge_conditions: *merge-conditions
disallow_checks_interruption_from_queues:
- rebase
- merge
merge_method: squash

pull_request_rules:
- name: high priority - merge to master
conditions:
- and: *pr-queue-merge-conditions
- label=priority:high
actions:
queue:
merge_method: merge
update_method: rebase
- name: squash to master
name: high_priority_merge
- name: high priority - rebase updates then merge to master
conditions:
- base=master
- label=automerge:squash
- and: *pr-queue-rebase-conditions
- label=priority:high
actions:
queue:
name: high_priority_rebase
- name: high priority - squash to master
conditions:
- and: *pr-queue-squash-conditions
- label=priority:high
actions:
queue:
name: high_priority_squash
- name: merge to master
conditions: *pr-queue-merge-conditions
actions:
queue:
name: merge
- name: rebase updates then merge to master
conditions: *pr-queue-rebase-conditions
actions:
queue:
name: rebase
- name: squash to master
conditions: *pr-queue-squash-conditions
actions:
queue:
merge_method: squash
name: squash
- name: rebase and autosquash
conditions:
- base=master
Expand Down

0 comments on commit f98da63

Please sign in to comment.