From c1a9a36bd28595141ed7d16ea75b94d427091321 Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Wed, 12 Jan 2022 13:09:25 +0100 Subject: [PATCH] Chore: Add PR Check action enforcing backport decision (#43916) Ref https://github.com/grafana/grafana-github-actions/pull/53 Ref https://github.com/grafana/grafana-release/issues/60 --- .github/pr-checks.json | 9 +++++++++ .github/workflows/pr-checks.yml | 2 ++ contribute/merge-pull-request.md | 13 +++++++++++++ 3 files changed, 24 insertions(+) diff --git a/.github/pr-checks.json b/.github/pr-checks.json index 15cc829c0e1..de313e7b313 100644 --- a/.github/pr-checks.json +++ b/.github/pr-checks.json @@ -5,5 +5,14 @@ "targetUrl": "https://github.com/grafana/grafana/blob/main/contribute/merge-pull-request.md#assign-a-milestone", "success": "Milestone set", "failure": "Milestone not set" + }, + { + "type": "check-backport", + "title": "Backport Check", + "backportEnabled": "Backport enabled", + "backportSkipped": "Backport skipped", + "failure": "Backport decision needed", + "targetUrl": "https://github.com/grafana/grafana/blob/main/contribute/merge-pull-request.md#should-the-pull-request-be-backported", + "skipLabels": [ "backport", "no-backport"] } ] \ No newline at end of file diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 6d0a4079b86..69252f7167a 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -4,6 +4,8 @@ on: types: - opened - synchronize + - labeled + - unlabeled issues: types: - milestoned diff --git a/contribute/merge-pull-request.md b/contribute/merge-pull-request.md index 61abe3e2904..d41d319f2e2 100644 --- a/contribute/merge-pull-request.md +++ b/contribute/merge-pull-request.md @@ -85,8 +85,21 @@ In case the pull request introduces a breaking change you should document this. ### Should the pull request be backported? +An active decision of backporting needs to be taken for every pull request. There's a pull request check named **Backport Check** that will enforce this. By adding/removing labels on the pull request the check will be re-evaluated. + +#### No backport + +If you don't want to backport you need to add a label named **no-backport** to the pull request. + +#### Backport + If your pull request has changes that need to go into one or several existing release branches you need to backport the changes. Please refer to [Backport PR](.github/bot.md#backport-pr) for detailed instructions. +The general rule of thumb regarding what changes goes into what release is: + +- bug fixes should be released in patch releases, e.g. v8.1.3, if the bug was introduced in the same major/minor or lower patch version. +- new features should go into the next major/minor version, e.g. v8.0.0, v8.2.0. + Some examples when backport is required: - The change needs to be released in the next upcoming patch release, e.g. v8.1.3, so you have to backport it, e.g. into the v8.1.x release branch.