From 78267692fc7ecf8b5d6d73a69476e2b12a7e1785 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Fri, 15 May 2020 13:55:09 +0530 Subject: [PATCH] CI: Add Rule to auto merge PR If the PR is having trivial changes or the reviewer is confident enough that PR doesn't need a second review, the reviewer can set `ready-to-merge` label on the PR. The bot will merge the PR if it's having one approval and the label `ready-to-merge` Signed-off-by: Madhu Rajanna --- .mergify.yml | 17 +++++++++++++++++ docs/development-guide.md | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 770781f4b..15fd5333b 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -23,6 +23,23 @@ pull_request_rules: strict: smart dismiss_reviews: {} delete_head_branch: {} + - name: automatic merge PR having ready-to-merge label + conditions: + - label!=DNM + - label=ready-to-merge + - base=master + - "#approved-reviews-by>=1" + - "#changes-requested-reviews-by=0" + - "status-success=continuous-integration/travis-ci/pr" + - "status-success=DCO" + - "status-success=commitlint" + actions: + merge: + method: rebase + rebase_fallback: merge + strict: smart + dismiss_reviews: {} + delete_head_branch: {} - name: backport patches to release v1.2.0 branch conditions: - base=master diff --git a/docs/development-guide.md b/docs/development-guide.md index a9fc92ada..309b095cb 100644 --- a/docs/development-guide.md +++ b/docs/development-guide.md @@ -200,6 +200,10 @@ need to be met before it will be merged: * The 24 working hours counts hours occuring Mon-Fri in the local timezone * of the submitter * Each PR must be fully updated to master and tests must have passed +* If the PR is having trivial changes or the reviewer is confident enough that + PR doesn't need a second review, the reviewer can set `ready-to-merge` label + on the PR. The bot will merge the PR if it's having one approval and the + label `ready-to-merge` When the criteria are met, a project maintainer can merge your changes into the project's master branch.