From a2404c9ec95993364bbec68f29588f83040b44b4 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Sun, 24 Oct 2021 20:31:53 +0000 Subject: [PATCH] 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'. --- osbuild/formats/v1.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osbuild/formats/v1.py b/osbuild/formats/v1.py index 9849d025..b9b8522e 100644 --- a/osbuild/formats/v1.py +++ b/osbuild/formats/v1.py @@ -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