From 39d30ef77ad0fc0629b627e72851ca3ca10693e8 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Fri, 27 Sep 2019 13:50:12 +0530 Subject: [PATCH] Add mergify rule to auto merge backported PR Signed-off-by: Madhu Rajanna (cherry picked from commit 136d81b736f59f787c5814a540b2e33474617c42) --- .mergify.yml | 24 ++++++++++++++++++++++++ docs/development-guide.md | 10 ++++++++++ 2 files changed, 34 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 262235c83..822f3b491 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -19,3 +19,27 @@ pull_request_rules: strict: smart dismiss_reviews: {} delete_head_branch: {} + - name: backport patches to release branch + conditions: + - base=master + - label=backport-to-release-v1.2.0 + actions: + backport: + branches: + - release-v1.2.0 + # automerge backports if CI successfully ran + - name: automerge backport release-v1.2.0 + conditions: + - author=mergify[bot] + - base=release-v1.2.0 + - label!=DNM + - "#changes-requested-reviews-by=0" + - "#approved-reviews-by>=1" + - "status-success=continuous-integration/travis-ci/pr" + actions: + merge: + method: rebase + rebase_fallback: merge + strict: smart + dismiss_reviews: {} + delete_head_branch: {} diff --git a/docs/development-guide.md b/docs/development-guide.md index 24bd14843..ab090451e 100644 --- a/docs/development-guide.md +++ b/docs/development-guide.md @@ -89,3 +89,13 @@ need to be met before it will be merged: When the criteria are met, a project maintainer can merge your changes into the project's master branch. + +The flow for getting a fix into a release branch is: + +1. Open a PR to merge the changes to master following the process outlined above. +1. Add the backport label to that PR such as `backport-to-release-vX.Y.Z` +1. After your PR is merged to master, the mergify bot will automatically open a + PR with your commits backported to the release branch +1. If there are any conflicts you will need to resolve them by pulling the + branch, resolving the conflicts and force push back the branch +1. After the CI is green, the bot will automatically merge the backport PR.