Change the language around reproducibility/matching outputs

It's more accurate to describe the specifics of the relevant data here through
terms like "matching" and "not matching", as a statement that something built
reproducibility needs to be made alongside the test conditions. So just say
that build outputs matched, or didn't match, as this is more descriptive of
the data available.
This commit is contained in:
Christopher Baines 2019-12-27 14:05:12 +00:00
parent 6c1adfa9e6
commit f56935a8a6
4 changed files with 46 additions and 46 deletions

View file

@ -325,7 +325,7 @@ ORDER BY derivations.file_name
(define* (select-derivation-outputs-in-revision conn (define* (select-derivation-outputs-in-revision conn
commit-hash commit-hash
#:key #:key
reproducibility-status output-consistency
system system
target target
limit-results limit-results
@ -387,9 +387,9 @@ WHERE guix_revisions.commit = $1
criteria criteria
(iota (length criteria) 2)))) (iota (length criteria) 2))))
(cond (cond
((string=? reproducibility-status "any") ((string=? output-consistency "any")
"") "")
((string=? reproducibility-status "fixed-output") ((string=? output-consistency "fixed-output")
" AND derivation_output_details.hash IS NOT NULL") " AND derivation_output_details.hash IS NOT NULL")
(else (else
(string-append (string-append
@ -397,15 +397,15 @@ WHERE guix_revisions.commit = $1
SELECT SELECT
" "
(cond (cond
((string=? reproducibility-status "unknown") ((string=? output-consistency "unknown")
"COUNT(DISTINCT narinfo_fetch_records.build_server_id) <= 1") "COUNT(DISTINCT narinfo_fetch_records.build_server_id) <= 1")
((string=? reproducibility-status "reproducible") ((string=? output-consistency "matching")
" "
CASE CASE
WHEN (COUNT(DISTINCT narinfo_fetch_records.build_server_id) <= 1) THEN NULL WHEN (COUNT(DISTINCT narinfo_fetch_records.build_server_id) <= 1) THEN NULL
ELSE (COUNT(DISTINCT nars.hash) = 1) ELSE (COUNT(DISTINCT nars.hash) = 1)
END") END")
((string=? reproducibility-status "unreproducible") ((string=? output-consistency "not-matching")
" "
CASE CASE
WHEN (COUNT(DISTINCT narinfo_fetch_records.build_server_id) <= 1) THEN NULL WHEN (COUNT(DISTINCT narinfo_fetch_records.build_server_id) <= 1) THEN NULL

View file

@ -30,7 +30,7 @@
select-nars-for-output select-nars-for-output
select-signing-key select-signing-key
select-reproducibility-status-for-revision select-output-consistency-for-revision
record-narinfo-details-and-return-ids)) record-narinfo-details-and-return-ids))
@ -236,7 +236,7 @@ VALUES ($1, $2)")
(list (list (cons "jsonb" (list (list (cons "jsonb"
public-key-json-string))))))) public-key-json-string)))))))
(define (select-reproducibility-status-for-revision conn revision-commit) (define (select-output-consistency-for-revision conn revision-commit)
(define query (define query
" "
SELECT system, target, reproducible, COUNT(*) SELECT system, target, reproducible, COUNT(*)
@ -291,8 +291,8 @@ ORDER BY COUNT(*) DESC")
((system target status count) ((system target status count)
(list system (list system
(match status (match status
("t" 'reproducible) ("t" 'matching)
("f" 'unreproducible) ("f" 'not-matching)
("" 'unknown)) ("" 'unknown))
(string->number count)))) (string->number count))))
(exec-query conn query (list revision-commit))))) (exec-query conn query (list revision-commit)))))

View file

@ -198,8 +198,8 @@
(parse-query-parameters (parse-query-parameters
request request
`((after_path ,identity) `((after_path ,identity)
(reproducibility_status ,identity (output_consistency ,identity
#:default "any") #:default "any")
(system ,parse-system #:default "x86_64-linux") (system ,parse-system #:default "x86_64-linux")
(target ,parse-system #:default "x86_64-linux") (target ,parse-system #:default "x86_64-linux")
(limit_results ,parse-result-limit (limit_results ,parse-result-limit
@ -348,8 +348,8 @@
conn conn
commit-hash commit-hash
#:key path-base) #:key path-base)
(let ((reproducibility-status (let ((output-consistency
(select-reproducibility-status-for-revision conn commit-hash))) (select-output-consistency-for-revision conn commit-hash)))
(case (most-appropriate-mime-type (case (most-appropriate-mime-type
'(application/json text/html) '(application/json text/html)
mime-types) mime-types)
@ -360,7 +360,7 @@
(render-html (render-html
#:sxml (view-revision-package-reproducibility #:sxml (view-revision-package-reproducibility
commit-hash commit-hash
reproducibility-status output-consistency
#:header-text '("Package reproducibility status"))))))) #:header-text '("Package reproducibility status")))))))
(define (render-revision-news mime-types (define (render-revision-news mime-types
@ -710,8 +710,8 @@
(select-derivation-outputs-in-revision (select-derivation-outputs-in-revision
conn conn
commit-hash commit-hash
#:reproducibility-status #:output-consistency
(assq-ref query-parameters 'reproducibility_status) (assq-ref query-parameters 'output_consistency)
#:system (assq-ref query-parameters 'system) #:system (assq-ref query-parameters 'system)
#:target (assq-ref query-parameters 'target) #:target (assq-ref query-parameters 'target)
#:limit-results limit-results #:limit-results limit-results

View file

@ -647,7 +647,7 @@
'()))))) '())))))
(define* (view-revision-package-reproducibility revision-commit-hash (define* (view-revision-package-reproducibility revision-commit-hash
reproducibility-status output-consistency
#:key path-base #:key path-base
header-text header-link) header-text header-link)
(layout (layout
@ -729,18 +729,18 @@ figure {
;; https://medium.com/@heyoka/scratch-made-svg-donut-pie-charts-in-html5-2c587e935d72 ;; https://medium.com/@heyoka/scratch-made-svg-donut-pie-charts-in-html5-2c587e935d72
,@(map ,@(map
(match-lambda (match-lambda
((system . reproducibility-status) ((system . output-consistency)
(define total (define total
(apply + (map cdr reproducibility-status))) (apply + (map cdr output-consistency)))
(define keys (define keys
'(reproducible unreproducible unknown)) '(matching not-matching unknown))
(define reproducibility-status-percentages (define output-consistency-percentages
(map (lambda (key) (map (lambda (key)
(exact->inexact (exact->inexact
(* 100 (/ (or (assq-ref reproducibility-status key) (* 100 (/ (or (assq-ref output-consistency key)
0) 0)
total)))) total))))
keys)) keys))
@ -804,10 +804,10 @@ figure {
;; colour and count ;; colour and count
,(format #f "~2,2f%" ,(format #f "~2,2f%"
(or percentage 0))))) (or percentage 0)))))
'(reproducible unreproducible unknown) '(matching not-matching unknown)
'("Reproducible" "Unreproducible" "Unknown") '("Matching" "Not matching" "Unknown")
'("green" "red" "#d2d3d4") '("green" "red" "#d2d3d4")
reproducibility-status-percentages output-consistency-percentages
(cons 25 (cons 25
(map (lambda (cumalative-percentage) (map (lambda (cumalative-percentage)
(+ (- 100 (+ (- 100
@ -821,16 +821,16 @@ figure {
(cons (+ val (first result)) (cons (+ val (first result))
result)) result))
(list (list
(first reproducibility-status-percentages)) (first output-consistency-percentages))
(cdr reproducibility-status-percentages)))))) (cdr output-consistency-percentages))))))
(g (g
(@ (class "chart-text")) (@ (class "chart-text"))
,@(if (and (eq? (or (assq-ref reproducibility-status ,@(if (and (eq? (or (assq-ref output-consistency
'reproducible) 'matching)
0) 0)
0) 0)
(eq? (or (assq-ref reproducibility-status (eq? (or (assq-ref output-consistency
'unreproducible) 'not-matching)
0) 0)
0)) 0))
`((text `((text
@ -845,12 +845,12 @@ figure {
,(simple-format ,(simple-format
#f "~~~A%" #f "~~~A%"
(inexact->exact (inexact->exact
(round (car reproducibility-status-percentages))))) (round (car output-consistency-percentages)))))
(text (text
(@ (x "50%") (@ (x "50%")
(y "50%") (y "50%")
(class "chart-label")) (class "chart-label"))
"Reproducible")))))) "Matching"))))))
(figcaption (figcaption
(@ (class "figure-key")) (@ (class "figure-key"))
(p (@ (class "sr-only")) (p (@ (class "sr-only"))
@ -872,21 +872,21 @@ figure {
,(string-append ,(string-append
"/revision/" revision-commit-hash "/revision/" revision-commit-hash
"/derivation-outputs?" "/derivation-outputs?"
"reproducibility_status=" key "output_consistency=" key
"&system=" system "&system=" system
"&target=" system))) "&target=" system)))
,(format #f "~a (~d, ~2,2f%)" ,(format #f "~a (~d, ~2,2f%)"
label label
(or count 0) (or count 0)
(or percentage 0))))) (or percentage 0)))))
'("reproducible" "unreproducible" "unknown") '("matching" "not-matching" "unknown")
'("Reproducible" "Unreproducible" "Unknown") '("Matching" "Not matching" "Unknown")
(map (lambda (key) (map (lambda (key)
(assq-ref reproducibility-status key)) (assq-ref output-consistency key))
keys) keys)
reproducibility-status-percentages output-consistency-percentages
'("green" "red" "#d2d3d4")))))))) '("green" "red" "#d2d3d4"))))))))
reproducibility-status)))))) output-consistency))))))
(define* (view-revision-derivations commit-hash (define* (view-revision-derivations commit-hash
query-parameters query-parameters
@ -1050,13 +1050,13 @@ figure {
#:help-text #:help-text
"List packages where the derivation output path matches this query.") "List packages where the derivation output path matches this query.")
,(form-horizontal-control ,(form-horizontal-control
"Reproducibility status" query-parameters "Output consistency" query-parameters
#:allow-selecting-multiple-options #f #:allow-selecting-multiple-options #f
#:options '(("Any" . "any") #:options '(("Any" . "any")
("Fixed output" . "fixed-output") ("Fixed output" . "fixed-output")
("Unknown" . "unknown") ("Unknown" . "unknown")
("Reproducible" . "reproducible") ("Matching" . "matching")
("Unreproducible" . "unreproducible")) ("Not-matching" . "not-matching"))
#:help-text "Do the known hashes for this output suggest it's reproducible, or not reproducible.") #:help-text "Do the known hashes for this output suggest it's reproducible, or not reproducible.")
,(form-horizontal-control ,(form-horizontal-control
"System" query-parameters "System" query-parameters
@ -1098,7 +1098,7 @@ figure {
(tr (tr
(th (@ (class "col-sm-5")) "Path") (th (@ (class "col-sm-5")) "Path")
(th (@ (class "col-sm-5")) "Data") (th (@ (class "col-sm-5")) "Data")
(th (@ (class "col-sm-2")) "Reproducibility Status"))) (th (@ (class "col-sm-2")) "Output consistency")))
(tbody (tbody
,@(map ,@(map
(match-lambda (match-lambda
@ -1153,10 +1153,10 @@ figure {
"Unknown") "Unknown")
((eq? hash-count 1) ((eq? hash-count 1)
'(span (@ (class "text-success")) '(span (@ (class "text-success"))
"Reproducible")) "Matching"))
((> hash-count 1) ((> hash-count 1)
'(span (@ (class "text-danger")) '(span (@ (class "text-danger"))
"Unreproducible")))))))) "Not matching"))))))))
derivation-outputs))) derivation-outputs)))
,@(if show-next-page? ,@(if show-next-page?
`((div `((div