diff --git a/tests/fixtures/config/sql-driver/git/common-config/playbooks/project-test1.yaml b/tests/fixtures/config/sql-driver/git/common-config/playbooks/project-test1.yaml index 2afa939013..5049487333 100644 --- a/tests/fixtures/config/sql-driver/git/common-config/playbooks/project-test1.yaml +++ b/tests/fixtures/config/sql-driver/git/common-config/playbooks/project-test1.yaml @@ -9,6 +9,8 @@ artifacts: - name: relative url: relative/docs + metadata: + foo: bar - name: Return artifact data zuul_return: data: diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py index f1c9da177a..58c5640133 100755 --- a/tests/unit/test_web.py +++ b/tests/unit/test_web.py @@ -749,7 +749,8 @@ class TestArtifacts(ZuulDBTestCase, BaseTestWeb, AnsibleZuulTestCase): {'url': 'http://example.com/docs', 'name': 'docs'}, {'url': 'http://logs.example.com/build/relative/docs', - 'name': 'relative'}, + 'name': 'relative', + 'metadata': {'foo': 'bar'}}, {'url': 'http://example.com/tarball', 'name': 'tarball'}, ]) diff --git a/zuul/web/__init__.py b/zuul/web/__init__.py index b0b3f1aec2..8684e1c35e 100755 --- a/zuul/web/__init__.py +++ b/zuul/web/__init__.py @@ -448,10 +448,13 @@ class ZuulWebAPI(object): }) for artifact in build.artifacts: - ret['artifacts'].append({ + art = { 'name': artifact.name, 'url': artifact.url, - }) + } + if artifact.meta: + art['metadata'] = json.loads(artifact.meta) + ret['artifacts'].append(art) for provides in build.provides: ret['provides'].append({ 'name': provides.name,