guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: guix-commits
Subject: 02/02: guix: ci: Add spec support to latest-evaluations.
Date: Wed, 26 May 2021 09:29:40 -0400 (EDT)

mothacehe pushed a commit to branch master
in repository guix.

commit 316d9e08172e6f665c6a30ed9044f0404d8ad60d
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Wed May 26 14:54:43 2021 +0200

    guix: ci: Add spec support to latest-evaluations.
    
    * guix/ci.scm (latest-evaluations): Add spec parameter support.
---
 guix/ci.scm | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/guix/ci.scm b/guix/ci.scm
index 44cf0c5..0af04ff 100644
--- a/guix/ci.scm
+++ b/guix/ci.scm
@@ -154,14 +154,21 @@ string such as \"x86_64-linux\"), restrict to builds for 
SYSTEM."
                                     (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
-       (vector->list
-        (json->scm
-         (http-fetch (string-append url "/api/evaluations?nr="
-                                    (number->string limit)))))))
-
+(define* (latest-evaluations url
+                             #:optional (limit %query-limit)
+                             #:key spec)
+  "Return the latest evaluations performed by the CI server at URL.  If SPEC
+is passed, only consider the evaluations for the given SPEC specification."
+  (let ((spec (if spec
+                  (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))
   "Return the evaluations among the latest LIMIT evaluations that have COMMIT



reply via email to

[Prev in Thread] Current Thread [Next in Thread]