Skip to content

Commit b710066

Browse files
authored
Merge pull request #12269 from 0xc0170/test_mergify
mergify: add fixes to the conditions
2 parents 67cf9f7 + c28fbf5 commit b710066

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

.mergify.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
# Notes: conditions do not check if label is already there if we add or remove later, this is to limit Github API access to
2121
# minimum. If a label is already there and we add it again, nothing should happen (we do 1 less access to Github).
22-
# For instance for needs: work if CI failed, we just add a label as action, don't check if needs: works is already there
22+
# For instance for needs: work if CI failed, we just add a label as action, don't check if needs: works is already there.
23+
#
24+
# Reviewers request needs write access to block PR, otherwise it's just a suggestion on Github, not PR block
2325

2426
pull_request_rules:
2527
# From needs: review to needs: work - reviewers request
@@ -74,12 +76,11 @@ pull_request_rules:
7476
remove:
7577
- "needs: review"
7678

77-
# From needs: review to needs: CI
79+
# From needs: review or needs: work to needs: CI. One approval means we should be good to start CI
7880
- name: "label needs: CI when at least one reviewers approval"
7981
conditions:
8082
- base~=feature-mergify
8183
# Labels
82-
- "label!=needs: work"
8384
- "label!=needs: preceding PR"
8485

8586
# Reviewers
@@ -88,14 +89,16 @@ pull_request_rules:
8889

8990
# CI green policy, at least Travis should be green
9091
- status-success~=continuous-integration/travis-ci/pr
91-
# new CI needs to be done
92-
- status-neutral~=continuous-integration/jenkins/pr-head
92+
# new CI needs to be done (neutral does not work, lets check if it failed or passed, if none, we need to run again)
93+
- -status-success~=continuous-integration/jenkins/pr-head
94+
- -status-failure~=continuous-integration/jenkins/pr-head
9395
actions:
9496
label:
9597
add:
9698
- "needs: CI"
9799
remove:
98100
- "needs: review"
101+
- "needs: work"
99102

100103
# Conflict in the PR - needs: work and a comment to notify a user
101104
- name: "label needs: work when there is a conflict"
@@ -126,7 +129,7 @@ pull_request_rules:
126129
conditions:
127130
- base~=feature-mergify
128131
# Labels
129-
- label!=do not merge
132+
- "label!=do not merge"
130133
- "label=needs: CI"
131134

132135
# Reviewers
@@ -137,12 +140,12 @@ pull_request_rules:
137140
- status-success~=continuous-integration/travis-ci/pr
138141
# Internal Jenkins - we rely on PR head to provide status
139142
- status-success~=continuous-integration/jenkins/pr-head
140-
# any of the jenkins pipeline needs to be green
141-
- status-success~=^jenkins-ci
143+
# any of the jenkins pipeline needs to be green. We rely on not failure means all good (if skipped or executed)
144+
- -status-failure~=^jenkins-ci
142145
actions:
143146
label:
144147
add:
145-
- ready for merge
148+
- "ready for merge"
146149
remove:
147150
- "needs: CI"
148151

@@ -151,11 +154,11 @@ pull_request_rules:
151154
conditions:
152155
- base~=feature-mergify
153156
- merged
154-
- label=ready for merge
157+
- "label=ready for merge"
155158
actions:
156159
label:
157160
remove:
158-
- ready for merge
161+
- "ready for merge"
159162

160163
- name: add "do not merge" label when WIP is in title
161164
conditions:
@@ -164,7 +167,7 @@ pull_request_rules:
164167
actions:
165168
label:
166169
add:
167-
- do not merge
170+
- "do not merge"
168171

169172
# Check if version label is applied
170173
- name: release version is a must for merged PRs
@@ -175,7 +178,7 @@ pull_request_rules:
175178
actions:
176179
label:
177180
add:
178-
- Release review required
181+
- "Release review required"
179182
comment:
180183
message: This PR does not contain release version label after merging.
181184

0 commit comments

Comments
 (0)