Ensure the known and unknown keys appear

This commit is contained in:
Christopher Baines 2023-05-09 13:45:36 +01:00
parent c50f6aeb34
commit bbacbcd2aa

View file

@ -290,16 +290,26 @@ ORDER BY build_server_id DESC, system, target, build_server_id, substitute_known
(match-lambda
((build-server-id . rest)
(cons build-server-id
(group-to-alist
(match-lambda
((system target substitute-known? count)
(cons `((system . ,system)
(target . ,target))
(cons (if substitute-known?
'known
'unknown)
count))))
rest))))
(map
(lambda (details)
;; Ensure the known and unknown keys appear
`(,@details
,@(if (assq-ref details 'known)
'()
'((known . 0)))
,@(if (assq-ref details 'unknown)
'()
'((known . 0)))))
(group-to-alist
(match-lambda
((system target substitute-known? count)
(cons `((system . ,system)
(target . ,target))
(cons (if substitute-known?
'known
'unknown)
count))))
rest)))))
(group-to-alist
;; Group by build-server-id
identity