Case sensitive label matching
After upgrading Gerrit to 2.13 our gate stopped working. The reason
for this is that after a successful gate run zuul does something like
'gerrit review --label verified=2 --submit'. The verified label in
Gerrit by default is configured as 'Verified'. The newer version of
gerrit behaves different now. It accepts the +2 vote on verified but
doesn't submit the patch anymore if the casing is not correct. This
forces us to specify the label in the same casing as gerrit
expects. In that case the tolower() in canMerge prevents the patch
from entering the gate.
In order to avoid confusion and be consistent, avoid any case
conversions and use the labels exactly as defined in Gerrit.
Note that this patch requires changes to the pipelines such that the
labels are spelled exactly as defined in Gerrit.
This is a backport of I9713a075e07b268e4f2620c0862c128158283c7c to
master.
Change-Id: I55e6f12969c1c920a5017382523e71e12bc7ac3c
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 @@
- event: patchset-created
success:
gerrit:
- verified: 1
+ Verified: 1
failure:
gerrit:
- verified: -1
+ Verified: -1
- name: gate
manager: DependentPipelineManager
@@ -18,17 +18,17 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
start:
gerrit:
- verified: 0
+ Verified: 0
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
gerrit:
- verified: -2
+ Verified: -2
- name: post
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 @@
- event: patchset-created
success:
gerrit:
- verified: 1
+ Verified: 1
failure:
gerrit:
- verified: -1
+ Verified: -1
- name: post
manager: IndependentPipelineManager
@@ -25,17 +25,17 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
gerrit:
- verified: -2
+ Verified: -2
start:
gerrit:
- verified: 0
+ Verified: 0
precedence: high
projects:
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 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
smtp:
to: success@example.org
failure:
gerrit:
- verified: -2
+ Verified: -2
smtp:
to: failure@example.org
start:
gerrit:
- verified: 0
+ Verified: 0
precedence: high
projects:
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 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
gerrit:
- verified: -2
+ Verified: -2
start:
gerrit:
- verified: 0
+ Verified: 0
precedence: high
jobs:
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 @@
- event: patchset-created
success:
gerrit:
- verified: 1
+ Verified: 1
failure:
gerrit:
- verified: -1
+ Verified: -1
- name: post
manager: IndependentPipelineManager
@@ -26,22 +26,22 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
gerrit:
- verified: -2
+ Verified: -2
merge-failure:
gerrit:
- verified: -1
+ Verified: -1
smtp:
to: you@example.com
start:
gerrit:
- verified: 0
+ Verified: 0
precedence: high
projects:
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 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
start:
gerrit:
- verified: 0
+ Verified: 0
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
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 @@
- event: patchset-created
success:
gerrit:
- verified: 1
+ Verified: 1
failure:
gerrit:
- verified: -1
+ Verified: -1
- name: post
manager: IndependentPipelineManager
@@ -25,17 +25,17 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
gerrit:
- verified: -2
+ Verified: -2
start:
gerrit:
- verified: 0
+ Verified: 0
precedence: high
projects:
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 @@
- event: patchset-created
success:
gerrit:
- verified: 1
+ Verified: 1
failure:
gerrit:
- verified: -1
+ Verified: -1
- name: post
manager: IndependentPipelineManager
@@ -25,17 +25,17 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
gerrit:
- verified: -2
+ Verified: -2
start:
gerrit:
- verified: 0
+ Verified: 0
precedence: high
jobs:
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 @@
source: gerrit
require:
approval:
- - verified: -1
+ - Verified: -1
trigger:
gerrit:
- event: patchset-created
@@ -13,10 +13,10 @@
pipeline: gate
success:
gerrit:
- verified: 1
+ Verified: 1
failure:
gerrit:
- verified: -1
+ Verified: -1
- name: gate
manager: DependentPipelineManager
@@ -24,25 +24,25 @@
source: gerrit
require:
approval:
- - verified: 1
+ - Verified: 1
trigger:
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
zuul:
- event: parent-change-enqueued
pipeline: gate
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
gerrit:
- verified: -2
+ Verified: -2
start:
gerrit:
- verified: 0
+ Verified: 0
precedence: high
projects:
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 @@
- event: patchset-created
success:
gerrit:
- verified: 1
+ Verified: 1
failure:
gerrit:
- verified: -1
+ Verified: -1
- name: gate
manager: DependentPipelineManager
@@ -20,17 +20,17 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
gerrit:
- verified: -2
+ Verified: -2
start:
gerrit:
- verified: 0
+ Verified: 0
precedence: high
- name: merge-check
@@ -42,7 +42,7 @@
- event: project-change-merged
merge-failure:
gerrit:
- verified: -1
+ Verified: -1
projects:
- 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 @@
- event: patchset-created
success:
gerrit:
- verified: 1
+ Verified: 1
failure:
gerrit:
- verified: -1
+ Verified: -1
- name: post
manager: IndependentPipelineManager
@@ -28,17 +28,17 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
gerrit:
- verified: -2
+ Verified: -2
start:
gerrit:
- verified: 0
+ Verified: 0
precedence: high
- name: unused
@@ -48,7 +48,7 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
- name: dup1
manager: IndependentPipelineManager
@@ -57,10 +57,10 @@
- event: change-restored
success:
gerrit:
- verified: 1
+ Verified: 1
failure:
gerrit:
- verified: -1
+ Verified: -1
- name: dup2
manager: IndependentPipelineManager
@@ -69,10 +69,10 @@
- event: change-restored
success:
gerrit:
- verified: 1
+ Verified: 1
failure:
gerrit:
- verified: -1
+ Verified: -1
- name: conflict
manager: DependentPipelineManager
@@ -81,17 +81,17 @@
gerrit:
- event: comment-added
approval:
- - approved: 1
+ - Approved: 1
success:
gerrit:
- verified: 2
+ Verified: 2
submit: true
failure:
gerrit:
- verified: -2
+ Verified: -2
start:
gerrit:
- verified: 0
+ Verified: 0
- name: experimental
manager: IndependentPipelineManager