Skip to content

Commit

Permalink
implement mergify rules for release branches (haskell#10135)
Browse files Browse the repository at this point in the history
* implement mergify rules for release branches

We only handled the case of backports previously, but the current
release checklist expects that we can commit PRs to release
branches during a release (e.g. changelogs, because we want the
list of changelog.d files that are actually part of the release).

* block merging if PR has a 'blocked:' label

* update backports strategy for haskell#10260

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
geekosaur and mergify[bot] authored Aug 24, 2024
1 parent 8ffea4e commit dd123e6
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Note: We do not use the rebase strategy to merge PRs, because that
# loses information needed by changelog-d to associate commits with PRs.

pull_request_rules:

# implementing PR delay logic: apply a label after 2 days of inactivity
Expand Down Expand Up @@ -25,6 +28,7 @@ pull_request_rules:
- label=merge me
- label=merge delay passed
- '#approved-reviews-by>=2'
- '-label~=^blocked:'

# merge+squash strategy
- actions:
Expand All @@ -36,6 +40,7 @@ pull_request_rules:
- label=squash+merge me
- label=merge delay passed
- '#approved-reviews-by>=2'
- '-label~=^blocked:'

# merge+no rebase strategy
- actions:
Expand All @@ -47,18 +52,43 @@ pull_request_rules:
- label=merge+no rebase
- label=merge delay passed
- '#approved-reviews-by>=2'
- '-label~=^blocked:'

# merge strategy for release branches
- actions:
queue:
name: default
name: Put release branch pull requests in the rebase+merge queue
conditions:
- label=merge me
- base!=master
- -body~=backport
- '#approved-reviews-by>=2'
- '-label~=^blocked:'

# rebase+merge strategy for backports: require 1 approver instead of 2
# merge+squash strategy for release branches
- actions:
queue:
name: squash-merge
name: Put release branch pull requests in the squash+merge queue
conditions:
- base!=master
- label=squash+merge me
- -body~=backport
- '#approved-reviews-by>=2'
- '-label~=^blocked:'

# merge strategy for backports: require 1 approver instead of 2
- actions:
queue:
name: default
# Merge with a merge commit
name: Put backports in the rebase+merge queue
conditions:
- label=merge me
- base!=master
- body~=backport
- '#approved-reviews-by>=1'
- '-label~=^blocked:'

# merge+squash strategy for backports: require 1 approver instead of 2
- actions:
Expand All @@ -70,6 +100,7 @@ pull_request_rules:
- base!=master
- body~=backport
- '#approved-reviews-by>=1'
- '-label~=^blocked:'

# backports should be labeled as such
- actions:
Expand All @@ -86,6 +117,7 @@ queue_rules:
update_bot_account: Mikolaj
merge_method: merge
update_method: rebase

- name: squash-merge
update_bot_account: Mikolaj
merge_method: squash
Expand Down

0 comments on commit dd123e6

Please sign in to comment.