• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# The logic for each $FARM is as follows:
2#
3# If the disable file exists, we are disabling the farm, or it's already
4# disabled:
5#   - exists: [ .ci-farms-disabled/$FARM ]
6#     when: never
7#
8# Otherwise, changing the disable file means removing it, so we are
9# re-enabling the farm:
10#   - changes: [ .ci-farms-disabled/$FARM ]
11#     if: '$CI_PIPELINE_SOURCE != "schedule"'
12#     when: on_success
13# Note: the "manual" variant of each farm rules changes the above to `never`,
14# so that jobs meant to be manual don't run in re-enablement MRs. This is the
15# only difference between `.$FARM-farm-rules` and `.$FARM-farm-manual-rules`.
16#
17# If any other disable file is modified, we are disabling/re-enabling another
18# farm:
19#   - changes: [ .ci-farms-disabled/* ]
20#     if: '$CI_PIPELINE_SOURCE != "schedule"'
21#     when: never
22#
23# The `not schedule` condition is there to make sure scheduled pipelines
24# contains all the jobs, as `changes` conditions in scheduled pipelines are
25# always evaluated to `true`.
26#
27# The "fallback", if none of these rules match, is usually the list of files
28# that are used by a driver. See the various `.$DRIVER-rules` in the
29# corresponding `src/**/ci/gitlab-ci.yml`.
30
31.microsoft-farm-rules:
32  rules:
33    - exists: [ .ci-farms-disabled/microsoft ]  # 1. Is disabled, never run
34      when: never
35    - changes: [ .ci-farms-disabled/microsoft ]  # 2. Removed from disabled, run
36      if: '$CI_PIPELINE_SOURCE != "schedule"'
37      when: on_success
38    - changes: [ .ci-farms-disabled/* ]  # 3. We touched other farms in MR, do not run
39      if: '$CI_PIPELINE_SOURCE != "schedule"'
40      when: never
41    # 4. Fall-through (other rules or on_success)
42
43.microsoft-farm-manual-rules:
44  rules:
45    # Allow triggering jobs manually in other cases if any files affecting the
46    # pipeline were changed
47    - exists: [ .ci-farms-disabled/microsoft ]
48      when: never
49    - changes: [ .ci-farms-disabled/microsoft ]
50      if: '$CI_PIPELINE_SOURCE != "schedule"'
51      when: never
52    - !reference [.microsoft-farm-rules, rules]
53
54.microsoft-farm-container-rules:
55  rules:
56    # Allow triggering jobs manually in other cases if any files affecting the
57    # pipeline were changed
58    - exists: [ .ci-farms-disabled/microsoft ]
59      when: never
60    - changes: [ .ci-farms-disabled/microsoft ]
61      if: '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
62      when: on_success
63    - changes: [ .ci-farms-disabled/microsoft ]
64      if: '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"'
65      when: on_success
66    - changes: [ .ci-farms-disabled/microsoft ]
67      if: '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
68      when: on_success
69    - changes: [ .ci-farms-disabled/* ]
70      if: '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
71      when: never
72    - changes: [ .ci-farms-disabled/* ]
73      if: '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"'
74      when: never
75    - changes: [ .ci-farms-disabled/* ]
76      if: '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
77      when: never
78
79
80.collabora-farm-rules:
81  rules:
82    - exists: [ .ci-farms-disabled/collabora ]
83      when: never
84    - if: '$CI_PIPELINE_SOURCE != "schedule"'
85      changes: [ .ci-farms-disabled/collabora ]
86      when: on_success
87    - if: '$CI_PIPELINE_SOURCE != "schedule"'
88      changes: [ .ci-farms-disabled/* ]
89      when: never
90
91.collabora-farm-manual-rules:
92  rules:
93    - exists: [ .ci-farms-disabled/collabora ]
94      when: never
95    - if: '$CI_PIPELINE_SOURCE != "schedule"'
96      changes: [ .ci-farms-disabled/collabora ]
97      when: never
98    - !reference [.collabora-farm-rules, rules]
99
100
101.igalia-farm-rules:
102  rules:
103    - exists: [ .ci-farms-disabled/igalia ]
104      when: never
105    - changes: [ .ci-farms-disabled/igalia ]
106      if: '$CI_PIPELINE_SOURCE != "schedule"'
107      when: on_success
108    - changes: [ .ci-farms-disabled/* ]
109      if: '$CI_PIPELINE_SOURCE != "schedule"'
110      when: never
111
112.igalia-farm-manual-rules:
113  rules:
114    - exists: [ .ci-farms-disabled/igalia ]
115      when: never
116    - changes: [ .ci-farms-disabled/igalia ]
117      if: '$CI_PIPELINE_SOURCE != "schedule"'
118      when: never
119    - !reference [.igalia-farm-rules, rules]
120
121
122.lima-farm-rules:
123  rules:
124    - exists: [ .ci-farms-disabled/lima ]
125      when: never
126    - changes: [ .ci-farms-disabled/lima ]
127      if: '$CI_PIPELINE_SOURCE != "schedule"'
128      when: on_success
129    - changes: [ .ci-farms-disabled/* ]
130      if: '$CI_PIPELINE_SOURCE != "schedule"'
131      when: never
132
133.lima-farm-manual-rules:
134  rules:
135    - exists: [ .ci-farms-disabled/lima ]
136      when: never
137    - changes: [ .ci-farms-disabled/lima ]
138      if: '$CI_PIPELINE_SOURCE != "schedule"'
139      when: never
140    - !reference [.lima-farm-rules, rules]
141
142
143.anholt-farm-rules:
144  rules:
145    - exists: [ .ci-farms-disabled/anholt ]
146      when: never
147    - changes: [ .ci-farms-disabled/anholt ]
148      if: '$CI_PIPELINE_SOURCE != "schedule"'
149      when: on_success
150    - changes: [ .ci-farms-disabled/* ]
151      if: '$CI_PIPELINE_SOURCE != "schedule"'
152      when: never
153
154.anholt-farm-manual-rules:
155  rules:
156    - exists: [ .ci-farms-disabled/anholt ]
157      when: never
158    - changes: [ .ci-farms-disabled/anholt ]
159      if: '$CI_PIPELINE_SOURCE != "schedule"'
160      when: never
161    - !reference [.anholt-farm-rules, rules]
162
163
164.valve-farm-rules:
165  rules:
166    - exists: [ .ci-farms-disabled/valve-mupuf ]
167      if: '$RUNNER_FARM_LOCATION == "mupuf"'
168      when: never
169    - exists: [ .ci-farms-disabled/valve-kws ]
170      if: '$RUNNER_FARM_LOCATION == "keywords"'
171      when: never
172    - changes: [ .ci-farms-disabled/valve-mupuf ]
173      if: '$RUNNER_FARM_LOCATION == "mupuf" && $CI_PIPELINE_SOURCE != "schedule"'
174      when: on_success
175    - changes: [ .ci-farms-disabled/valve-kws ]
176      if: '$RUNNER_FARM_LOCATION == "keywords" && $CI_PIPELINE_SOURCE != "schedule"'
177      when: on_success
178    - changes: [ .ci-farms-disabled/* ]
179      if: '$CI_PIPELINE_SOURCE != "schedule"'
180      when: never
181
182.valve-farm-manual-rules:
183  rules:
184    - exists: [ .ci-farms-disabled/valve-mupuf ]
185      if: '$RUNNER_FARM_LOCATION == "mupuf"'
186      when: never
187    - exists: [ .ci-farms-disabled/valve-kws ]
188      if: '$RUNNER_FARM_LOCATION == "keywords"'
189      when: never
190    - changes: [ .ci-farms-disabled/valve-mupuf ]
191      if: '$RUNNER_FARM_LOCATION == "mupuf" && $CI_PIPELINE_SOURCE != "schedule"'
192      when: never
193    - changes: [ .ci-farms-disabled/valve-kws ]
194      if: '$RUNNER_FARM_LOCATION == "keywords" && $CI_PIPELINE_SOURCE != "schedule"'
195      when: never
196    - !reference [.valve-farm-rules, rules]
197
198
199.austriancoder-farm-rules:
200  rules:
201    - exists: [ .ci-farms-disabled/austriancoder ]
202      when: never
203    - changes: [ .ci-farms-disabled/austriancoder ]
204      if: '$CI_PIPELINE_SOURCE != "schedule"'
205      when: on_success
206    - changes: [ .ci-farms-disabled/* ]
207      if: '$CI_PIPELINE_SOURCE != "schedule"'
208      when: never
209
210.austriancoder-farm-manual-rules:
211  rules:
212    - exists: [ .ci-farms-disabled/austriancoder ]
213      when: never
214    - changes: [ .ci-farms-disabled/austriancoder ]
215      if: '$CI_PIPELINE_SOURCE != "schedule"'
216      when: never
217    - !reference [.austriancoder-farm-rules, rules]
218
219
220.google-freedreno-farm-rules:
221  rules:
222    - exists: [ .ci-farms-disabled/google-freedreno ]
223      when: never
224    - changes: [ .ci-farms-disabled/google-freedreno ]
225      if: '$CI_PIPELINE_SOURCE != "schedule"'
226      when: on_success
227    - changes: [ .ci-farms-disabled/* ]
228      if: '$CI_PIPELINE_SOURCE != "schedule"'
229      when: never
230
231.google-freedreno-farm-manual-rules:
232  rules:
233    - exists: [ .ci-farms-disabled/google-freedreno ]
234      when: never
235    - changes: [ .ci-farms-disabled/google-freedreno ]
236      if: '$CI_PIPELINE_SOURCE != "schedule"'
237      when: never
238    - !reference [.google-freedreno-farm-rules, rules]
239
240.vmware-farm-rules:
241  rules:
242    - exists: [ .ci-farms-disabled/vmware ]
243      when: never
244    - changes: [ .ci-farms-disabled/vmware ]
245      if: '$CI_PIPELINE_SOURCE != "schedule"'
246      when: on_success
247    - changes: [ .ci-farms-disabled/* ]
248      if: '$CI_PIPELINE_SOURCE != "schedule"'
249      when: never
250
251.vmware-farm-manual-rules:
252  rules:
253    - exists: [ .ci-farms-disabled/vmware ]
254      when: never
255    - changes: [ .ci-farms-disabled/vmware ]
256      if: '$CI_PIPELINE_SOURCE != "schedule"'
257      when: never
258    - !reference [.vmware-farm-rules, rules]
259
260.ondracka-farm-rules:
261  rules:
262    - exists: [ .ci-farms-disabled/ondracka ]
263      when: never
264    - changes: [ .ci-farms-disabled/ondracka ]
265      if: '$CI_PIPELINE_SOURCE != "schedule"'
266      when: on_success
267    - changes: [ .ci-farms-disabled/* ]
268      if: '$CI_PIPELINE_SOURCE != "schedule"'
269      when: never
270
271.ondracka-farm-manual-rules:
272  rules:
273    - exists: [ .ci-farms-disabled/ondracka ]
274      when: never
275    - changes: [ .ci-farms-disabled/ondracka ]
276      if: '$CI_PIPELINE_SOURCE != "schedule"'
277      when: never
278    - !reference [.ondracka-farm-rules, rules]
279
280
281# Skip container & build jobs when disabling any farm, and run them if any
282# farm gets re-enabled.
283# Only apply these rules in MR context, because otherwise we get a false
284# positive on files being 'created' when pushing to a new branch, and break
285# our pipeline
286.disable-farm-mr-rules:
287  rules:
288    # changes(disabled) + exists(disabled) = disabling the farm
289    # Note: this cannot be simplified into a single `.ci-farms-disabled/*` rule
290    # because if there are more than one disabled farm and we only re-enable
291    # one, the exits(.ci-farms-disabled/*) would match and what should be
292    # a farm re-enable pipeline will be detected as a farm disable pipeline.
293    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
294      changes: [ .ci-farms-disabled/microsoft ]
295      exists: [ .ci-farms-disabled/microsoft ]
296      when: never
297    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
298      changes: [ .ci-farms-disabled/collabora ]
299      exists: [ .ci-farms-disabled/collabora ]
300      when: never
301    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
302      changes: [ .ci-farms-disabled/igalia ]
303      exists: [ .ci-farms-disabled/igalia ]
304      when: never
305    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
306      changes: [ .ci-farms-disabled/lima ]
307      exists: [ .ci-farms-disabled/lima ]
308      when: never
309    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
310      changes: [ .ci-farms-disabled/anholt ]
311      exists: [ .ci-farms-disabled/anholt ]
312      when: never
313    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
314      changes: [ .ci-farms-disabled/valve-mupuf ]
315      exists: [ .ci-farms-disabled/valve-mupuf ]
316      when: never
317    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
318      changes: [ .ci-farms-disabled/valve-kws ]
319      exists: [ .ci-farms-disabled/valve-kws ]
320      when: never
321    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
322      changes: [ .ci-farms-disabled/austriancoder ]
323      exists: [ .ci-farms-disabled/austriancoder ]
324      when: never
325    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
326      changes: [ .ci-farms-disabled/google-freedreno ]
327      exists: [ .ci-farms-disabled/google-freedreno ]
328      when: never
329    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
330      changes: [ .ci-farms-disabled/ondracka ]
331      exists: [ .ci-farms-disabled/ondracka ]
332      when: never
333    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
334      changes: [ .ci-farms-disabled/vmware ]
335      exists: [ .ci-farms-disabled/vmware ]
336      when: never
337    # Any other change to ci-farms/* means some farm is getting re-enabled.
338    # Run jobs in Marge pipelines (and let it fallback to manual otherwise)
339    - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $GITLAB_USER_LOGIN == "marge-bot"'
340      changes: [ .ci-farms/* ]
341      when: on_success
342