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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""Determine whether the given set of task attributes matches.
The conditions are given as keyword arguments, where each keyword names an
attribute. The keyword value can be a literal, a set, or a callable:
* A literal must match the attribute exactly.
* Given a set or list, the attribute value must be contained within it.
* A callable is called with the attribute value and returns a boolean.
If an attribute is specified as a keyword argument but not present in the
task's attributes, the result is False.
Args:
attributes (dict): The task's attributes object.
kwargs (dict): The conditions the task's attributes must satisfy in
order to match.
Returns:
bool: Whether the task's attributes match the conditions or not.
"""
return False
=
return False
return False
return False
return True
"""Determine if any keys in attributes are a match to target, then return
a list of matching values. First exact matches will be checked. Failing
that, regex matches and finally a default key.
"""
# exact match
return
# regular expression match
=
return
# default
return
return
"""
Determine whether the given parameter is included in the corresponding `run-on-attribute`.
"""
return True
return in
=
=
"""
Determine whether the given project is included in the `run-on-git-branches` parameter.
Allows 'all'.
"""
return True
return True
return False
"""Join one or more lists, and return a sorted list of unique members"""
=
return