formats/v1: properly format failed results
When the build fails, not all pipelines might have been built and those pipelines will be missing from the results. Currently the code assumes that all pipelines will have a result and this will crash when trying to find an id for an pipeline that did not get built.
This commit is contained in:
parent
4455b953ae
commit
673ea0dfca
1 changed files with 8 additions and 2 deletions
|
|
@ -110,8 +110,14 @@ def output(manifest: Manifest, res: Dict) -> Dict:
|
|||
"""Convert a result into the v1 format"""
|
||||
|
||||
def result_for_pipeline(pipeline):
|
||||
current = res[pipeline.id]
|
||||
retval = {"success": current["success"]}
|
||||
# The pipeline might not have been built one of its
|
||||
# dependencies, i.e. its build pipeline, failed to
|
||||
# build. We thus need to be tolerant of a missing
|
||||
# result but still need to to recurse
|
||||
current = res.get(pipeline.id, {})
|
||||
retval = {
|
||||
"success": current.get("success", False)
|
||||
}
|
||||
if pipeline.build:
|
||||
build = manifest[pipeline.build]
|
||||
retval["build"] = result_for_pipeline(build)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue