diff options
author | James E. Blair <jeblair@redhat.com> | 2020-05-20 13:13:36 -0700 |
---|---|---|
committer | James E. Blair <jeblair@redhat.com> | 2020-05-20 14:26:34 -0700 |
commit | 12961dd04a57ed3f8ee31abf0437cc5b292ab445 (patch) | |
tree | ba50da11e0ef254701d788d819f4fbaf683d4ff1 | |
parent | 5b3ee2d8b4e2fcf0f8bf9b50ac57292f3eed6703 (diff) | |
download | zuul-12961dd04a57ed3f8ee31abf0437cc5b292ab445.tar.gz |
Include extra, host, and group variables in job serialization
This serialization is used by the REST API as well as configuration
change detection. Including these variables allows API users to
see a more complete picture of the job as well as corrects a
malfunction in the job config change detection (a change to a job
with file matcher's host-vars, for example, would not trigger running
the job).
Change-Id: I27b5fd81fc0c90bd13ead6ecdef0a5d3dbcc2e57
-rw-r--r-- | tests/unit/test_web.py | 24 | ||||
-rw-r--r-- | zuul/model.py | 3 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py index af968b1bc..ad24ba073 100644 --- a/tests/unit/test_web.py +++ b/tests/unit/test_web.py @@ -365,6 +365,9 @@ class TestWeb(BaseTestWeb): 'tags': [], 'timeout': None, 'variables': {}, + 'extra_variables': {}, + 'group_variables': {}, + 'host_variables': {}, 'variant_description': '', 'voting': True }, { @@ -406,6 +409,9 @@ class TestWeb(BaseTestWeb): 'tags': [], 'timeout': None, 'variables': {}, + 'extra_variables': {}, + 'group_variables': {}, + 'host_variables': {}, 'variant_description': 'stable', 'voting': True }], data) @@ -445,6 +451,9 @@ class TestWeb(BaseTestWeb): 'tags': [], 'timeout': None, 'variables': {}, + 'extra_variables': {}, + 'group_variables': {}, + 'host_variables': {}, 'variant_description': '', 'voting': True }], data) @@ -563,6 +572,9 @@ class TestWeb(BaseTestWeb): 'tags': [], 'timeout': None, 'variables': {}, + 'extra_variables': {}, + 'group_variables': {}, + 'host_variables': {}, 'variant_description': '', 'voting': True}], [{'abstract': False, @@ -597,6 +609,9 @@ class TestWeb(BaseTestWeb): 'tags': [], 'timeout': None, 'variables': {}, + 'extra_variables': {}, + 'group_variables': {}, + 'host_variables': {}, 'variant_description': '', 'voting': True}], [{'abstract': False, @@ -631,6 +646,9 @@ class TestWeb(BaseTestWeb): 'tags': [], 'timeout': None, 'variables': {}, + 'extra_variables': {}, + 'group_variables': {}, + 'host_variables': {}, 'variant_description': '', 'voting': True}], [{'abstract': False, @@ -665,6 +683,9 @@ class TestWeb(BaseTestWeb): 'tags': [], 'timeout': None, 'variables': {}, + 'extra_variables': {}, + 'group_variables': {}, + 'host_variables': {}, 'variant_description': '', 'voting': True}]] @@ -718,6 +739,9 @@ class TestWeb(BaseTestWeb): 'tags': [], 'timeout': None, 'variables': {}, + 'extra_variables': {}, + 'group_variables': {}, + 'host_variables': {}, 'variant_description': '', 'voting': True} ]], diff --git a/zuul/model.py b/zuul/model.py index a1e3d3dc4..377b4ba40 100644 --- a/zuul/model.py +++ b/zuul/model.py @@ -1261,6 +1261,9 @@ class Job(ConfigObject): else: d['semaphore'] = None d['variables'] = self.variables + d['extra_variables'] = self.extra_variables + d['host_variables'] = self.host_variables + d['group_variables'] = self.group_variables d['final'] = self.final d['abstract'] = self.abstract d['protected'] = self.protected |