From 1db77045f39851b3fb16790c3617df91e6132df4 Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Fri, 21 Jun 2024 19:15:54 -0400 Subject: [PATCH] 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). --- .github/mergify.yml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index a7bc364c473..8b0a60ef8c6 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -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 @@ -48,7 +51,37 @@ pull_request_rules: - label=merge delay passed - '#approved-reviews-by>=2' - # rebase+merge strategy for backports: require 1 approver instead of 2 + # merge strategy for release branches + - actions: + queue: + name: default + # Merge with a merge commit + method: merge + # Update the pr branch with rebase, so the history is clean + update_method: rebase + name: Put release branch pull requests in the rebase+merge queue + conditions: + - label=merge me + - base!=master + - -body~=backport + - '#approved-reviews-by>=2' + + # merge+squash strategy for release branches + - actions: + queue: + name: default + method: squash + # both update methods get absorbed by the squash, so we use the most + # reliable + update_method: 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' + + # merge strategy for backports: require 1 approver instead of 2 - actions: queue: name: default