http: Factorize ‘checkout->json-object’.
* src/cuirass/http.scm (checkout->json-object): New procedure. (evaluation->json-object): Use it.
This commit is contained in:
parent
0ebd0b632e
commit
d1486d71be
|
@ -138,6 +138,13 @@
|
||||||
(file-size . ,(build-product-file-size product))))
|
(file-size . ,(build-product-file-size product))))
|
||||||
(build-products build))))))
|
(build-products build))))))
|
||||||
|
|
||||||
|
(define (checkout->json-object checkout)
|
||||||
|
"Return an alist suitable for 'json->scm' representing CHECKOUT,
|
||||||
|
a <checkout> record."
|
||||||
|
`((commit . ,(checkout-commit checkout))
|
||||||
|
(channel . ,(checkout-channel checkout))
|
||||||
|
(directory . ,(checkout-directory checkout))))
|
||||||
|
|
||||||
(define (evaluation->json-object evaluation)
|
(define (evaluation->json-object evaluation)
|
||||||
"Turn EVALUATION into a representation suitable for 'json->scm'."
|
"Turn EVALUATION into a representation suitable for 'json->scm'."
|
||||||
`((id . ,(evaluation-id evaluation))
|
`((id . ,(evaluation-id evaluation))
|
||||||
|
@ -148,10 +155,7 @@
|
||||||
(evaltime . ,(evaluation-start-time evaluation))
|
(evaltime . ,(evaluation-start-time evaluation))
|
||||||
(checkouts
|
(checkouts
|
||||||
. ,(list->vector
|
. ,(list->vector
|
||||||
(map (lambda (checkout)
|
(map checkout->json-object
|
||||||
`((commit . ,(checkout-commit checkout))
|
|
||||||
(channel . ,(checkout-channel checkout))
|
|
||||||
(directory . ,(checkout-directory checkout))))
|
|
||||||
|
|
||||||
;; Get the complete lists of checkouts, not just those that are
|
;; Get the complete lists of checkouts, not just those that are
|
||||||
;; different from the previous evaluation.
|
;; different from the previous evaluation.
|
||||||
|
|
Loading…
Reference in New Issue