Add require-approval to Gerrit trigger
This feature allows Zuul to consider existing (or new) approval
votes associated with a change when determining whether an event
matches. For example, it can be used to require that a Verified
vote of a certain age be present before a change is enqueued in
a pipeline.
Change-Id: I81344713d71b345b08576334568b9c49c810c7e9
diff --git a/tests/fixtures/layouts/good_require_approvals.yaml b/tests/fixtures/layouts/good_require_approvals.yaml
new file mode 100644
index 0000000..b7993b0
--- /dev/null
+++ b/tests/fixtures/layouts/good_require_approvals.yaml
@@ -0,0 +1,36 @@
+includes:
+ - python-file: custom_functions.py
+
+pipelines:
+ - name: check
+ manager: IndependentPipelineManager
+ trigger:
+ gerrit:
+ - event: comment-added
+ require-approval:
+ - username: jenkins
+ older-than: 48h
+ - event: comment-added
+ require-approval:
+ - email-filter: jenkins@example.com
+ newer-than: 48h
+ - event: comment-added
+ require-approval:
+ - approved: 1
+ - event: comment-added
+ require-approval:
+ - approved: 1
+ username: jenkins
+ email-filter: jenkins@example.com
+ success:
+ gerrit:
+ verified: 1
+ failure:
+ gerrit:
+ verified: -1
+
+projects:
+ - name: org/project
+ merge-mode: cherry-pick
+ check:
+ - project-check