Merge "Fix dynamic layout with regex approval filters" into feature/zuulv3
diff --git a/tests/fixtures/config/in-repo/git/common-config/zuul.yaml b/tests/fixtures/config/in-repo/git/common-config/zuul.yaml
index d4ffad6..bfd6199 100644
--- a/tests/fixtures/config/in-repo/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/in-repo/git/common-config/zuul.yaml
@@ -52,6 +52,23 @@
Verified: 0
precedence: high
+# This pipeline is there to ensure that dynamic pipeline copy operations also
+# work with regex approval filters.
+- pipeline:
+ name: pipeline-with-regex
+ manager: independent
+ require:
+ gerrit:
+ approval:
+ - Code-Review: 2
+ username: maintainer
+ require:
+ github:
+ review:
+ - username: '^(herp|derp)$'
+ type: approved
+ trigger: {}
+
- job:
name: common-config-test
diff --git a/tests/unit/test_scheduler.py b/tests/unit/test_scheduler.py
index e52eea9..5dd3f4e 100755
--- a/tests/unit/test_scheduler.py
+++ b/tests/unit/test_scheduler.py
@@ -5293,6 +5293,7 @@
class TestSemaphoreInRepo(ZuulTestCase):
+ config_file = 'zuul-connections-gerrit-and-github.conf'
tenant_config_file = 'config/in-repo/main.yaml'
def test_semaphore_in_repo(self):
diff --git a/tests/unit/test_v3.py b/tests/unit/test_v3.py
index 7dcb4ae..aa091e5 100644
--- a/tests/unit/test_v3.py
+++ b/tests/unit/test_v3.py
@@ -70,6 +70,7 @@
class TestInRepoConfig(ZuulTestCase):
# A temporary class to hold new tests while others are disabled
+ config_file = 'zuul-connections-gerrit-and-github.conf'
tenant_config_file = 'config/in-repo/main.yaml'
def test_in_repo_config(self):
@@ -712,6 +713,7 @@
# sure we exercise that code, in this test we allow Zuul to create
# keys for the project on startup.
create_project_keys = True
+ config_file = 'zuul-connections-gerrit-and-github.conf'
tenant_config_file = 'config/in-repo/main.yaml'
def test_key_generation(self):
diff --git a/zuul/driver/gerrit/gerritmodel.py b/zuul/driver/gerrit/gerritmodel.py
index f35c3e7..7c1bb5a 100644
--- a/zuul/driver/gerrit/gerritmodel.py
+++ b/zuul/driver/gerrit/gerritmodel.py
@@ -61,9 +61,10 @@
class GerritApprovalFilter(object):
def __init__(self, required_approvals=[], reject_approvals=[]):
self._required_approvals = copy.deepcopy(required_approvals)
- self.required_approvals = self._tidy_approvals(required_approvals)
+ self.required_approvals = self._tidy_approvals(
+ self._required_approvals)
self._reject_approvals = copy.deepcopy(reject_approvals)
- self.reject_approvals = self._tidy_approvals(reject_approvals)
+ self.reject_approvals = self._tidy_approvals(self._reject_approvals)
def _tidy_approvals(self, approvals):
for a in approvals:
diff --git a/zuul/driver/github/githubmodel.py b/zuul/driver/github/githubmodel.py
index db119f0..ffd1c3f 100644
--- a/zuul/driver/github/githubmodel.py
+++ b/zuul/driver/github/githubmodel.py
@@ -68,8 +68,8 @@
reject_reviews=[]):
self._required_reviews = copy.deepcopy(required_reviews)
self._reject_reviews = copy.deepcopy(reject_reviews)
- self.required_reviews = self._tidy_reviews(required_reviews)
- self.reject_reviews = self._tidy_reviews(reject_reviews)
+ self.required_reviews = self._tidy_reviews(self._required_reviews)
+ self.reject_reviews = self._tidy_reviews(self._reject_reviews)
self.required_statuses = required_statuses
def _tidy_reviews(self, reviews):