ci: Add "evaluation" method.

* guix/ci.scm (evaluation): New procedure.
This commit is contained in:
Mathieu Othacehe 2020-12-07 15:38:16 +01:00
parent 9087af0323
commit 1d229a34b7
No known key found for this signature in database
GPG Key ID: 8354763531769CA6

View File

@ -50,6 +50,7 @@
%query-limit
queued-builds
latest-builds
evaluation
latest-evaluations
evaluations-for-commit))
@ -140,6 +141,13 @@ string such as \"x86_64-linux\"), restrict to builds for SYSTEM."
;; 'latestbuilds', but Cuirass does.
(map json->build (vector->list latest))))
(define (evaluation url evaluation)
"Return the given EVALUATION performed by the CI server at URL."
(let ((evaluation (json-fetch
(string-append url "/api/evaluation?id="
(number->string evaluation)))))
(json->evaluation evaluation)))
(define* (latest-evaluations url #:optional (limit %query-limit))
"Return the latest evaluations performed by the CI server at URL."
(map json->evaluation