In Opamdiff.compare, do not figure out unchanged packages.

In the View.compare_builds (/compare/..), do not display
"XX opam packages unchanged".

The reasoning is that the diff view concerns:
(a) opam packages
(b) environment variables
(c) system packages

And we're only interested in what changed in each category. The list of
unchanged opam packages is not really of interest, but adds quite some noise to
the page.
This commit is contained in:
Hannes Mehnert 2022-08-05 11:16:21 +02:00
parent 637afde869
commit f4da9ad666
2 changed files with 5 additions and 12 deletions

View file

@ -848,7 +848,7 @@ let compare_builds
~(build_right : Builder_db.Build.t)
~env_diff:(added_env, removed_env, changed_env)
~pkg_diff:(added_pkgs, removed_pkgs, changed_pkgs)
~opam_diff:(same, opam_diff, version_diff, left, right)
~opam_diff:(opam_diff, version_diff, left, right)
=
layout
~nav:(`Comparison ((job_left, build_left), (job_right, build_right)))
@ -902,10 +902,6 @@ let compare_builds
[txtf "%d opam packages with changes in their opam file"
(List.length opam_diff)]
];
H.li [
H.a ~a:H.[a_href "#opam-packages-unchanged"]
[txtf "%d opam packages unchanged" (OpamPackage.Set.cardinal same)]
];
H.li [
H.a ~a:H.[a_href "#env-added"]
[ txtf "%d environment variables added" (List.length added_env)]
@ -943,9 +939,6 @@ let compare_builds
H.h3 ~a:H.[a_id "opam-packages-opam-diff"]
[H.txt "Opam packages with changes in their opam file"]] @
opam_diffs opam_diff @ [
H.h3 ~a:H.[a_id "opam-packages-unchanged"]
[H.txt "Unchanged opam packages"];
H.code (packages same);
H.h3 ~a:H.[a_id "env-added"] [H.txt "Environment variables added"];
H.code (key_values added_env);
H.h3 ~a:H.[a_id "env-removed"] [H.txt "Environment variables removed"];

View file

@ -102,12 +102,12 @@ let compare left right =
l
in
let same_version = Set.inter packages_left packages_right in
let (same, opam_diff) =
Set.partition
let opam_diff =
Set.filter
(fun p ->
let find = OpamPackage.Name.Map.find p.name in
let opam_left = find left.overlays and opam_right = find right.overlays in
OpamFile.OPAM.effectively_equal opam_left opam_right)
not (OpamFile.OPAM.effectively_equal opam_left opam_right))
same_version
and version_diff =
List.filter_map (fun p1 ->
@ -126,4 +126,4 @@ let compare left right =
and right_pkgs = diff packages_right packages_left
in
let opam_diff = detailed_opam_diffs left right opam_diff in
(same, opam_diff, version_diff, left_pkgs, right_pkgs)
(opam_diff, version_diff, left_pkgs, right_pkgs)