-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.yml
850 lines (770 loc) · 29.8 KB
/
bot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
Skip to content
Enterprise
Search or jump to…
Pull requests
Issues
Explore
@sriramkavuluripartner
Heads-up Compliance: Every user has to ensure that tools/components used in builds or stored in images are properly licensed (e.g. tools, Java Runtime) – Details
node0
/
mergeable-test
Public
Fork your own copy of node0/mergeable-test
Code
Pull requests
10
Projects
Security
Insights
mergeable-test/.github/mergeable.yml
@dogancanyigitpartner
dogancanyigitpartner TEST: optional checks functionality
…
Latest commit f8c8c3b 2 weeks ago
History
4 contributors
@jeremieguichardpartner@tomaszdziendzielskipartner@marcinlispartner@dogancanyigitpartner
825 lines (742 sloc) 28.3 KB
# This file configures GitHub Mergeable App
#
# Repo in CC: https://cc-github.bmwgroup.net/codecraft-oss/probot-mergeable
# Documentation: https://mergeable.readthedocs.io/en/latest/index.html
#
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# This file was generated using
# https://cc-github.bmwgroup.net/node0/mergeable-conf-generator
#
# Do not edit!
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#
# yamllint disable rule:line-length
# Generic _shared definitions
################################################################################
# Regular expression pattern used for detecting WIP (Work in Progress)
# IMPORTANT: mergeable regex is case-insensitive by default
.wip-regex: &wip-regex
regex: "\\bwip\\b|\\bwork.?in.?progress\\b|\\bdo.?not.?merge\\b|\\bdon'?t.?merge\\b|\\bdo.?not.?review\\b|\\bdon'?t.?review\\b|\\bdraft\\b"
# Generic actions definitions
################################################################################
# Check action used to overwrites mergeable default messages in case of errors
# additionally certain rules customize the pass action so other
# actions should be customized too so there is always feedback to GitHub.
.check-error-action: &check-error-action
do: checks
status: "action_required"
payload:
title: "Mergeable configuration errors!"
summary: |
### Status: {{toUpperCase validationStatus}}
Some or All of the validators have returned 'error' status,
please check below for details
Here are some stats of the run: \n
{{validationCount}} validations were ran.
{{passCount}} PASSED
{{failCount}} FAILED
{{errorCount}} ERRORED
text: "{{#each validationSuites}}
#### {{{statusIcon status}}} Validator: {{toUpperCase name}}
Status {{toUpperCase status}}
{{#each validations }} * {{{statusIcon status}}}\
{{{ description }}}\n
{{#if details.error}}
Error : {{{details.error}}}
{{/if}}
{{/each}}
{{/each}}"
# Check action used to overwrites mergeable default messages in case of failure
# (validations did not passed e.g. approval not given)
# additionally certain rules customize the pass action so other
# actions should be customized too so there is always feedback to GitHub.
.check-failure-action: &check-failure-action
do: checks
status: "failure"
payload:
title: "Approval needed"
summary: |
### Status: {{toUpperCase validationStatus}}
Here are some stats of the run:
{{validationCount}} validations were ran.
{{passCount}} PASSED
{{failCount}} FAILED
text: "{{#each validationSuites}}\n
#### {{{statusIcon status}}} Validator: {{toUpperCase name}}\n
{{#each validations }} * {{{statusIcon status}}}\
{{{ description }}}\n
{{/each}}\n
{{/each}}"
# Check action used to overwrites mergeable default messages in case of success
# (validations passed e.g. approval given or not needed)
# additionally certain rules customize the pass action so other
# actions should be customized too so there is always feedback to GitHub.
.check-success-action: &check-success-action
do: checks
status: "success"
payload:
title: "Approval given or not needed"
summary: |
### Status: {{toUpperCase validationStatus}}
Here are some stats of the run:
{{validationCount}} validations were ran.
{{passCount}} PASSED
{{failCount}} FAILED
text: "{{#each validationSuites}}\n
#### {{{statusIcon status}}} Validator: {{toUpperCase name}}\n
{{#each validations }} * {{{statusIcon status}}}\
{{{ description }}}\n
{{/each}}\n
{{/each}}"
# Generic checks definitions
################################################################################
# yocto layer folders
.changetype-yocto-test-layers-regex: &changetype-yocto-test-layers-regex >-
(recipes-.*/.*|conf/.*|classes/.*)$
# Commit: title validation rule
#
# Check if commit title contains Revert, Merge or Bumped Submodules
# To be used with OR conditional to skip validation.
#
# Needed when:
# * This is a non voting rule
#
.commit-excluder: &commit-excluder
do: commit
message:
regex: '^(Revert|Merge|Bumped Submodules).*\n\n'
regex_flag: si
message: >-
Commit title does not contain `Revert`, `Merge`, or
`Bumped Submodules:`, will validate other criteria.
# Commit: title validation rule
#
# Check if commit title follows the "<component>: <short description>" syntax
# This rule won't be enforced if the commit is Revert, Merge, or Bumped Submodules.
# It is used with an OR conditional.
#
# Needed when:
# * always
#
.commit-component-description-validator: &commit-component-description-validator
do: commit
message:
regex: '^\S+: .+\n\n'
regex_flag: si
message: >-
Commit title field is incorrect.
Check
[documentation](https://cc-github.bmwgroup.net/pages/node0/node0-linux-documentation/master/contributing-information/pr-commit-conventions.html)
for details.
# Commit: Issue field validation rule
#
# Check if commit message contains Issue: field with correct values
#
# Needed when:
# * always
#
.commit-issue-validator: &commit-issue-validator
do: commit
message:
# search for Issue field
regex: ^[Ii][Ss][Ss][Uu][Ee]:[ ]?([Nn][Oo][Nn][Ee]|(([A-Z0-9]+-[0-9]+)(,|, | ,|))+(?<!,[ ]?))$
regex_flag: m
message: >-
Issue field on commit message is incorrect.
Check
[documentation](https://cc-github.bmwgroup.net/pages/node0/node0-linux-documentation/master/contributing-information/pr-commit-conventions.html)
for details.
# Commit: do not allow PR-specific fields
#
# Check if commit message contains PR-specific fields
#
# Needed when:
# * always
#
.commit-pr-fields-validator: &commit-pr-fields-validator
do: commit
message:
# yamllint disable rule:line-length
regex: '^(?!.*(Bitbake-Extra-Arguments|Bitbake-Target|Depends-On|Domain-Tests|Release-PDX|Tested-With|Upload-Artifacts|With-OSS-Artifacts):).*'
regex_flag: si
message: >-
Commit body must not contain PR specific fields.
Check
[documentation](https://cc-github.bmwgroup.net/pages/node0/node0-linux-documentation/master/contributing-information/pr-commit-conventions.html)
for details.
# This validation must not be used with WIP, not-a-draft filters,
# as each push must go through validation.
.commit-message-validation-check: &commit-message-validation-check
when: pull_request.opened, pull_request.reopened, pull_request.synchronize, pull_request.edited, pull_request.labeled
name: "PR: commit message validation"
validate:
- *commit-issue-validator
- *commit-pr-fields-validator
- do: or
validate:
- *commit-excluder
- do: changeset
must_exclude:
regex: *changetype-yocto-test-layers-regex
- do: and
validate:
- do: changeset
must_include:
regex: *changetype-yocto-test-layers-regex
- *commit-component-description-validator
pass:
- *check-success-action
fail:
- *check-failure-action
error:
- *check-error-action
.pr-checklist-validator: &pr-checklist-validator
do: description
must_exclude:
regex: '\[ \]'
regex_flag: m
message: Missing checking checklist in PR's description
.pr-checklist-validation-check: &pr-checklist-validation-check
when: pull_request.edited, pull_request.opened, pull_request.ready_for_review, pull_request.reopened, pull_request.synchronize, pull_request.unlabeled, pull_request_review.edited, pull_request_review.submitted
name: "PR: checklist validation"
validate:
# we can validate PR's description with multiple validators:
- *pr-checklist-validator
pass:
- *check-success-action
fail:
- *check-failure-action
error:
- *check-error-action
# PR: description validation rule
#
# Check for the required Issue: field in the PR description
#
# Needed when:
# * always
#
.pr-description-field-validator-issue: &pr-description-field-validator-issue
do: description
must_include:
# "regex" should be aligned with the following one(s):
# yamllint disable-line rule:line-length
# - https://cc-github.bmwgroup.net/node0/release-notes-generator/blob/master/release_notes_generator/git.py
# yamllint disable-line rule:line-length
# - https://cc-github.bmwgroup.net/node0/build-support-yocto/blob/master/lib/build_support_yocto/github_utils.py
# Search for ISSUES_LINE_REGEX
regex: ^[Ii][Ss][Ss][Uu][Ee]:[ ]?([Nn][Oo][Nn][Ee]|(([A-Z0-9]+-[0-9]+)(,|, | ,|))+(?<!,[ ]?))$
regex_flag: m
message: >-
'Issue' field in PR's description missing or malformed.
Check
[documentation](https://cc-github.bmwgroup.net/pages/node0/node0-linux-documentation/master/contributing-information/pr-fields.html#issue)
for details.
# PR: description validation rule
#
# Check if any of forbidden fields is present in the PR description
# to prevent PRs from gating and give early information
# Forbidden fields list:
# - Bitbake-Target:
# - Bitbake-Extra-Arguments:
# - Skip:
#
# IMPORTANT: the regular expressions to match the fields above
# MUST adhere to the specification of the fields as implemented
# in Python, in the build-support-yocto repository.
#
# Needed when:
# * always
#
.pr-description-field-validator-bitbake: &pr-description-field-validator-bitbake
do: description
and:
- must_exclude:
regex: '^Bitbake-Target:\s.*'
regex_flag: mi
message: Forbidden 'Bitbake-Target' field in PR's description
- must_exclude:
regex: '^Bitbake-Extra-Arguments:\s.*'
regex_flag: mi
message: Forbidden 'Bitbake-Extra-Arguments' field in PR's description
.pr-description-field-validator-skip: &pr-description-field-validator-skip
do: description
and:
- must_exclude:
regex: '^Skip:\s.*'
regex_flag: mi
message: Forbidden 'Skip' field in PR's description
.pr-description-validation-check: &pr-description-validation-check
when: pull_request.edited, pull_request.opened, pull_request.ready_for_review, pull_request.reopened, pull_request.synchronize, pull_request.unlabeled, pull_request_review.edited, pull_request_review.submitted
name: "PR: description validation"
validate:
# we can validate PR's description with multiple validators:
- *pr-description-field-validator-issue
- *pr-description-field-validator-bitbake
- *pr-description-field-validator-skip
pass:
- *check-success-action
fail:
- *check-failure-action
error:
- *check-error-action
# PR: title validation rule
#
# Check if title follows the "<component>: <short description>" syntax
#
# Needed when:
# * always
#
.pr-title-validator-component-description: &pr-title-validator-component-description
do: title
or:
- begins_with:
match:
- 'Revert'
- 'revert'
- 'Merge'
- 'merge'
- 'Bumped Submodules'
- 'Bumped submodules'
- 'bumped submodules'
message: >-
Title field in PR does not start with Revert, Merge, Bumped Submodules.
# search for "<component>: <short description>" regex using "^\S+: .+$"
- must_include:
regex: '^\S+: .+$'
message: >-
Title field in PR is incorrect.
Check
[documentation](https://cc-github.bmwgroup.net/pages/node0/node0-linux-documentation/master/contributing-information/pr-commit-conventions.html)
for details.
.pr-title-validation-check: &pr-title-validation-check
when: pull_request.edited, pull_request.opened, pull_request.ready_for_review, pull_request.reopened, pull_request.synchronize, pull_request.unlabeled, pull_request_review.edited, pull_request_review.submitted
name: "PR: title validation"
validate:
- *pr-title-validator-component-description
pass:
- *check-success-action
fail:
- *check-failure-action
error:
- *check-error-action
# PR: WIP validation rule
#
# Check if any of the "Work in Progress" indicating words is present in the PR
# title. Positive search result will fail the check and prevent PR from running
# GATE pipeline.
# WIP search patterns are defined in the shared definition named `wip-regex`
#
# Mergeable check which is replacing Github WIP plugin.
# Mergeable rules give more flexibility compared to WIP plugin, e.g.
# possibility to specify more search patterns or exclude branch name from validation
.pr-title-validator-wip: &pr-title-validator-wip
do: title
must_exclude:
<<: *wip-regex
message: "PR title contains WIP-specific keyword, which means PR is still under development.\n
WIP-related keywords (case insensitive):\n * wip\n * work in progress\n
* do not merge\n * do not review\n * draft"
.pr-wip-validation-check: &pr-wip-validation-check
when: pull_request.edited, pull_request.opened, pull_request.ready_for_review, pull_request.reopened, pull_request.synchronize, pull_request.unlabeled, pull_request_review.edited, pull_request_review.submitted
name: "PR: WIP validation"
validate:
# we can validate PR's description with multiple validators:
- *pr-title-validator-wip
pass:
- *check-success-action
fail:
- *check-failure-action
error:
- *check-error-action
# Generic filters definitions
################################################################################
# Do not run associated rules on draft pull requests.
.not-a-draft-filter: ¬-a-draft-filter
do: payload
pull_request:
draft:
boolean:
match: false
# Do not run associated rules on a pull request with `no-check` label
.not-no-check-label-filter: ¬-no-check-label-filter
do: payload
pull_request:
labels:
must_exclude:
regex: "no-check"
key: "name"
# Do not run associated rules on a pull request with `wip` label
.not-wip-label-filter: ¬-wip-label-filter
do: payload
pull_request:
labels:
must_exclude:
regex: "wip"
key: "name"
# Do not run associated rules on a pull request with `WIP` or `wip` in the title
.not-wip-title-filter: ¬-wip-title-filter
do: payload
pull_request:
title:
must_exclude:
<<: *wip-regex
# This filter detects if the PullRequest elements (e.g. title or
# description) were changed. This is done by checking if special
# payload key 'action' has value 'edited'
.payload-edited-filter: &payload-edited-filter
do: payload
action:
must_include:
regex: "^edited$"
# Generic triggers definitions
################################################################################
# PR: Trigger PRlint on PR description change
#
# Needed when:
# * This is a non voting rule
#
.pr-reinspect-trigger: &pr-reinspect-trigger
# This rule should be applied to every repository that is using
# node0-standard-linters template
when: pull_request.edited
name: "Trigger PRlint on PR description change"
# mergeable recipe needs to have at least one validation rule.
# No_empty is a the simplest and fastest check
# By setting it to FALSE, it will also succeed (and leave comment)
# when the PullRequest description is removed
validate:
- do: description
no_empty:
enabled: false
# Successful validation results in posting a 'reinspect-pr' comment
# into PR. This in turn is a trigger for zuul inspect-pr pipeline
# (part of node0-standard-linters template)
pass:
- do: comment
payload:
body: >
reinspect-pr
# Change types
################################################################################
# Change type build-tools
.changetype-build-tools-label: &changetype-build-tools-label "changetype-build-tools"
.changetype-build-tools-label-must-include: &changetype-build-tools-label-must-include
must_include:
regex: *changetype-build-tools-label
message: "Label changetype-build-tools is found"
.changetype-build-tools-label-must-exclude: &changetype-build-tools-label-must-exclude
must_exclude:
regex: *changetype-build-tools-label
message: "Label changetype-build-tools is not found"
.changetype-build-tools-regex: &changetype-build-tools-regex "^((?!.*rse.*).*)$"
.changetype-build-tools-must-include: &changetype-build-tools-must-include
must_include:
regex: *changetype-build-tools-regex
message: "Changeset contains build-tools changes"
.changetype-build-tools-must-exclude: &changetype-build-tools-must-exclude
must_exclude:
regex: *changetype-build-tools-regex
message: "Changeset does not contain build-tools changes"
# Change type mergeable-config
.changetype-mergeable-config-label: &changetype-mergeable-config-label "changetype-mergeable-config"
.changetype-mergeable-config-label-must-include: &changetype-mergeable-config-label-must-include
must_include:
regex: *changetype-mergeable-config-label
message: "Label changetype-mergeable-config is found"
.changetype-mergeable-config-label-must-exclude: &changetype-mergeable-config-label-must-exclude
must_exclude:
regex: *changetype-mergeable-config-label
message: "Label changetype-mergeable-config is not found"
.changetype-mergeable-config-regex: &changetype-mergeable-config-regex "^(\\.github/mergeable\\.yml|\\.github/mergeable-conf-generator\\.yaml)$"
.changetype-mergeable-config-must-include: &changetype-mergeable-config-must-include
must_include:
regex: *changetype-mergeable-config-regex
message: "Changeset contains mergeable-config changes"
.changetype-mergeable-config-must-exclude: &changetype-mergeable-config-must-exclude
must_exclude:
regex: *changetype-mergeable-config-regex
message: "Changeset does not contain mergeable-config changes"
# Change type zuul-config
.changetype-zuul-config-label: &changetype-zuul-config-label "changetype-zuul-config"
.changetype-zuul-config-label-must-include: &changetype-zuul-config-label-must-include
must_include:
regex: *changetype-zuul-config-label
message: "Label changetype-zuul-config is found"
.changetype-zuul-config-label-must-exclude: &changetype-zuul-config-label-must-exclude
must_exclude:
regex: *changetype-zuul-config-label
message: "Label changetype-zuul-config is not found"
.changetype-zuul-config-regex: &changetype-zuul-config-regex "^(.*zuul-extra\\.d/.*\\.yaml|playbooks/.*|roles/.*|zuul\\.yaml|zuul\\.d/.*)$"
.changetype-zuul-config-must-include: &changetype-zuul-config-must-include
must_include:
regex: *changetype-zuul-config-regex
message: "Changeset contains zuul-config changes"
.changetype-zuul-config-must-exclude: &changetype-zuul-config-must-exclude
must_exclude:
regex: *changetype-zuul-config-regex
message: "Changeset does not contain zuul-config changes"
# CCB Approvals
################################################################################
# CCB: Release Managers approval
#
.teams-release-managers: &teams-release-managers
- node0/members-internal-integration
- node0/members-external-globallogic-integration
.ccb-release-managers-team-approval: &ccb-release-managers-team-approval
do: approvals
min:
count: 1
message: "At least one approval from release-managers is needed"
limit:
teams: *teams-release-managers
.ccb-release-managers-check: &ccb-release-managers-check
when: pull_request.edited, pull_request.labeled, pull_request.opened, pull_request.ready_for_review, pull_request.reopened, pull_request.synchronize, pull_request.unlabeled, pull_request_review.*
name: "CCB: Release Managers approval"
validate:
- *ccb-release-managers-team-approval
pass:
- *check-success-action
fail:
- *check-failure-action
error:
- *check-error-action
# CCB: An approval that is not on RSE changes
#
.teams-not-rse: &teams-not-rse
- node0/members-external-globallogic-integration
.ccb-not-rse-team-approval: &ccb-not-rse-team-approval
do: approvals
min:
count: 1
message: "At least one approval from not-rse is needed"
limit:
teams: *teams-not-rse
.teams-request-review-not-rse: &teams-request-review-not-rse
- members-external-globallogic-integration
.ccb-not-rse-request-review-action: &ccb-not-rse-request-review-action
do: request_review
teams: *teams-request-review-not-rse
.review-needed-not-rse-label: &review-needed-not-rse-label "review-needed-not-rse"
.review-needed-not-rse-label-must-include:
&review-needed-not-rse-label-must-include
must_include:
regex: *review-needed-not-rse-label
message: "Label review-needed-not-rse is found"
.review-needed-not-rse-label-must-exclude:
&review-needed-not-rse-label-must-exclude
must_exclude:
regex: *review-needed-not-rse-label
message: "Label review-needed-not-rse is not found"
.ccb-not-rse-approval-needed: &ccb-not-rse-approval-needed
do: or
validate:
- do: changeset
or:
- *changetype-build-tools-must-include
- do: label
or:
- *changetype-build-tools-label-must-include
- *review-needed-not-rse-label-must-include
- do: and
validate:
- do: changeset
and:
- *changetype-mergeable-config-must-exclude
- *changetype-zuul-config-must-exclude
- do: label
and:
- *changetype-mergeable-config-label-must-exclude
- *changetype-zuul-config-label-must-exclude
.ccb-not-rse-approval-not-needed: &ccb-not-rse-approval-not-needed
do: and
validate:
- do: changeset
and:
- *changetype-build-tools-must-exclude
- do: label
and:
- *changetype-build-tools-label-must-exclude
- *review-needed-not-rse-label-must-exclude
- do: or
validate:
- do: changeset
or:
- *changetype-mergeable-config-must-include
- *changetype-zuul-config-must-include
- do: label
or:
- *changetype-mergeable-config-label-must-include
- *changetype-zuul-config-label-must-include
.ccb-not-rse-check: &ccb-not-rse-check
when: pull_request.edited, pull_request.labeled, pull_request.opened, pull_request.ready_for_review, pull_request.reopened, pull_request.synchronize, pull_request.unlabeled, pull_request_review.*
name: "CCB: An approval that is not on RSE changes"
validate:
- do: or
validate:
- *ccb-not-rse-approval-not-needed
- do: and
validate:
- *ccb-not-rse-approval-needed
- *ccb-not-rse-team-approval
pass:
- *check-success-action
fail:
- *ccb-not-rse-request-review-action
- *check-failure-action
error:
- *check-error-action
# CCB: System Integrators CI approval
#
.teams-system-integrators-ci: &teams-system-integrators-ci
- node0/members-internal-integration
- node0/members-external-globallogic-integration
.ccb-system-integrators-ci-team-approval: &ccb-system-integrators-ci-team-approval
do: approvals
min:
count: 1
message: "At least one approval from system-integrators-ci is needed"
limit:
teams: *teams-system-integrators-ci
.teams-request-review-system-integrators-ci: &teams-request-review-system-integrators-ci
- members-internal-integration
- members-external-globallogic-integration
.ccb-system-integrators-ci-request-review-action: &ccb-system-integrators-ci-request-review-action
do: request_review
teams: *teams-request-review-system-integrators-ci
.review-needed-system-integrators-ci-label: &review-needed-system-integrators-ci-label "review-needed-system-integrators-ci"
.review-needed-system-integrators-ci-label-must-include:
&review-needed-system-integrators-ci-label-must-include
must_include:
regex: *review-needed-system-integrators-ci-label
message: "Label review-needed-system-integrators-ci is found"
.review-needed-system-integrators-ci-label-must-exclude:
&review-needed-system-integrators-ci-label-must-exclude
must_exclude:
regex: *review-needed-system-integrators-ci-label
message: "Label review-needed-system-integrators-ci is not found"
.ccb-system-integrators-ci-approval-needed: &ccb-system-integrators-ci-approval-needed
do: or
validate:
- do: changeset
or:
- *changetype-mergeable-config-must-include
- *changetype-zuul-config-must-include
- do: label
or:
- *changetype-mergeable-config-label-must-include
- *changetype-zuul-config-label-must-include
- *review-needed-system-integrators-ci-label-must-include
- do: and
validate:
- do: changeset
and:
- *changetype-build-tools-must-exclude
- do: label
and:
- *changetype-build-tools-label-must-exclude
.ccb-system-integrators-ci-approval-not-needed: &ccb-system-integrators-ci-approval-not-needed
do: and
validate:
- do: changeset
and:
- *changetype-mergeable-config-must-exclude
- *changetype-zuul-config-must-exclude
- do: label
and:
- *changetype-mergeable-config-label-must-exclude
- *changetype-zuul-config-label-must-exclude
- *review-needed-system-integrators-ci-label-must-exclude
- do: or
validate:
- do: changeset
or:
- *changetype-build-tools-must-include
- do: label
or:
- *changetype-build-tools-label-must-include
.ccb-system-integrators-ci-check: &ccb-system-integrators-ci-check
when: pull_request.edited, pull_request.labeled, pull_request.opened, pull_request.ready_for_review, pull_request.reopened, pull_request.synchronize, pull_request.unlabeled, pull_request_review.*
name: "CCB: System Integrators CI approval"
validate:
- do: or
validate:
- *ccb-system-integrators-ci-approval-not-needed
- do: and
validate:
- *ccb-system-integrators-ci-approval-needed
- *ccb-system-integrators-ci-team-approval
pass:
- *check-success-action
fail:
- *ccb-system-integrators-ci-request-review-action
- *check-failure-action
error:
- *check-error-action
# Repositories definitions
# Combines a repository filter with generic rules definition
# so they can then be listed in the final config
################################################################################
# Repo: mergeable-test
.mergeable-test-filter: &mergeable-test-filter
do: repository
name:
must_include:
regex: "^mergeable-test$"
.mergeable-test-pr-title-validation-check: &mergeable-test-pr-title-validation-check
<<: *pr-title-validation-check
filter:
- *mergeable-test-filter
.mergeable-test-pr-description-validation-check: &mergeable-test-pr-description-validation-check
<<: *pr-description-validation-check
filter:
- *mergeable-test-filter
.mergeable-test-pr-wip-validation-check: &mergeable-test-pr-wip-validation-check
<<: *pr-wip-validation-check
filter:
- *not-a-draft-filter
- *not-wip-label-filter
- *not-wip-title-filter
- *mergeable-test-filter
.mergeable-test-commit-message-validation-check: &mergeable-test-commit-message-validation-check
<<: *commit-message-validation-check
filter:
- *mergeable-test-filter
.mergeable-test-ccb-release-managers-check: &mergeable-test-ccb-release-managers-check
<<: *ccb-release-managers-check
filter:
- *not-a-draft-filter
- *not-wip-label-filter
- *not-wip-title-filter
- *mergeable-test-filter
.mergeable-test-ccb-system-integrators-ci-check: &mergeable-test-ccb-system-integrators-ci-check
<<: *ccb-system-integrators-ci-check
filter:
- *not-a-draft-filter
- *not-wip-label-filter
- *not-wip-title-filter
- *mergeable-test-filter
.mergeable-test-ccb-not-rse-check: &mergeable-test-ccb-not-rse-check
<<: *ccb-not-rse-check
filter:
- *not-a-draft-filter
- *not-wip-label-filter
- *not-wip-title-filter
- *mergeable-test-filter
.mergeable-test-pr-reinspect-trigger: &mergeable-test-pr-reinspect-trigger
<<: *pr-reinspect-trigger
filter:
- *payload-edited-filter
- *mergeable-test-filter
################################################################################
# Mergeable configuration
################################################################################
version: 2
mergeable:
- *mergeable-test-pr-title-validation-check
- *mergeable-test-pr-description-validation-check
- *mergeable-test-pr-wip-validation-check
- *mergeable-test-commit-message-validation-check
- *mergeable-test-ccb-release-managers-check
- *mergeable-test-ccb-system-integrators-ci-check
- *mergeable-test-ccb-not-rse-check
- *mergeable-test-pr-reinspect-trigger