You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name: "--ignore-labels match (with one out of two)",
29
+
prLabels: []string{"a", "b"},
30
+
ignoreLabels: []string{"b", "c"},
31
+
want: false,
32
+
caseSensitive: false,
27
33
},
28
34
29
35
{
30
-
prLabels: []string{"a"},
31
-
ignoreLabels: []string{"b"},
32
-
selectLabels: []string{"c"},
33
-
want: false,
36
+
name: "no labels match (select or ignore)",
37
+
prLabels: []string{"a"},
38
+
ignoreLabels: []string{"b"},
39
+
selectLabels: []string{"c"},
40
+
want: false,
41
+
caseSensitive: false,
34
42
},
35
43
{
36
-
prLabels: []string{"a", "c"},
37
-
ignoreLabels: []string{"b"},
38
-
selectLabels: []string{"c"},
39
-
want: true,
44
+
name: "--select-labels match",
45
+
prLabels: []string{"a", "c"},
46
+
ignoreLabels: []string{"b"},
47
+
selectLabels: []string{"c"},
48
+
want: true,
49
+
caseSensitive: false,
40
50
},
41
51
{
42
-
prLabels: []string{"a"},
43
-
ignoreLabels: []string{"b"},
44
-
selectLabels: []string{"a", "c"},
45
-
want: true,
52
+
name: "--select-labels match (with one out of two) and ignore labels don't match",
53
+
prLabels: []string{"a"},
54
+
ignoreLabels: []string{"b"},
55
+
selectLabels: []string{"a", "c"},
56
+
want: true,
57
+
caseSensitive: false,
58
+
},
59
+
{
60
+
name: "the pull request has no labels",
61
+
prLabels: []string{},
62
+
ignoreLabels: []string{"b"},
63
+
selectLabels: []string{"a", "c"},
64
+
want: false,
65
+
caseSensitive: false,
66
+
},
67
+
{
68
+
name: "the pull request has no labels and ignore labels don't match so it matches - but select labels is empty so it means all labels or even no labels match",
69
+
prLabels: []string{},
70
+
ignoreLabels: []string{"b"},
71
+
selectLabels: []string{},
72
+
want: true,
73
+
caseSensitive: false,
46
74
},
47
75
{
48
-
prLabels: []string{},
49
-
ignoreLabels: []string{"b"},
50
-
selectLabels: []string{"a", "c"},
51
-
want: false,
76
+
name: "the pull request has no labels but we want to match the a label",
77
+
prLabels: []string{},
78
+
ignoreLabels: []string{},
79
+
selectLabels: []string{"a"},
80
+
want: false,
81
+
caseSensitive: false,
52
82
},
53
83
{
54
-
prLabels: []string{},
55
-
ignoreLabels: []string{"b"},
56
-
selectLabels: []string{},
57
-
want: true,
84
+
name: "no label match criteria, so it matches",
85
+
prLabels: []string{},
86
+
ignoreLabels: []string{},
87
+
selectLabels: []string{},
88
+
want: true,
89
+
caseSensitive: false,
58
90
},
59
91
{
60
-
prLabels: []string{},
61
-
ignoreLabels: []string{},
62
-
selectLabels: []string{"a"},
63
-
want: false,
92
+
name: "with one matching label and no matching ignore labels so it matches",
93
+
prLabels: []string{"a"},
94
+
selectLabels: []string{"a"},
95
+
ignoreLabels: []string{"b"},
96
+
want: true,
97
+
caseSensitive: false,
64
98
},
65
99
{
66
-
prLabels: []string{},
67
-
ignoreLabels: []string{},
68
-
selectLabels: []string{},
69
-
want: true,
100
+
name: "the pr labels match the select and ignore labels so it doesn't match",
101
+
prLabels: []string{"a"},
102
+
selectLabels: []string{"a"},
103
+
ignoreLabels: []string{"a"},
104
+
want: false,
105
+
caseSensitive: false,
70
106
},
71
107
{
72
-
prLabels: []string{"a"},
73
-
selectLabels: []string{"a"},
74
-
ignoreLabels: []string{"b"},
75
-
want: true,
108
+
name: "the pr has one label but no defined ignore or select labels so it matches",
109
+
prLabels: []string{"a"},
110
+
selectLabels: []string{},
111
+
ignoreLabels: []string{},
112
+
want: true,
113
+
caseSensitive: false,
76
114
},
77
115
{
78
-
prLabels: []string{"a"},
79
-
selectLabels: []string{"a"},
80
-
ignoreLabels: []string{"a"},
81
-
want: false,
116
+
name: "the pr has one label and it is the select label so it matches",
117
+
prLabels: []string{"a"},
118
+
selectLabels: []string{"a"},
119
+
ignoreLabels: []string{},
120
+
want: true,
121
+
caseSensitive: false,
82
122
},
83
123
{
84
-
prLabels: []string{"a"},
85
-
selectLabels: []string{},
86
-
ignoreLabels: []string{},
87
-
want: true,
124
+
name: "the pr has labels and matching select labels but it matches an ignore label so it doesn't match",
125
+
prLabels: []string{"a", "b", "c"},
126
+
selectLabels: []string{"a", "b"},
127
+
ignoreLabels: []string{"c"},
128
+
want: false,
129
+
caseSensitive: false,
88
130
},
89
131
{
90
-
prLabels: []string{"a"},
91
-
selectLabels: []string{"a"},
92
-
ignoreLabels: []string{},
93
-
want: true,
132
+
name: "the pr has uppercase labels and we are using case insensitive labels so it matches",
0 commit comments