guix: ci: Add spec support to latest-evaluations.

* guix/ci.scm (latest-evaluations): Add spec parameter support.
This commit is contained in:
Mathieu Othacehe 2021-05-26 14:54:43 +02:00
parent a2155f41f5
commit 316d9e0817
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -154,14 +154,21 @@ (define (evaluation url evaluation)
(number->string evaluation))))) (number->string evaluation)))))
(json->evaluation evaluation))) (json->evaluation evaluation)))
(define* (latest-evaluations url #:optional (limit %query-limit)) (define* (latest-evaluations url
"Return the latest evaluations performed by the CI server at URL." #:optional (limit %query-limit)
(map json->evaluation #:key spec)
(vector->list "Return the latest evaluations performed by the CI server at URL. If SPEC
(json->scm is passed, only consider the evaluations for the given SPEC specification."
(http-fetch (string-append url "/api/evaluations?nr=" (let ((spec (if spec
(number->string limit))))))) (format #f "&spec=~a" spec)
"")))
(map json->evaluation
(vector->list
(json->scm
(http-fetch
(string-append url "/api/evaluations?nr="
(number->string limit)
spec)))))))
(define* (evaluations-for-commit url commit #:optional (limit %query-limit)) (define* (evaluations-for-commit url commit #:optional (limit %query-limit))
"Return the evaluations among the latest LIMIT evaluations that have COMMIT "Return the evaluations among the latest LIMIT evaluations that have COMMIT