Commit Graph

2 Commits

Author SHA1 Message Date
James E. Blair e5824080d8 Switch artifact return back to list
This is a partial revert of f12453f6cb.

The use case that change was designed to address is poorly served by
that change.  The intent was to make it easier to return multiple
artifacts in multiple playbooks independently by relying on the dictionary
merge behavior of zuul_return.  However, in the entirely likely case
of artifacts with generated names, it becomes difficult because Ansible
does not run jinja on dictionary keys.

Therefore, revert to the previous list behavior.  A subsequent change
will add a feature to zuul_return to address the underlying issue of
returning multiple artifacts from different playbooks.

Change-Id: I0581aa68fcef320ab27c11ddd6338a15eef38ceb
2019-02-19 11:20:25 -08:00
James E. Blair f12453f6cb Return artifacts as dicts and add metadata
A recent attempt to use the artifact return feature of zuul_return
exposed some rough edges.  These two changes should make it much
easier to use.

First, return artifacts as a dictionary instead of a list.  This
requires that they have unique names (which is no bad thing -- what
would two artifacts named "docs" mean anyway?).  But mainly it allows
the dict merging behavior of zuul_return to be used, so that one
playbook may use zuul_return with some artifacts, and another playbook
may do the same, without either needing to load in the values of
the other first (assuming, of course, that they use different artifact
names).

Second, add a metadata field.  In the database and API, this is JSON
serialized, but in zuul_return and zuul.artifacts, it is exploded into
separate fields.  This lets jobs do things like associate versions or
tags with artifacts without having to abuse the url field.

Change-Id: I228687c1bd1c74ebc33b088ffd43f30c7309990d
2019-02-08 10:19:23 -08:00