Skip to content

Commit 654e697

Browse files
committed
PR workflow: add mergify
This config should always follow our worklof and other way around. They should both be in sync. What can mergify do? Almost everything we need. First step would be to not merge anything, just use labels and help us to keep PRs up to date with labels. If this works, we can get CI to check specific labels to trigger CI (or use commands) and other things, this needs more work.
1 parent dc63202 commit 654e697

File tree

1 file changed

+140
-0
lines changed

1 file changed

+140
-0
lines changed

.mergify.yml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
#
2+
# Copyright (c) 2029, Arm Limited and affiliates.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Mergify follow our workflow: https://os.mbed.com/docs/mbed-os/latest/contributing/workflow.html
18+
19+
pull_request_rules:
20+
- name: "label needs: work when changes were requested"
21+
conditions:
22+
# Labels
23+
- "label!=needs: work"
24+
- "label!=needs: preceding PR"
25+
26+
# Reviewers
27+
- "#changes-requested-reviews-by>0"
28+
actions:
29+
label:
30+
add:
31+
- "needs: work"
32+
remove:
33+
- "needs: review"
34+
35+
- name: "label needs: work when travis-ci failed"
36+
conditions:
37+
# Labels
38+
- "label!=needs: work"
39+
- "label!=needs: preceding PR"
40+
41+
# Travis failing
42+
- status-failure~=continuous-integration/travis-ci/pr
43+
actions:
44+
label:
45+
add:
46+
- "needs: work"
47+
remove:
48+
- "needs: review"
49+
50+
- name: "label needs: work when Jenkins CI failed"
51+
conditions:
52+
# Jenkins CI failing
53+
- status-failure~=continuous-integration/jenkins/pr-head
54+
actions:
55+
label:
56+
add:
57+
- "needs: work"
58+
59+
- name: "label needs: CI when at least one reviewers approval"
60+
conditions:
61+
# Labels
62+
- "label!=needs: work"
63+
- "label!=needs: preceding PR"
64+
65+
# Reviewers
66+
- "#changes-requested-reviews-by=0"
67+
- "#approved-reviews-by>=1"
68+
69+
# CI green policy, at least Travis should be green
70+
- status-success~=continuous-integration/travis-ci/pr
71+
# new CI needs to be done
72+
- status-neutral~=continuous-integration/jenkins/pr-head
73+
actions:
74+
label:
75+
add:
76+
- "needs: CI"
77+
remove:
78+
- "needs: review"
79+
80+
- name: remove ready for merge when merged
81+
conditions:
82+
- merged
83+
- label=ready for merge
84+
actions:
85+
label:
86+
remove:
87+
- ready for merge
88+
89+
- name: add "do not merge" label when WIP is in title
90+
conditions:
91+
- title~=^(\[wip\]( |:) |\[WIP\]( |:) |wip( |:) |WIP( |:)).*
92+
actions:
93+
label:
94+
add:
95+
- do not merge
96+
97+
- name: "label needs: work when there is a conflict"
98+
conditions:
99+
- conflict
100+
actions:
101+
label:
102+
add:
103+
- "needs: work"
104+
remove:
105+
- "needs: review"
106+
comment:
107+
message: This PR cannot be merged due to conflicts. Please rebase to resolve them.
108+
109+
- name: "add label feature branch for feature branch additions"
110+
conditions:
111+
- base~=^feature
112+
actions:
113+
label:
114+
add:
115+
- "release-version: feature branch"
116+
117+
- name: label "ready for merge" when ready
118+
conditions:
119+
# Labels
120+
- label!=do not merge
121+
- "label!=needs: work"
122+
- "label!=needs: preceding PR"
123+
- "label!=needs: review"
124+
- "label=needs: CI"
125+
126+
# Reviewers
127+
- "#approved-reviews-by>=1"
128+
- "#changes-requested-reviews-by=0"
129+
130+
# CI green policy
131+
- status-success~=continuous-integration/travis-ci/pr
132+
# Internal Jenkins - we rely on PR head to provide status - all passed
133+
- status-success~=continuous-integration/jenkins/pr-head
134+
actions:
135+
label:
136+
add:
137+
- ready for merge
138+
remove:
139+
- "needs: CI"
140+

0 commit comments

Comments
 (0)