summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-09-27 15:33:35 +0000
committerGerrit Code Review <review@openstack.org>2017-09-27 15:33:35 +0000
commitb0482a6ab35a6cb34fb14125c4bc66f9b3b813ab (patch)
tree26051f1f4d8c0230835130c39d1a34387826cba3
parent5c2735946ab5cd9fbe10b76cda4dbd549b79b9d7 (diff)
parent01740bd14778cfc2632804522d4548fac57efff8 (diff)
Merge "Case sensitive label matching"2.6.0
-rw-r--r--NEWS.rst5
-rwxr-xr-xtests/base.py26
-rw-r--r--tests/fixtures/layout-cloner.yaml12
-rw-r--r--tests/fixtures/layout-delayed-repo-init.yaml12
-rw-r--r--tests/fixtures/layout-footer-message.yaml8
-rw-r--r--tests/fixtures/layout-live-reconfiguration-functions.yaml8
-rw-r--r--tests/fixtures/layout-merge-failure.yaml14
-rw-r--r--tests/fixtures/layout-rate-limit.yaml6
-rw-r--r--tests/fixtures/layout-repo-deleted.yaml12
-rw-r--r--tests/fixtures/layout-swift.yaml12
-rw-r--r--tests/fixtures/layout-zuultrigger-enqueued.yaml16
-rw-r--r--tests/fixtures/layout-zuultrigger-merged.yaml14
-rw-r--r--tests/fixtures/layout.yaml30
-rw-r--r--tests/test_connection.py4
-rw-r--r--zuul/model.py8
-rw-r--r--zuul/source/gerrit.py2
16 files changed, 105 insertions, 84 deletions
diff --git a/NEWS.rst b/NEWS.rst
index 5fef40a..28a6ec2 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -12,6 +12,11 @@ Since 2.0.0:
12 the Zuul server in smaller deployments. Several configuration 12 the Zuul server in smaller deployments. Several configuration
13 options have moved from the ``zuul`` section to ``merger``. 13 options have moved from the ``zuul`` section to ``merger``.
14 14
15* Gerrit label names must now be listed in your layout.yaml exactly as
16 they appear in Gerrit. This means case and special characters must
17 match. This change was made to accomodate Gerrit 2.13 which needs the
18 strings to match for changes to be successfully submitted.
19
15Since 1.3.0: 20Since 1.3.0:
16 21
17* The Jenkins launcher is replaced with Gearman launcher. An internal 22* The Jenkins launcher is replaced with Gearman launcher. An internal
diff --git a/tests/base.py b/tests/base.py
index 9dc412b..62f960b 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -103,9 +103,22 @@ class ChangeReference(git.Reference):
103 103
104 104
105class FakeChange(object): 105class FakeChange(object):
106 categories = {'APRV': ('Approved', -1, 1), 106 categories = {'Approved': ('Approved', -1, 1),
107 'CRVW': ('Code-Review', -2, 2), 107 'Code-Review': ('Code-Review', -2, 2),
108 'VRFY': ('Verified', -2, 2)} 108 'Verified': ('Verified', -2, 2)}
109
110 # TODO(tobiash): This is used as a translation layer between the tests
111 # which use lower case labels. This can be removed if all
112 # tests are converted to use the correct casing.
113 categories_translation = {'approved': 'Approved',
114 'code-review': 'Code-Review',
115 'verified': 'Verified',
116 'Approved': 'Approved',
117 'Code-Review': 'Code-Review',
118 'Verified': 'Verified',
119 'CRVW': 'Code-Review',
120 'APRV': 'Approved',
121 'VRFY': 'Verified'}
109 122
110 def __init__(self, gerrit, number, project, branch, subject, 123 def __init__(self, gerrit, number, project, branch, subject,
111 status='NEW', upstream_root=None): 124 status='NEW', upstream_root=None):
@@ -290,8 +303,8 @@ class FakeChange(object):
290 if not granted_on: 303 if not granted_on:
291 granted_on = time.time() 304 granted_on = time.time()
292 approval = { 305 approval = {
293 'description': self.categories[category][0], 306 'description': self.categories_translation[category],
294 'type': category, 307 'type': self.categories_translation[category],
295 'value': str(value), 308 'value': str(value),
296 'by': { 309 'by': {
297 'username': username, 310 'username': username,
@@ -300,7 +313,8 @@ class FakeChange(object):
300 'grantedOn': int(granted_on) 313 'grantedOn': int(granted_on)
301 } 314 }
302 for i, x in enumerate(self.patchsets[-1]['approvals'][:]): 315 for i, x in enumerate(self.patchsets[-1]['approvals'][:]):
303 if x['by']['username'] == username and x['type'] == category: 316 if x['by']['username'] == username and \
317 x['type'] == self.categories_translation[category]:
304 del self.patchsets[-1]['approvals'][i] 318 del self.patchsets[-1]['approvals'][i]
305 self.patchsets[-1]['approvals'].append(approval) 319 self.patchsets[-1]['approvals'].append(approval)
306 event = {'approvals': [approval], 320 event = {'approvals': [approval],
diff --git a/tests/fixtures/layout-cloner.yaml b/tests/fixtures/layout-cloner.yaml
index e8b5dde..0d51129 100644
--- a/tests/fixtures/layout-cloner.yaml
+++ b/tests/fixtures/layout-cloner.yaml
@@ -6,10 +6,10 @@ pipelines:
6 - event: patchset-created 6 - event: patchset-created
7 success: 7 success:
8 gerrit: 8 gerrit:
9 verified: 1 9 Verified: 1
10 failure: 10 failure:
11 gerrit: 11 gerrit:
12 verified: -1 12 Verified: -1
13 13
14 - name: gate 14 - name: gate
15 manager: DependentPipelineManager 15 manager: DependentPipelineManager
@@ -18,17 +18,17 @@ pipelines:
18 gerrit: 18 gerrit:
19 - event: comment-added 19 - event: comment-added
20 approval: 20 approval:
21 - approved: 1 21 - Approved: 1
22 start: 22 start:
23 gerrit: 23 gerrit:
24 verified: 0 24 Verified: 0
25 success: 25 success:
26 gerrit: 26 gerrit:
27 verified: 2 27 Verified: 2
28 submit: true 28 submit: true
29 failure: 29 failure:
30 gerrit: 30 gerrit:
31 verified: -2 31 Verified: -2
32 32
33 - name: post 33 - name: post
34 manager: IndependentPipelineManager 34 manager: IndependentPipelineManager
diff --git a/tests/fixtures/layout-delayed-repo-init.yaml b/tests/fixtures/layout-delayed-repo-init.yaml
index 6caf622..04dc010 100644
--- a/tests/fixtures/layout-delayed-repo-init.yaml
+++ b/tests/fixtures/layout-delayed-repo-init.yaml
@@ -6,10 +6,10 @@ pipelines:
6 - event: patchset-created 6 - event: patchset-created
7 success: 7 success:
8 gerrit: 8 gerrit:
9 verified: 1 9 Verified: 1
10 failure: 10 failure:
11 gerrit: 11 gerrit:
12 verified: -1 12 Verified: -1
13 13
14 - name: post 14 - name: post
15 manager: IndependentPipelineManager 15 manager: IndependentPipelineManager
@@ -25,17 +25,17 @@ pipelines:
25 gerrit: 25 gerrit:
26 - event: comment-added 26 - event: comment-added
27 approval: 27 approval:
28 - approved: 1 28 - Approved: 1
29 success: 29 success:
30 gerrit: 30 gerrit:
31 verified: 2 31 Verified: 2
32 submit: true 32 submit: true
33 failure: 33 failure:
34 gerrit: 34 gerrit:
35 verified: -2 35 Verified: -2
36 start: 36 start:
37 gerrit: 37 gerrit:
38 verified: 0 38 Verified: 0
39 precedence: high 39 precedence: high
40 40
41projects: 41projects:
diff --git a/tests/fixtures/layout-footer-message.yaml b/tests/fixtures/layout-footer-message.yaml
index 7977c19..fb7c95e 100644
--- a/tests/fixtures/layout-footer-message.yaml
+++ b/tests/fixtures/layout-footer-message.yaml
@@ -10,21 +10,21 @@ pipelines:
10 gerrit: 10 gerrit:
11 - event: comment-added 11 - event: comment-added
12 approval: 12 approval:
13 - approved: 1 13 - Approved: 1
14 success: 14 success:
15 gerrit: 15 gerrit:
16 verified: 2 16 Verified: 2
17 submit: true 17 submit: true
18 smtp: 18 smtp:
19 to: success@example.org 19 to: success@example.org
20 failure: 20 failure:
21 gerrit: 21 gerrit:
22 verified: -2 22 Verified: -2
23 smtp: 23 smtp:
24 to: failure@example.org 24 to: failure@example.org
25 start: 25 start:
26 gerrit: 26 gerrit:
27 verified: 0 27 Verified: 0
28 precedence: high 28 precedence: high
29 29
30projects: 30projects:
diff --git a/tests/fixtures/layout-live-reconfiguration-functions.yaml b/tests/fixtures/layout-live-reconfiguration-functions.yaml
index e261a88..695239f 100644
--- a/tests/fixtures/layout-live-reconfiguration-functions.yaml
+++ b/tests/fixtures/layout-live-reconfiguration-functions.yaml
@@ -9,17 +9,17 @@ pipelines:
9 gerrit: 9 gerrit:
10 - event: comment-added 10 - event: comment-added
11 approval: 11 approval:
12 - approved: 1 12 - Approved: 1
13 success: 13 success:
14 gerrit: 14 gerrit:
15 verified: 2 15 Verified: 2
16 submit: true 16 submit: true
17 failure: 17 failure:
18 gerrit: 18 gerrit:
19 verified: -2 19 Verified: -2
20 start: 20 start:
21 gerrit: 21 gerrit:
22 verified: 0 22 Verified: 0
23 precedence: high 23 precedence: high
24 24
25jobs: 25jobs:
diff --git a/tests/fixtures/layout-merge-failure.yaml b/tests/fixtures/layout-merge-failure.yaml
index 72bc9c9..9550466 100644
--- a/tests/fixtures/layout-merge-failure.yaml
+++ b/tests/fixtures/layout-merge-failure.yaml
@@ -6,10 +6,10 @@ pipelines:
6 - event: patchset-created 6 - event: patchset-created
7 success: 7 success:
8 gerrit: 8 gerrit:
9 verified: 1 9 Verified: 1
10 failure: 10 failure:
11 gerrit: 11 gerrit:
12 verified: -1 12 Verified: -1
13 13
14 - name: post 14 - name: post
15 manager: IndependentPipelineManager 15 manager: IndependentPipelineManager
@@ -26,22 +26,22 @@ pipelines:
26 gerrit: 26 gerrit:
27 - event: comment-added 27 - event: comment-added
28 approval: 28 approval:
29 - approved: 1 29 - Approved: 1
30 success: 30 success:
31 gerrit: 31 gerrit:
32 verified: 2 32 Verified: 2
33 submit: true 33 submit: true
34 failure: 34 failure:
35 gerrit: 35 gerrit:
36 verified: -2 36 Verified: -2
37 merge-failure: 37 merge-failure:
38 gerrit: 38 gerrit:
39 verified: -1 39 Verified: -1
40 smtp: 40 smtp:
41 to: you@example.com 41 to: you@example.com
42 start: 42 start:
43 gerrit: 43 gerrit:
44 verified: 0 44 Verified: 0
45 precedence: high 45 precedence: high
46 46
47projects: 47projects:
diff --git a/tests/fixtures/layout-rate-limit.yaml b/tests/fixtures/layout-rate-limit.yaml
index 9f6748c..48d3932 100644
--- a/tests/fixtures/layout-rate-limit.yaml
+++ b/tests/fixtures/layout-rate-limit.yaml
@@ -6,13 +6,13 @@ pipelines:
6 gerrit: 6 gerrit:
7 - event: comment-added 7 - event: comment-added
8 approval: 8 approval:
9 - approved: 1 9 - Approved: 1
10 start: 10 start:
11 gerrit: 11 gerrit:
12 verified: 0 12 Verified: 0
13 success: 13 success:
14 gerrit: 14 gerrit:
15 verified: 2 15 Verified: 2
16 submit: true 16 submit: true
17 failure: 17 failure:
18 gerrit: 18 gerrit:
diff --git a/tests/fixtures/layout-repo-deleted.yaml b/tests/fixtures/layout-repo-deleted.yaml
index 967009a..10168be 100644
--- a/tests/fixtures/layout-repo-deleted.yaml
+++ b/tests/fixtures/layout-repo-deleted.yaml
@@ -6,10 +6,10 @@ pipelines:
6 - event: patchset-created 6 - event: patchset-created
7 success: 7 success:
8 gerrit: 8 gerrit:
9 verified: 1 9 Verified: 1
10 failure: 10 failure:
11 gerrit: 11 gerrit:
12 verified: -1 12 Verified: -1
13 13
14 - name: post 14 - name: post
15 manager: IndependentPipelineManager 15 manager: IndependentPipelineManager
@@ -25,17 +25,17 @@ pipelines:
25 gerrit: 25 gerrit:
26 - event: comment-added 26 - event: comment-added
27 approval: 27 approval:
28 - approved: 1 28 - Approved: 1
29 success: 29 success:
30 gerrit: 30 gerrit:
31 verified: 2 31 Verified: 2
32 submit: true 32 submit: true
33 failure: 33 failure:
34 gerrit: 34 gerrit:
35 verified: -2 35 Verified: -2
36 start: 36 start:
37 gerrit: 37 gerrit:
38 verified: 0 38 Verified: 0
39 precedence: high 39 precedence: high
40 40
41projects: 41projects:
diff --git a/tests/fixtures/layout-swift.yaml b/tests/fixtures/layout-swift.yaml
index acaaad8..2af5b24 100644
--- a/tests/fixtures/layout-swift.yaml
+++ b/tests/fixtures/layout-swift.yaml
@@ -6,10 +6,10 @@ pipelines:
6 - event: patchset-created 6 - event: patchset-created
7 success: 7 success:
8 gerrit: 8 gerrit:
9 verified: 1 9 Verified: 1
10 failure: 10 failure:
11 gerrit: 11 gerrit:
12 verified: -1 12 Verified: -1
13 13
14 - name: post 14 - name: post
15 manager: IndependentPipelineManager 15 manager: IndependentPipelineManager
@@ -25,17 +25,17 @@ pipelines:
25 gerrit: 25 gerrit:
26 - event: comment-added 26 - event: comment-added
27 approval: 27 approval:
28 - approved: 1 28 - Approved: 1
29 success: 29 success:
30 gerrit: 30 gerrit:
31 verified: 2 31 Verified: 2
32 submit: true 32 submit: true
33 failure: 33 failure:
34 gerrit: 34 gerrit:
35 verified: -2 35 Verified: -2
36 start: 36 start:
37 gerrit: 37 gerrit:
38 verified: 0 38 Verified: 0
39 precedence: high 39 precedence: high
40 40
41jobs: 41jobs:
diff --git a/tests/fixtures/layout-zuultrigger-enqueued.yaml b/tests/fixtures/layout-zuultrigger-enqueued.yaml
index 8babd9e..e052ec9 100644
--- a/tests/fixtures/layout-zuultrigger-enqueued.yaml
+++ b/tests/fixtures/layout-zuultrigger-enqueued.yaml
@@ -4,7 +4,7 @@ pipelines:
4 source: gerrit 4 source: gerrit
5 require: 5 require:
6 approval: 6 approval:
7 - verified: -1 7 - Verified: -1
8 trigger: 8 trigger:
9 gerrit: 9 gerrit:
10 - event: patchset-created 10 - event: patchset-created
@@ -13,10 +13,10 @@ pipelines:
13 pipeline: gate 13 pipeline: gate
14 success: 14 success:
15 gerrit: 15 gerrit:
16 verified: 1 16 Verified: 1
17 failure: 17 failure:
18 gerrit: 18 gerrit:
19 verified: -1 19 Verified: -1
20 20
21 - name: gate 21 - name: gate
22 manager: DependentPipelineManager 22 manager: DependentPipelineManager
@@ -24,25 +24,25 @@ pipelines:
24 source: gerrit 24 source: gerrit
25 require: 25 require:
26 approval: 26 approval:
27 - verified: 1 27 - Verified: 1
28 trigger: 28 trigger:
29 gerrit: 29 gerrit:
30 - event: comment-added 30 - event: comment-added
31 approval: 31 approval:
32 - approved: 1 32 - Approved: 1
33 zuul: 33 zuul:
34 - event: parent-change-enqueued 34 - event: parent-change-enqueued
35 pipeline: gate 35 pipeline: gate
36 success: 36 success:
37 gerrit: 37 gerrit:
38 verified: 2 38 Verified: 2
39 submit: true 39 submit: true
40 failure: 40 failure:
41 gerrit: 41 gerrit:
42 verified: -2 42 Verified: -2
43 start: 43 start:
44 gerrit: 44 gerrit:
45 verified: 0 45 Verified: 0
46 precedence: high 46 precedence: high
47 47
48projects: 48projects:
diff --git a/tests/fixtures/layout-zuultrigger-merged.yaml b/tests/fixtures/layout-zuultrigger-merged.yaml
index bb06dde..90fa579 100644
--- a/tests/fixtures/layout-zuultrigger-merged.yaml
+++ b/tests/fixtures/layout-zuultrigger-merged.yaml
@@ -7,10 +7,10 @@ pipelines:
7 - event: patchset-created 7 - event: patchset-created
8 success: 8 success:
9 gerrit: 9 gerrit:
10 verified: 1 10 Verified: 1
11 failure: 11 failure:
12 gerrit: 12 gerrit:
13 verified: -1 13 Verified: -1
14 14
15 - name: gate 15 - name: gate
16 manager: DependentPipelineManager 16 manager: DependentPipelineManager
@@ -20,17 +20,17 @@ pipelines:
20 gerrit: 20 gerrit:
21 - event: comment-added 21 - event: comment-added
22 approval: 22 approval:
23 - approved: 1 23 - Approved: 1
24 success: 24 success:
25 gerrit: 25 gerrit:
26 verified: 2 26 Verified: 2
27 submit: true 27 submit: true
28 failure: 28 failure:
29 gerrit: 29 gerrit:
30 verified: -2 30 Verified: -2
31 start: 31 start:
32 gerrit: 32 gerrit:
33 verified: 0 33 Verified: 0
34 precedence: high 34 precedence: high
35 35
36 - name: merge-check 36 - name: merge-check
@@ -42,7 +42,7 @@ pipelines:
42 - event: project-change-merged 42 - event: project-change-merged
43 merge-failure: 43 merge-failure:
44 gerrit: 44 gerrit:
45 verified: -1 45 Verified: -1
46 46
47projects: 47projects:
48 - name: org/project 48 - name: org/project
diff --git a/tests/fixtures/layout.yaml b/tests/fixtures/layout.yaml
index 2e48ff1..ba9d09f 100644
--- a/tests/fixtures/layout.yaml
+++ b/tests/fixtures/layout.yaml
@@ -9,10 +9,10 @@ pipelines:
9 - event: patchset-created 9 - event: patchset-created
10 success: 10 success:
11 gerrit: 11 gerrit:
12 verified: 1 12 Verified: 1
13 failure: 13 failure:
14 gerrit: 14 gerrit:
15 verified: -1 15 Verified: -1
16 16
17 - name: post 17 - name: post
18 manager: IndependentPipelineManager 18 manager: IndependentPipelineManager
@@ -28,17 +28,17 @@ pipelines:
28 gerrit: 28 gerrit:
29 - event: comment-added 29 - event: comment-added
30 approval: 30 approval:
31 - approved: 1 31 - Approved: 1
32 success: 32 success:
33 gerrit: 33 gerrit:
34 verified: 2 34 Verified: 2
35 submit: true 35 submit: true
36 failure: 36 failure:
37 gerrit: 37 gerrit:
38 verified: -2 38 Verified: -2
39 start: 39 start:
40 gerrit: 40 gerrit:
41 verified: 0 41 Verified: 0
42 precedence: high 42 precedence: high
43 43
44 - name: unused 44 - name: unused
@@ -48,7 +48,7 @@ pipelines:
48 gerrit: 48 gerrit:
49 - event: comment-added 49 - event: comment-added
50 approval: 50 approval:
51 - approved: 1 51 - Approved: 1
52 52
53 - name: dup1 53 - name: dup1
54 manager: IndependentPipelineManager 54 manager: IndependentPipelineManager
@@ -57,10 +57,10 @@ pipelines:
57 - event: change-restored 57 - event: change-restored
58 success: 58 success:
59 gerrit: 59 gerrit:
60 verified: 1 60 Verified: 1
61 failure: 61 failure:
62 gerrit: 62 gerrit:
63 verified: -1 63 Verified: -1
64 64
65 - name: dup2 65 - name: dup2
66 manager: IndependentPipelineManager 66 manager: IndependentPipelineManager
@@ -69,10 +69,10 @@ pipelines:
69 - event: change-restored 69 - event: change-restored
70 success: 70 success:
71 gerrit: 71 gerrit:
72 verified: 1 72 Verified: 1
73 failure: 73 failure:
74 gerrit: 74 gerrit:
75 verified: -1 75 Verified: -1
76 76
77 - name: conflict 77 - name: conflict
78 manager: DependentPipelineManager 78 manager: DependentPipelineManager
@@ -81,17 +81,17 @@ pipelines:
81 gerrit: 81 gerrit:
82 - event: comment-added 82 - event: comment-added
83 approval: 83 approval:
84 - approved: 1 84 - Approved: 1
85 success: 85 success:
86 gerrit: 86 gerrit:
87 verified: 2 87 Verified: 2
88 submit: true 88 submit: true
89 failure: 89 failure:
90 gerrit: 90 gerrit:
91 verified: -2 91 Verified: -2
92 start: 92 start:
93 gerrit: 93 gerrit:
94 verified: 0 94 Verified: 0
95 95
96 - name: experimental 96 - name: experimental
97 manager: IndependentPipelineManager 97 manager: IndependentPipelineManager
diff --git a/tests/test_connection.py b/tests/test_connection.py
index f9f54f3..eb69b27 100644
--- a/tests/test_connection.py
+++ b/tests/test_connection.py
@@ -60,7 +60,7 @@ class TestConnections(ZuulDBTestCase):
60 self.waitUntilSettled() 60 self.waitUntilSettled()
61 61
62 self.assertEqual(len(A.patchsets[-1]['approvals']), 1) 62 self.assertEqual(len(A.patchsets[-1]['approvals']), 1)
63 self.assertEqual(A.patchsets[-1]['approvals'][0]['type'], 'VRFY') 63 self.assertEqual(A.patchsets[-1]['approvals'][0]['type'], 'Verified')
64 self.assertEqual(A.patchsets[-1]['approvals'][0]['value'], '1') 64 self.assertEqual(A.patchsets[-1]['approvals'][0]['value'], '1')
65 self.assertEqual(A.patchsets[-1]['approvals'][0]['by']['username'], 65 self.assertEqual(A.patchsets[-1]['approvals'][0]['by']['username'],
66 'jenkins') 66 'jenkins')
@@ -72,7 +72,7 @@ class TestConnections(ZuulDBTestCase):
72 self.waitUntilSettled() 72 self.waitUntilSettled()
73 73
74 self.assertEqual(len(B.patchsets[-1]['approvals']), 1) 74 self.assertEqual(len(B.patchsets[-1]['approvals']), 1)
75 self.assertEqual(B.patchsets[-1]['approvals'][0]['type'], 'VRFY') 75 self.assertEqual(B.patchsets[-1]['approvals'][0]['type'], 'Verified')
76 self.assertEqual(B.patchsets[-1]['approvals'][0]['value'], '-1') 76 self.assertEqual(B.patchsets[-1]['approvals'][0]['value'], '-1')
77 self.assertEqual(B.patchsets[-1]['approvals'][0]['by']['username'], 77 self.assertEqual(B.patchsets[-1]['approvals'][0]['by']['username'],
78 'civoter') 78 'civoter')
diff --git a/zuul/model.py b/zuul/model.py
index b24a06b..405a348 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -1123,7 +1123,8 @@ class BaseFilter(object):
1123 else: 1123 else:
1124 if not isinstance(v, list): 1124 if not isinstance(v, list):
1125 v = [v] 1125 v = [v]
1126 if (normalizeCategory(approval['description']) != k or 1126 if (normalizeCategory(approval['description']) !=
1127 normalizeCategory(k) or
1127 int(approval['value']) not in v): 1128 int(approval['value']) not in v):
1128 return False 1129 return False
1129 return True 1130 return True
@@ -1303,8 +1304,9 @@ class EventFilter(BaseFilter):
1303 for category, value in self.event_approvals.items(): 1304 for category, value in self.event_approvals.items():
1304 matches_approval = False 1305 matches_approval = False
1305 for eapproval in event.approvals: 1306 for eapproval in event.approvals:
1306 if (normalizeCategory(eapproval['description']) == category and 1307 if (normalizeCategory(eapproval['description']) ==
1307 int(eapproval['value']) == int(value)): 1308 normalizeCategory(category) and
1309 int(eapproval['value']) == int(value)):
1308 matches_approval = True 1310 matches_approval = True
1309 if not matches_approval: 1311 if not matches_approval:
1310 return False 1312 return False
diff --git a/zuul/source/gerrit.py b/zuul/source/gerrit.py
index fa49505..b4eba54 100644
--- a/zuul/source/gerrit.py
+++ b/zuul/source/gerrit.py
@@ -125,7 +125,7 @@ class GerritSource(BaseSource):
125 continue 125 continue
126 elif label['status'] in ['NEED', 'REJECT']: 126 elif label['status'] in ['NEED', 'REJECT']:
127 # It may be our own rejection, so we ignore 127 # It may be our own rejection, so we ignore
128 if label['label'].lower() not in allow_needs: 128 if label['label'] not in allow_needs:
129 return False 129 return False
130 continue 130 continue
131 else: 131 else: