Skip to content

Commit

Permalink
[mergify] notify if no backport labels on the PRs targeting the maste…
Browse files Browse the repository at this point in the history
…r branch (elastic#28022)
  • Loading branch information
v1v authored Sep 22, 2021
1 parent b7283c7 commit 76fa851
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"upstream": "elastic/beats",
"branches": [ { "name": "7.x", "checked": true }, "7.15", "7.14", "7.13", "7.12" ],
"branches": [ { "name": "7.x", "checked": true }, "7.15", "7.14" ],
"labels": ["backport"],
"autoAssign": true,
"prTitle": "Cherry-pick to {targetBranch}: {commitMessages}"
Expand Down
94 changes: 42 additions & 52 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,6 @@ pull_request_rules:
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: backport patches to 7.x branch
conditions:
- merged
- label=backport-v7.16.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "7.x"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: backport patches to 7.13 branch
conditions:
- merged
- label=backport-v7.13.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "7.13"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: backport patches to 7.12 branch
conditions:
- merged
- label=backport-v7.12.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "7.12"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: ask to resolve conflict
conditions:
- conflict
Expand Down Expand Up @@ -106,19 +67,6 @@ pull_request_rules:
- files~=^\.go-version$
actions:
delete_head_branch:
- name: backport patches to 7.14 branch
conditions:
- merged
- label=backport-v7.14.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "7.14"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: automatic approval for mergify pull requests with changes in bump-rules
conditions:
- author=mergify[bot]
Expand Down Expand Up @@ -151,6 +99,48 @@ pull_request_rules:
- files~=^\.mergify\.yml$
actions:
delete_head_branch:
- name: notify the backport policy
conditions:
- -label~=^backport
- base=master
actions:
comment:
message: |
This pull request does not have a backport label. Could you fix it @{{author}}? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:
* `backport-v./d./d./d` is the label to automatically backport to the `7./d` branch. `/d` is the digit
**NOTE**: `backport-skip` has been added to this pull request.
label:
add:
- backport-skip
- name: backport patches to 7.x branch
conditions:
- merged
- label=backport-v7.16.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "7.x"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: backport patches to 7.14 branch
conditions:
- merged
- label=backport-v7.14.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "7.14"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: backport patches to 7.15 branch
conditions:
- merged
Expand Down

0 comments on commit 76fa851

Please sign in to comment.