guix-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Ludovic Courtès
Date: Wed, 6 Sep 2023 17:46:34 -0400 (EDT)

branch: master
commit 647f13f0a9d9933689123a1bc1d3bfc1e596c38a
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Sep 6 23:39:56 2023 +0200

    http: /api/evaluations returns the full list of checkouts of each eval.
    
    Previously it would only return checkouts changed compared to the
    previous evaluation of that jobset.
    
    * src/cuirass/http.scm (evaluation->json-object): Use ‘latest-checkouts’
    instead of ‘evaluation-checkouts’.
    * tests/http.scm (evaluations-query-result): Adjust accordingly.
---
 src/cuirass/http.scm | 8 +++++++-
 tests/http.scm       | 5 ++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index fd678dd..5439e24 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -147,7 +147,13 @@
                 `((commit . ,(checkout-commit checkout))
                   (channel . ,(checkout-channel checkout))
                   (directory . ,(checkout-directory checkout))))
-              (evaluation-checkouts evaluation))))))
+
+              ;; Get the complete lists of checkouts, not just those that are
+              ;; different from the previous evaluation.
+              (let* ((name (evaluation-specification-name evaluation))
+                     (id (evaluation-id evaluation))
+                     (spec (db-get-specification name)))
+                (latest-checkouts spec id)))))))
 
 (define (specification->json-object spec)
   "Turn SPEC into a representation suitable for 'json->scm'."
diff --git a/tests/http.scm b/tests/http.scm
index fdb0f8a..f938f68 100644
--- a/tests/http.scm
+++ b/tests/http.scm
@@ -80,7 +80,10 @@
      (evaltime . 0)
      (checkouts . #(((commit . "fakesha2")
                      (channel . "guix")
-                     (directory . "dir3")))))))
+                     (directory . "dir3"))
+                    ((commit . "fakesha3")
+                     (channel . "packages")
+                     (directory . "dir2")))))))
 
 (test-group-with-cleanup "http"
   (test-assert "db-init"



reply via email to

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