2020-12-02 13:33:15 +00:00
|
|
|
open Tyxml.Html
|
|
|
|
|
2021-02-15 11:56:14 +00:00
|
|
|
let pp_ptime = Ptime.pp_human ()
|
|
|
|
|
2021-10-18 12:44:19 +00:00
|
|
|
let txtf fmt = Fmt.kstr txt fmt
|
|
|
|
let a_titlef fmt = Fmt.kstr a_title fmt
|
2020-12-07 09:17:49 +00:00
|
|
|
|
2020-12-07 15:45:19 +00:00
|
|
|
let check_icon result =
|
|
|
|
match result with
|
|
|
|
| Builder.Exited 0 ->
|
|
|
|
span ~a:[
|
2020-12-07 20:34:10 +00:00
|
|
|
a_style "color: green; cursor: pointer;";
|
2020-12-07 15:45:19 +00:00
|
|
|
a_titlef "%a" Builder.pp_execution_result result;
|
|
|
|
]
|
2020-12-07 15:33:19 +00:00
|
|
|
[txt "☑"]
|
2020-12-07 15:45:19 +00:00
|
|
|
| _ ->
|
|
|
|
span ~a:[
|
2020-12-07 20:34:10 +00:00
|
|
|
a_style "color: red; cursor: pointer;";
|
2020-12-07 15:45:19 +00:00
|
|
|
a_titlef "%a" Builder.pp_execution_result result;
|
|
|
|
]
|
2020-12-07 15:33:19 +00:00
|
|
|
[txt "☒"]
|
|
|
|
|
2021-11-12 11:11:08 +00:00
|
|
|
type nav = [
|
|
|
|
| `Default
|
|
|
|
| `Job of string * string option
|
|
|
|
| `Build of string * Builder_db.Build.t
|
|
|
|
| `Comparison of (string * Builder_db.Build.t) * (string * Builder_db.Build.t)
|
|
|
|
]
|
|
|
|
|
|
|
|
let pp_platform = Fmt.(option ~none:(any "") (append (any "on ") string))
|
|
|
|
let pp_platform_query = Fmt.(option ~none:(any "") (append (any "?platform=") string))
|
|
|
|
|
|
|
|
let layout ?nav:(nav_=`Default) ~title:title_ body_ =
|
|
|
|
let breadcrumb =
|
|
|
|
let to_nav kvs =
|
|
|
|
nav [ ul (List.map (fun (desc, href) ->
|
|
|
|
li [a ~a:[a_href href] [desc]])
|
|
|
|
kvs) ]
|
|
|
|
in
|
|
|
|
match nav_ with
|
|
|
|
| `Default ->
|
|
|
|
to_nav [txt "Home", "/"]
|
|
|
|
| `Job (job_name, platform) ->
|
|
|
|
to_nav [txt "Home", "/"; txtf "Job %s" job_name, Fmt.str "/job/%s/" job_name ; txtf "%a" pp_platform platform, Fmt.str "/job/%s/%a" job_name pp_platform_query platform ]
|
|
|
|
| `Build (job_name, build) ->
|
|
|
|
to_nav [
|
|
|
|
txt "Home", "/";
|
|
|
|
txtf "Job %s" job_name, Fmt.str "/job/%s/" job_name;
|
|
|
|
txtf "%a" pp_platform (Some build.Builder_db.Build.platform), Fmt.str "/job/%s/%a" job_name pp_platform_query (Some build.Builder_db.Build.platform);
|
|
|
|
txtf "Build %a" pp_ptime build.Builder_db.Build.start,
|
|
|
|
Fmt.str "/job/%s/build/%a/" job_name Uuidm.pp build.Builder_db.Build.uuid;
|
|
|
|
]
|
|
|
|
| `Comparison ((job_left, build_left), (job_right, build_right)) ->
|
|
|
|
to_nav [
|
|
|
|
txt "Home", "/";
|
|
|
|
txtf "Comparison between %s@%a and %s@%a"
|
|
|
|
job_left pp_ptime build_left.Builder_db.Build.start
|
|
|
|
job_right pp_ptime build_right.Builder_db.Build.start,
|
2021-11-12 13:01:20 +00:00
|
|
|
Fmt.str "/compare/%a/%a/" Uuidm.pp build_left.uuid Uuidm.pp build_right.uuid;
|
2021-11-12 11:11:08 +00:00
|
|
|
]
|
|
|
|
in
|
2020-12-02 13:33:15 +00:00
|
|
|
html
|
|
|
|
(head (title (txt title_))
|
2020-12-07 16:22:32 +00:00
|
|
|
[style ~a:[a_mime_type "text/css"]
|
|
|
|
[
|
2020-12-09 12:45:09 +00:00
|
|
|
txt "body {\
|
|
|
|
margin: 40px auto;\
|
|
|
|
line-height: 1.6;\
|
|
|
|
color: #444;\
|
|
|
|
padding: 0 10px;\
|
|
|
|
}";
|
2021-11-12 11:11:08 +00:00
|
|
|
txt "nav ul {\
|
|
|
|
display: flex;\
|
|
|
|
list-style: none;\
|
|
|
|
}";
|
|
|
|
Tyxml.Html.Unsafe.data
|
|
|
|
"nav ul li::before {\
|
|
|
|
content: \"→\";\
|
|
|
|
}";
|
|
|
|
Tyxml.Html.Unsafe.data
|
|
|
|
"nav ul li:first-child::before {\
|
|
|
|
content: \"\";\
|
|
|
|
}";
|
|
|
|
txt "nav a {\
|
|
|
|
padding: .5em 1em;\
|
|
|
|
}";
|
2020-12-09 12:45:09 +00:00
|
|
|
txt "h1,h2,h3{line-height:1.2}";
|
2020-12-09 10:39:39 +00:00
|
|
|
txt ".output-ts {\
|
|
|
|
white-space: nowrap;\
|
|
|
|
cursor: pointer;\
|
|
|
|
user-select: none;\
|
|
|
|
}";
|
2020-12-09 12:45:09 +00:00
|
|
|
txt ".output-ts a {text-decoration: none;}";
|
|
|
|
txt ".output-ts a:hover {text-decoration: underline;}";
|
|
|
|
txt ".output-code {\
|
|
|
|
overflow: visible;\
|
|
|
|
white-space: pre;\
|
|
|
|
}";
|
2020-12-21 10:22:35 +00:00
|
|
|
txt ".toggleable {\
|
|
|
|
display: none;\
|
|
|
|
}";
|
|
|
|
txt ".toggleable-descr {\
|
|
|
|
cursor: pointer;\
|
|
|
|
text-decoration: underline;\
|
|
|
|
user-select: none;\
|
|
|
|
}";
|
|
|
|
txt ":checked + .toggleable {\
|
|
|
|
display: block;\
|
|
|
|
}";
|
2020-12-07 16:22:32 +00:00
|
|
|
]])
|
2021-11-12 11:11:08 +00:00
|
|
|
|
|
|
|
(body [
|
|
|
|
breadcrumb;
|
|
|
|
main body_
|
|
|
|
])
|
2020-12-02 13:33:15 +00:00
|
|
|
|
2020-12-21 10:22:35 +00:00
|
|
|
let toggleable ?(hidden=true) id description content =
|
|
|
|
let checked = if hidden then [] else [a_checked ()] in
|
|
|
|
div [
|
|
|
|
label
|
|
|
|
~a:[
|
|
|
|
a_label_for id;
|
|
|
|
a_class ["toggleable-descr"];
|
|
|
|
]
|
|
|
|
[txt description];
|
|
|
|
input
|
|
|
|
~a:(checked @ [
|
|
|
|
a_input_type `Checkbox;
|
|
|
|
a_id id;
|
|
|
|
a_style "display: none;";
|
|
|
|
]) ();
|
|
|
|
div
|
|
|
|
~a:[
|
|
|
|
a_class ["toggleable"]
|
|
|
|
]
|
|
|
|
content;
|
|
|
|
]
|
|
|
|
|
2021-02-25 14:18:43 +00:00
|
|
|
let artifact ?(basename=false) job_name build { Builder_db.filepath; localpath = _; sha256; size } =
|
|
|
|
[
|
2021-10-18 12:44:19 +00:00
|
|
|
a ~a:[a_href (Fmt.str "/job/%s/build/%a/f/%a"
|
2021-02-25 14:18:43 +00:00
|
|
|
job_name
|
2021-08-31 11:59:45 +00:00
|
|
|
Uuidm.pp build.Builder_db.Build.uuid
|
2021-02-25 14:18:43 +00:00
|
|
|
Fpath.pp filepath)]
|
|
|
|
[if basename
|
|
|
|
then txt (Fpath.basename filepath)
|
|
|
|
else txtf "%a" Fpath.pp filepath];
|
2021-02-26 09:00:37 +00:00
|
|
|
txt " ";
|
2021-02-25 14:18:43 +00:00
|
|
|
code [txtf "SHA256:%a" Hex.pp (Hex.of_cstruct sha256)];
|
2021-02-26 09:00:37 +00:00
|
|
|
txtf " (%a)" Fmt.byte_size size;
|
2021-02-25 14:18:43 +00:00
|
|
|
]
|
|
|
|
|
2020-12-21 10:22:35 +00:00
|
|
|
|
|
|
|
|
2021-06-29 14:59:08 +00:00
|
|
|
let builder section_job_map =
|
|
|
|
layout ~title:"Reproducible OPAM builds"
|
2021-06-30 11:38:02 +00:00
|
|
|
([ h1 [txt "Reproducible OPAM builds"];
|
2021-06-29 14:59:08 +00:00
|
|
|
p [ txt "This website offers binary MirageOS unikernels and supplementary OS packages." ];
|
2021-06-30 11:38:02 +00:00
|
|
|
p [ txt {|Following is a list of jobs that are built daily. A persistent link to the latest successful build is available as /job/*jobname*/build/latest/. All builds can be reproduced with |} ;
|
2021-06-29 14:59:08 +00:00
|
|
|
a ~a:[a_href "https://github.com/roburio/orb/"] [txt "orb"];
|
2021-06-30 11:38:02 +00:00
|
|
|
txt ". The builds are scheduled and executed by ";
|
|
|
|
a ~a:[a_href "https://github.com/roburio/builder/"] [txt "builder"];
|
|
|
|
txt ". The web interface is ";
|
|
|
|
a ~a:[a_href "https://git.robur.io/robur/builder-web/"] [txt "builder-web"];
|
|
|
|
txt ". Contact team@robur.coop if you have any questions or suggestions.";
|
2021-06-29 14:59:08 +00:00
|
|
|
];
|
|
|
|
form ~a:[a_action "/hash"; a_method `Get]
|
|
|
|
[
|
|
|
|
label [
|
|
|
|
txt "Search artifact by SHA256";
|
|
|
|
br ();
|
|
|
|
input ~a:[
|
|
|
|
a_input_type `Search;
|
|
|
|
a_id "sha256";
|
|
|
|
a_name "sha256";
|
|
|
|
] ();
|
|
|
|
];
|
|
|
|
input ~a:[
|
|
|
|
a_input_type `Submit;
|
|
|
|
a_value "Search";
|
|
|
|
] ();
|
|
|
|
];
|
|
|
|
] @
|
|
|
|
Utils.String_map.fold (fun section jobs acc ->
|
|
|
|
acc @ [
|
|
|
|
h2 [ txt section ];
|
2021-11-08 10:55:11 +00:00
|
|
|
ul (List.map (fun (job_name, synopsis, platform_builds) ->
|
2021-06-29 14:59:08 +00:00
|
|
|
li ([
|
2021-11-08 10:55:11 +00:00
|
|
|
a ~a:[a_href ("job/" ^ job_name ^ "/")] [txt job_name];
|
2021-06-29 14:59:08 +00:00
|
|
|
br ();
|
|
|
|
txt (Option.value ~default:"" synopsis);
|
2021-11-08 10:55:11 +00:00
|
|
|
br ()
|
|
|
|
] @
|
|
|
|
List.flatten
|
|
|
|
(List.map (fun (platform, latest_build, latest_artifact) ->
|
|
|
|
[
|
|
|
|
check_icon latest_build.Builder_db.Build.result;
|
|
|
|
txt " ";
|
2021-11-12 11:11:08 +00:00
|
|
|
a ~a:[Fmt.kstr a_href "job/%s/%a" job_name pp_platform_query (Some platform)][txt platform];
|
2021-11-08 10:55:11 +00:00
|
|
|
txt " ";
|
2021-11-12 11:11:08 +00:00
|
|
|
a ~a:[Fmt.kstr a_href "job/%s/build/%a/" job_name Uuidm.pp
|
|
|
|
latest_build.Builder_db.Build.uuid]
|
2021-11-08 10:55:11 +00:00
|
|
|
[txtf "%a" (Ptime.pp_human ()) latest_build.Builder_db.Build.start];
|
|
|
|
txt " ";
|
|
|
|
] @ (match latest_artifact with
|
|
|
|
| Some main_binary ->
|
|
|
|
artifact ~basename:true job_name latest_build main_binary
|
|
|
|
| None ->
|
|
|
|
[ txtf "Build failure: %a" Builder.pp_execution_result
|
|
|
|
latest_build.Builder_db.Build.result ]
|
|
|
|
) @ [ br () ])
|
|
|
|
platform_builds)
|
|
|
|
))
|
|
|
|
jobs)
|
|
|
|
])
|
2021-06-29 14:59:08 +00:00
|
|
|
section_job_map
|
|
|
|
[])
|
2020-12-07 09:17:49 +00:00
|
|
|
|
2021-11-12 11:11:08 +00:00
|
|
|
let job name platform readme builds =
|
|
|
|
layout ~nav:(`Job (name, platform)) ~title:(Fmt.str "Job %s %a" name pp_platform platform)
|
|
|
|
((h1 [txtf "Job %s %a" name pp_platform platform] ::
|
2021-06-30 12:47:30 +00:00
|
|
|
(match readme with
|
|
|
|
| None -> []
|
|
|
|
| Some data ->
|
|
|
|
[
|
|
|
|
h2 ~a:[a_id "readme"] [txt "README"];
|
|
|
|
a ~a:[a_href "#builds"] [txt "Skip to builds"];
|
|
|
|
Unsafe.data Omd.(to_html (of_string data))
|
|
|
|
])) @
|
|
|
|
[
|
|
|
|
h2 ~a:[a_id "builds"] [txt "Builds"];
|
|
|
|
a ~a:[a_href "#readme"] [txt "Back to readme"];
|
2021-01-28 11:17:06 +00:00
|
|
|
ul (List.map (fun (build, main_binary) ->
|
|
|
|
li ([
|
2021-11-08 10:55:11 +00:00
|
|
|
check_icon build.Builder_db.Build.result;
|
|
|
|
txtf " %s " build.platform;
|
2021-11-12 11:11:08 +00:00
|
|
|
a ~a:[Fmt.kstr a_href "build/%a/" Uuidm.pp build.Builder_db.Build.uuid]
|
2021-01-28 11:17:06 +00:00
|
|
|
[
|
2021-08-31 11:59:45 +00:00
|
|
|
txtf "%a" (Ptime.pp_human ()) build.Builder_db.Build.start;
|
2021-01-28 11:17:06 +00:00
|
|
|
];
|
|
|
|
txt " ";
|
|
|
|
] @ match main_binary with
|
|
|
|
| Some main_binary ->
|
2021-02-25 14:18:43 +00:00
|
|
|
artifact ~basename:true name build main_binary
|
2021-01-28 11:17:06 +00:00
|
|
|
| None ->
|
2021-11-08 10:55:11 +00:00
|
|
|
[ txtf "Build failure: %a" Builder.pp_execution_result
|
|
|
|
build.Builder_db.Build.result ]))
|
2021-01-08 12:47:17 +00:00
|
|
|
builds);
|
2020-12-07 09:17:49 +00:00
|
|
|
|
2021-06-30 12:47:30 +00:00
|
|
|
])
|
2020-12-07 09:17:49 +00:00
|
|
|
|
2021-01-08 12:47:17 +00:00
|
|
|
let job_build
|
|
|
|
name
|
2021-06-30 12:47:30 +00:00
|
|
|
readme
|
2021-11-12 11:11:08 +00:00
|
|
|
({ Builder_db.Build.uuid; start; finish; result; platform; _ } as build)
|
2021-01-08 12:47:17 +00:00
|
|
|
artifacts
|
2021-07-08 11:33:27 +00:00
|
|
|
same_input_same_output different_input_same_output same_input_different_output
|
2021-11-08 10:55:11 +00:00
|
|
|
latest_uuid next_uuid previous_uuid
|
2020-12-07 14:43:54 +00:00
|
|
|
=
|
2020-12-07 15:33:19 +00:00
|
|
|
let delta = Ptime.diff finish start in
|
2021-11-12 11:11:08 +00:00
|
|
|
layout ~nav:(`Build (name, build)) ~title:(Fmt.str "Job %s %a" name pp_ptime start)
|
2021-06-30 12:47:30 +00:00
|
|
|
((h1 [txtf "Job %s" name] ::
|
|
|
|
(match readme with
|
|
|
|
| None -> []
|
|
|
|
| Some data ->
|
|
|
|
[
|
|
|
|
h2 ~a:[a_id "readme"] [txt "README"];
|
|
|
|
a ~a:[a_href "#build"] [txt "Skip to build"];
|
|
|
|
Unsafe.data Omd.(to_html (of_string data))
|
|
|
|
])) @
|
|
|
|
[
|
|
|
|
h2 ~a:[a_id "build"] [txtf "Build %a" pp_ptime start];
|
|
|
|
a ~a:[a_href "#readme"] [txt "Back to readme"];
|
2021-11-05 11:02:30 +00:00
|
|
|
p [txtf "Built on platform %s" platform ];
|
2020-12-07 20:40:57 +00:00
|
|
|
p [txtf "Build took %a." Ptime.Span.pp delta ];
|
2021-11-08 10:55:11 +00:00
|
|
|
p [txtf "Execution result: %a." Builder.pp_execution_result result];
|
2021-09-09 16:06:08 +00:00
|
|
|
h3 [txt "Build info"];
|
|
|
|
ul [
|
|
|
|
li [ a ~a:[Fmt.kstr a_href "/job/%s/build/%a/console" name Uuidm.pp uuid]
|
|
|
|
[txt "Console output"];
|
|
|
|
];
|
|
|
|
li [ a ~a:[Fmt.kstr a_href "/job/%s/build/%a/script" name Uuidm.pp uuid]
|
|
|
|
[txt "Build script"];
|
|
|
|
]
|
|
|
|
];
|
2021-07-08 11:33:27 +00:00
|
|
|
h3 [txt "Build artifacts"];
|
2020-12-14 07:18:13 +00:00
|
|
|
dl (List.concat_map
|
2021-02-25 14:18:43 +00:00
|
|
|
(fun { Builder_db.filepath; localpath=_; sha256; size } ->
|
2021-01-06 10:48:24 +00:00
|
|
|
let (`Hex sha256_hex) = Hex.of_cstruct sha256 in
|
|
|
|
[
|
2020-12-21 10:22:35 +00:00
|
|
|
dt [a
|
2021-01-08 12:47:17 +00:00
|
|
|
~a:[Fmt.kstr a_href "f/%a" Fpath.pp filepath]
|
2021-02-25 14:18:43 +00:00
|
|
|
[code [txtf "%a" Fpath.pp filepath]]];
|
|
|
|
dd [
|
|
|
|
code [txt "SHA256:"; txt sha256_hex];
|
2021-02-25 14:27:45 +00:00
|
|
|
txtf " (%a)" Fmt.byte_size size;
|
2021-02-25 14:18:43 +00:00
|
|
|
];
|
2020-12-14 07:18:13 +00:00
|
|
|
])
|
2021-01-08 12:47:17 +00:00
|
|
|
artifacts);
|
2021-11-08 10:55:11 +00:00
|
|
|
h3 [ txtf "Reproduced by %d builds" (List.length (same_input_same_output @ different_input_same_output))] ;
|
|
|
|
ul
|
|
|
|
((List.map (fun { Builder_db.Build.start ; uuid ; platform ; _ } ->
|
|
|
|
li [
|
|
|
|
txtf "on %s, same input, " platform;
|
|
|
|
a ~a:[Fmt.kstr a_href "/job/%s/build/%a/" name Uuidm.pp uuid]
|
|
|
|
[txtf "%a" pp_ptime start]
|
|
|
|
])
|
|
|
|
same_input_same_output) @
|
2021-11-12 13:01:20 +00:00
|
|
|
List.map (fun { Builder_db.Build.start ; uuid = other_uuid ; platform ; _ } ->
|
2021-11-08 10:55:11 +00:00
|
|
|
li [
|
|
|
|
txtf "on %s, different input, " platform;
|
2021-11-12 13:01:20 +00:00
|
|
|
a ~a:[Fmt.kstr a_href "/compare/%a/%a/"
|
|
|
|
Uuidm.pp other_uuid Uuidm.pp uuid]
|
|
|
|
[txtf "%a" pp_ptime start]
|
2021-11-08 10:55:11 +00:00
|
|
|
])
|
|
|
|
different_input_same_output)
|
|
|
|
] @
|
|
|
|
(if same_input_different_output = [] then
|
|
|
|
[]
|
|
|
|
else
|
|
|
|
[ h3 [txt "Same input, different output (not reproducible!)"];
|
|
|
|
ul (
|
2021-11-12 13:01:20 +00:00
|
|
|
List.map (fun { Builder_db.Build.start ; uuid = other_uuid ; platform ; _ } ->
|
2021-11-08 10:55:11 +00:00
|
|
|
li [
|
|
|
|
txtf "on %s, " platform ;
|
2021-11-12 13:01:20 +00:00
|
|
|
a ~a:[Fmt.kstr a_href "/compare/%a/%a/" Uuidm.pp other_uuid Uuidm.pp uuid]
|
|
|
|
[txtf "%a" pp_ptime start]
|
2021-11-08 10:55:11 +00:00
|
|
|
])
|
|
|
|
same_input_different_output)
|
|
|
|
]) @
|
|
|
|
[ h3 [txt "Comparisons with other builds on the same platform"];
|
|
|
|
let opt_build (ctx, uu) =
|
|
|
|
match uu with
|
|
|
|
| Some uu when not (Uuidm.equal uuid uu) ->
|
2021-11-12 13:01:20 +00:00
|
|
|
[ li [ a ~a:[Fmt.kstr a_href "/compare/%a/%a/"
|
|
|
|
Uuidm.pp uu Uuidm.pp uuid]
|
2021-11-08 10:55:11 +00:00
|
|
|
[txtf "With %s build" ctx]]
|
|
|
|
]
|
|
|
|
| _ -> []
|
|
|
|
in
|
|
|
|
ul
|
|
|
|
(List.concat_map opt_build [ ("latest", latest_uuid) ; ("next", next_uuid) ; ("previous", previous_uuid) ])
|
2021-06-30 12:47:30 +00:00
|
|
|
])
|
2021-02-10 13:43:32 +00:00
|
|
|
|
2021-07-06 08:34:17 +00:00
|
|
|
let key_values xs =
|
|
|
|
List.concat_map (fun (k, v) -> [ txtf "%s %s" k v ; br () ]) xs
|
|
|
|
|
|
|
|
let key_value_changes xs =
|
|
|
|
List.concat_map (fun (k, v, v') -> [ txtf "%s %s->%s" k v v' ; br () ]) xs
|
|
|
|
|
2021-02-10 13:43:32 +00:00
|
|
|
let packages packages =
|
|
|
|
OpamPackage.Set.elements packages
|
|
|
|
|> List.concat_map (fun p -> [
|
|
|
|
txtf "%a" Opamdiff.pp_opampackage p;
|
|
|
|
br ();
|
|
|
|
])
|
|
|
|
|
|
|
|
let package_diffs diffs =
|
|
|
|
List.concat_map (fun pd -> [
|
|
|
|
txtf "%a" Opamdiff.pp_version_diff pd;
|
|
|
|
br ();
|
|
|
|
])
|
|
|
|
diffs
|
|
|
|
|
2021-07-06 08:34:17 +00:00
|
|
|
let opam_diffs diffs =
|
|
|
|
List.concat_map (fun pd ->
|
|
|
|
h4 [ txtf "%a" Opamdiff.pp_opam_diff pd ] ::
|
|
|
|
(match pd.Opamdiff.build with None -> [] | Some a ->
|
|
|
|
let l, r = Opamdiff.commands_to_strings a in
|
|
|
|
[
|
|
|
|
h5 [ txt "build instruction (without common prefix) modifications, old:" ] ;
|
|
|
|
code (List.concat_map (fun s -> [ txt s ; br () ]) l) ;
|
|
|
|
h5 [ txt "new" ] ;
|
|
|
|
code (List.concat_map (fun s -> [ txt s ; br () ]) r)
|
|
|
|
]) @
|
|
|
|
(match pd.Opamdiff.install with None -> [] | Some a ->
|
|
|
|
let l, r = Opamdiff.commands_to_strings a in
|
|
|
|
[
|
|
|
|
h5 [ txt "install instruction (without common prefix) modifications, old:" ] ;
|
|
|
|
code (List.concat_map (fun s -> [ txt s ; br () ]) l) ;
|
|
|
|
h5 [ txt "new" ] ;
|
|
|
|
code (List.concat_map (fun s -> [ txt s ; br () ]) r)
|
|
|
|
]) @
|
|
|
|
(match pd.Opamdiff.url with None -> [] | Some a ->
|
|
|
|
let l, r = Opamdiff.opt_url_to_string a in
|
|
|
|
[
|
|
|
|
h5 [ txt "URL" ] ;
|
|
|
|
txtf "old: %s" l;
|
|
|
|
br ();
|
|
|
|
txtf "new: %s" r
|
|
|
|
]) @
|
|
|
|
[ br () ])
|
|
|
|
diffs
|
|
|
|
|
2021-11-12 13:01:20 +00:00
|
|
|
let compare_builds job_left job_right
|
2021-02-15 10:48:10 +00:00
|
|
|
(build_left : Builder_db.Build.t) (build_right : Builder_db.Build.t)
|
2021-07-06 08:34:17 +00:00
|
|
|
(added_env, removed_env, changed_env)
|
|
|
|
(added_pkgs, removed_pkgs, changed_pkgs)
|
2021-02-15 10:48:10 +00:00
|
|
|
(same, opam_diff, version_diff, left, right) =
|
2021-11-12 11:11:08 +00:00
|
|
|
layout
|
|
|
|
~nav:(`Comparison ((job_left, build_left), (job_right, build_right)))
|
2021-11-12 13:01:20 +00:00
|
|
|
~title:(Fmt.str "Comparing builds %a and %a"
|
2021-11-12 11:11:08 +00:00
|
|
|
Uuidm.pp build_left.uuid Uuidm.pp build_right.uuid)
|
2021-07-06 08:34:17 +00:00
|
|
|
([
|
2021-11-12 13:01:20 +00:00
|
|
|
h1 [txt "Comparing builds"];
|
2021-02-10 13:43:32 +00:00
|
|
|
h2 [
|
2021-02-15 10:48:10 +00:00
|
|
|
txt "Builds ";
|
|
|
|
a ~a:[a_href
|
2021-10-18 12:44:19 +00:00
|
|
|
(Fmt.str "/job/%s/build/%a/"
|
2021-02-15 10:48:10 +00:00
|
|
|
job_left
|
|
|
|
Uuidm.pp build_left.uuid)]
|
2021-11-12 13:01:20 +00:00
|
|
|
[txtf "%s@%a %a" job_left pp_ptime build_left.start pp_platform (Some build_left.platform)];
|
2021-02-15 10:48:10 +00:00
|
|
|
txt " and ";
|
|
|
|
a ~a:[a_href
|
2021-10-18 12:44:19 +00:00
|
|
|
(Fmt.str "/job/%s/build/%a/"
|
2021-02-15 10:48:10 +00:00
|
|
|
job_right
|
|
|
|
Uuidm.pp build_right.uuid)]
|
2021-11-12 13:01:20 +00:00
|
|
|
[txtf "%s@%a %a" job_right pp_ptime build_right.start pp_platform (Some build_right.platform)];
|
2021-02-10 13:43:32 +00:00
|
|
|
];
|
2021-11-12 13:01:20 +00:00
|
|
|
h3 [ a ~a:[Fmt.kstr a_href "/compare/%a/%a/" Uuidm.pp build_right.uuid Uuidm.pp build_left.uuid]
|
|
|
|
[txt "Compare in reverse direction"]] ;
|
2021-02-10 13:43:32 +00:00
|
|
|
ul [
|
|
|
|
li [
|
2021-11-12 13:01:20 +00:00
|
|
|
a ~a:[a_href "#opam-packages-removed"]
|
|
|
|
[txtf "%d opam packages removed" (OpamPackage.Set.cardinal left)]
|
2021-02-10 13:43:32 +00:00
|
|
|
];
|
|
|
|
li [
|
2021-11-12 13:01:20 +00:00
|
|
|
a ~a:[a_href "#opam-packages-installed"]
|
|
|
|
[txtf "%d new opam packages installed" (OpamPackage.Set.cardinal right)]
|
2021-02-10 13:43:32 +00:00
|
|
|
];
|
|
|
|
li [
|
2021-11-12 13:01:20 +00:00
|
|
|
a ~a:[a_href "#opam-packages-version-diff"]
|
|
|
|
[txtf "%d opam packages with version changes" (List.length version_diff)]
|
2021-02-10 13:43:32 +00:00
|
|
|
];
|
2021-02-12 11:18:41 +00:00
|
|
|
li [
|
2021-11-12 13:01:20 +00:00
|
|
|
a ~a:[a_href "#opam-packages-opam-diff"]
|
|
|
|
[txtf "%d opam packages with changes in their opam file" (List.length opam_diff)]
|
2021-02-12 11:18:41 +00:00
|
|
|
];
|
2021-02-10 13:43:32 +00:00
|
|
|
li [
|
2021-11-12 13:01:20 +00:00
|
|
|
a ~a:[a_href "#opam-packages-unchanged"]
|
|
|
|
[txtf "%d opam packages unchanged" (OpamPackage.Set.cardinal same)]
|
2021-02-10 13:43:32 +00:00
|
|
|
];
|
2021-07-06 08:34:17 +00:00
|
|
|
li [
|
|
|
|
a ~a:[a_href "#env-added"]
|
|
|
|
[ txtf "%d environment variables added" (List.length added_env)]
|
|
|
|
];
|
|
|
|
li [
|
|
|
|
a ~a:[a_href "#env-removed"]
|
|
|
|
[ txtf "%d environment variables removed" (List.length removed_env)]
|
|
|
|
];
|
|
|
|
li [
|
|
|
|
a ~a:[a_href "#env-changed"]
|
|
|
|
[ txtf "%d environment variables changed" (List.length changed_env)]
|
|
|
|
];
|
|
|
|
li [
|
|
|
|
a ~a:[a_href "#pkgs-added"]
|
|
|
|
[ txtf "%d system packages added" (List.length added_pkgs)]
|
|
|
|
];
|
|
|
|
li [
|
|
|
|
a ~a:[a_href "#pkgs-removed"]
|
|
|
|
[ txtf "%d system packages removed" (List.length removed_pkgs)]
|
|
|
|
];
|
|
|
|
li [
|
|
|
|
a ~a:[a_href "#pkgs-changed"]
|
|
|
|
[ txtf "%d system packages changed" (List.length changed_pkgs)]
|
|
|
|
];
|
2021-02-10 13:43:32 +00:00
|
|
|
];
|
2021-11-12 13:01:20 +00:00
|
|
|
h3 ~a:[a_id "opam-packages-removed"]
|
|
|
|
[txt "Opam packages removed"];
|
2021-02-10 13:43:32 +00:00
|
|
|
code (packages left);
|
2021-11-12 13:01:20 +00:00
|
|
|
h3 ~a:[a_id "opam-packages-installed"]
|
|
|
|
[txt "New opam packages installed"];
|
2021-02-10 13:43:32 +00:00
|
|
|
code (packages right);
|
2021-11-12 13:01:20 +00:00
|
|
|
h3 ~a:[a_id "opam-packages-version-diff"]
|
|
|
|
[txt "Opam packages with version changes"];
|
2021-02-10 13:43:32 +00:00
|
|
|
code (package_diffs version_diff);
|
2021-11-12 13:01:20 +00:00
|
|
|
h3 ~a:[a_id "opam-packages-opam-diff"]
|
|
|
|
[txt "Opam packages with changes in their opam file"]] @
|
2021-07-06 08:34:17 +00:00
|
|
|
opam_diffs opam_diff @ [
|
2021-11-12 13:01:20 +00:00
|
|
|
h3 ~a:[a_id "opam-packages-unchanged"]
|
|
|
|
[txt "Unchanged opam packages"];
|
2021-02-10 13:43:32 +00:00
|
|
|
code (packages same);
|
2021-07-06 08:34:17 +00:00
|
|
|
h3 ~a:[a_id "env-added"] [txt "Environment variables added"];
|
|
|
|
code (key_values added_env);
|
|
|
|
h3 ~a:[a_id "env-removed"] [txt "Environment variables removed"];
|
|
|
|
code (key_values removed_env);
|
|
|
|
h3 ~a:[a_id "env-changed"] [txt "Environment variables changed"];
|
|
|
|
code (key_value_changes changed_env);
|
|
|
|
h3 ~a:[a_id "pkgs-added"] [txt "System packages added"];
|
|
|
|
code (key_values added_pkgs);
|
|
|
|
h3 ~a:[a_id "pkgs-removed"] [txt "System packages removed"];
|
|
|
|
code (key_values removed_pkgs);
|
|
|
|
h3 ~a:[a_id "pkgs-changed"] [txt "System packages changed"];
|
|
|
|
code (key_value_changes changed_pkgs);
|
|
|
|
])
|