Views: Only rendering treemap for unikernels with '.debug' artifact

This commit is contained in:
rand00 2021-12-20 15:52:11 +01:00 committed by Reynir Björnsson
parent ade1ea3a38
commit 6658244a18

View file

@ -342,6 +342,12 @@ let job ~failed name platform readme builds =
p [ txt "Including failed builds " ; a ~a:[a_href "failed/"] [txt "here"] ; txt "." ] p [ txt "Including failed builds " ; a ~a:[a_href "failed/"] [txt "here"] ; txt "." ]
]) ])
let contains_debug_bin artifacts =
let check f =
Fpath.has_ext "debug" f.Builder_db.filepath
in
List.find_opt check artifacts |> CCOption.is_some
let job_build let job_build
name name
({ Builder_db.Build.uuid; start; finish; result; platform; _ } as build) ({ Builder_db.Build.uuid; start; finish; result; platform; _ } as build)
@ -350,6 +356,14 @@ let job_build
latest next previous latest next previous
= =
let delta = Ptime.diff finish start in let delta = Ptime.diff finish start in
let analysis_section = if not @@ contains_debug_bin artifacts then [] else [
h3 [txt "Analysis"];
p [
let src = Fmt.str "/job/%s/build/%a/treemap" name Uuidm.pp uuid in
let style = "width: 50em; height: 54.0em" in (*treemap tries to be square*)
iframe ~a:[ a_src src; a_title "Binary dissection"; a_style style ] [] ];
]
in
let body = let body =
h1 [txtf "Job %s" name] :: h1 [txtf "Job %s" name] ::
[ [
@ -357,11 +371,7 @@ let job_build
p [txtf "Built on platform %s" platform ]; p [txtf "Built on platform %s" platform ];
p [txtf "Build took %a." Ptime.Span.pp delta ]; p [txtf "Build took %a." Ptime.Span.pp delta ];
p [txtf "Execution result: %a." Builder.pp_execution_result result]; p [txtf "Execution result: %a." Builder.pp_execution_result result];
h3 [txt "Analysis"]; ] @ analysis_section @ [
p [
let src = Fmt.str "/job/%s/build/%a/treemap" name Uuidm.pp uuid in
let style = "width: 50em; height: 54.0em" in (*treemap tries to be square*)
iframe ~a:[ a_src src; a_title "Binary dissection"; a_style style ] [] ];
h3 [txt "Build info"]; h3 [txt "Build info"];
ul [ ul [
li [ a ~a:[Fmt.kstr a_href "/job/%s/build/%a/console" name Uuidm.pp uuid] li [ a ~a:[Fmt.kstr a_href "/job/%s/build/%a/console" name Uuidm.pp uuid]