formats/v1: propagate build pipeline status

When formatting the the result, switch the default to success,
but then properly propagate the status of the build pipeline.
This should ensure that if there are no pipeline results but
a failed build pipeline, the overall status will be 'failed'.
On the other hand, if no pipelines were built, including tree
or build, the overall status will be 'success'.
This commit is contained in:
Christian Kellner 2021-10-24 20:31:53 +00:00 committed by Tom Gundersen
parent 8770bdf10a
commit a2404c9ec9

View file

@ -201,11 +201,14 @@ def output(manifest: Manifest, res: Dict) -> Dict:
# result but still need to to recurse
current = res.get(pipeline.id, {})
retval = {
"success": current.get("success", False)
"success": current.get("success", True)
}
if pipeline.build:
build = manifest[pipeline.build]
retval["build"] = result_for_pipeline(build)
retval["success"] = retval["build"]["success"]
stages = current.get("stages")
if stages:
retval["stages"] = stages