Skip to content

Commit e130b53

Browse files
authored
Add mergify config for automated backports (#308)
1 parent e60173b commit e130b53

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

.mergify.yml

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
pull_request_rules:
2+
- name: ask to resolve conflict
3+
conditions:
4+
- -merged
5+
- -closed
6+
- conflict
7+
actions:
8+
comment:
9+
message: |
10+
This pull request is now in conflict. Could you fix it @{{author}}? 🙏
11+
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/
12+
```
13+
git fetch <remote-repo>
14+
git checkout -b {{head}} <remote-repo>/{{head}}
15+
git merge <remote-repo>/{{base}}
16+
git push <remote-repo> {{head}}
17+
```
18+
- name: backport patches to 8.9 branch
19+
conditions:
20+
- merged
21+
- base=main
22+
- label=backport-8.9
23+
actions:
24+
backport:
25+
assignees:
26+
- "{{ author }}"
27+
branches:
28+
- "8.9"
29+
title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})"
30+
labels:
31+
- backport
32+
- name: backport patches to 8.8 branch
33+
conditions:
34+
- merged
35+
- base=main
36+
- label=backport-8.8
37+
actions:
38+
backport:
39+
assignees:
40+
- "{{ author }}"
41+
branches:
42+
- "8.8"
43+
title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})"
44+
labels:
45+
- backport
46+
- name: backport patches to 8.7 branch
47+
conditions:
48+
- merged
49+
- base=main
50+
- label=backport-8.7
51+
actions:
52+
backport:
53+
assignees:
54+
- "{{ author }}"
55+
branches:
56+
- "8.7"
57+
title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})"
58+
labels:
59+
- backport
60+
- name: backport patches to 7.17 branch
61+
conditions:
62+
- merged
63+
- base=main
64+
- label=backport-7.17
65+
actions:
66+
backport:
67+
assignees:
68+
- "{{ author }}"
69+
branches:
70+
- "7.17"
71+
title: "[{{ destination_branch }}] {{ title }} (backport #{{ number }})"
72+
labels:
73+
- backport
74+
- name: notify the backport policy
75+
conditions:
76+
- -label~=^backport
77+
- base=main
78+
actions:
79+
comment:
80+
message: |
81+
This pull request does not have a backport label. Could you fix it @{{author}}? 🙏
82+
To fixup this pull request, you need to add the backport labels for the needed
83+
branches, such as:
84+
* `backport-/d./d` is the label to automatically backport to the `/d./d` branch. `/d` is the digit
85+
**NOTE**: `backport-skip` has been added to this pull request.
86+
label:
87+
add:
88+
- backport-skip
89+
- name: remove backport-skip label
90+
conditions:
91+
- label~=^backport-\d
92+
- -merged
93+
- -closed
94+
actions:
95+
label:
96+
remove:
97+
- backport-skip
98+
- name: notify the backport has not been merged yet
99+
conditions:
100+
- -merged
101+
- -closed
102+
- author=mergify[bot]
103+
- "#check-success>0"
104+
- schedule=Mon-Mon 06:00-10:00[Europe/Paris]
105+
- "#assignee>=1"
106+
actions:
107+
comment:
108+
message: |
109+
This pull request has not been merged yet. Could you please review and merge it @{{ assignee | join(', @') }}? 🙏

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# ingest-docs
22
Home for Elastic ingest documentation
3+
4+
## Backporting
5+
6+
Pull requests should be tagged with the target version of the Elastic Stack along with any relevant backport labels. In general, we only backport documentation changes to [live stack versions](https://github.com/elastic/docs/blob/master/conf.yaml#L80). For manual backports, we recommend using the [backport tool](https://github.com/sqren/backport) to easily open backport PRs. If you need help, ping **[ingest-docs](https://github.com/orgs/elastic/teams/ingest-docs)** and we'd be happy to handle the backport process for you.

0 commit comments

Comments
 (0)