Merge "Return artifact metadata in API endpoint"
This commit is contained in:
commit
d11be90c24
|
@ -9,6 +9,8 @@
|
||||||
artifacts:
|
artifacts:
|
||||||
- name: relative
|
- name: relative
|
||||||
url: relative/docs
|
url: relative/docs
|
||||||
|
metadata:
|
||||||
|
foo: bar
|
||||||
- name: Return artifact data
|
- name: Return artifact data
|
||||||
zuul_return:
|
zuul_return:
|
||||||
data:
|
data:
|
||||||
|
|
|
@ -749,7 +749,8 @@ class TestArtifacts(ZuulDBTestCase, BaseTestWeb, AnsibleZuulTestCase):
|
||||||
{'url': 'http://example.com/docs',
|
{'url': 'http://example.com/docs',
|
||||||
'name': 'docs'},
|
'name': 'docs'},
|
||||||
{'url': 'http://logs.example.com/build/relative/docs',
|
{'url': 'http://logs.example.com/build/relative/docs',
|
||||||
'name': 'relative'},
|
'name': 'relative',
|
||||||
|
'metadata': {'foo': 'bar'}},
|
||||||
{'url': 'http://example.com/tarball',
|
{'url': 'http://example.com/tarball',
|
||||||
'name': 'tarball'},
|
'name': 'tarball'},
|
||||||
])
|
])
|
||||||
|
|
|
@ -448,10 +448,13 @@ class ZuulWebAPI(object):
|
||||||
})
|
})
|
||||||
|
|
||||||
for artifact in build.artifacts:
|
for artifact in build.artifacts:
|
||||||
ret['artifacts'].append({
|
art = {
|
||||||
'name': artifact.name,
|
'name': artifact.name,
|
||||||
'url': artifact.url,
|
'url': artifact.url,
|
||||||
})
|
}
|
||||||
|
if artifact.meta:
|
||||||
|
art['metadata'] = json.loads(artifact.meta)
|
||||||
|
ret['artifacts'].append(art)
|
||||||
for provides in build.provides:
|
for provides in build.provides:
|
||||||
ret['provides'].append({
|
ret['provides'].append({
|
||||||
'name': provides.name,
|
'name': provides.name,
|
||||||
|
|
Loading…
Reference in New Issue