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: Mon, 12 Jun 2023 17:29:44 -0400 (EDT)

branch: master
commit a46419fe42f629fa494aedacc23ad63766298e02
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jun 12 23:26:59 2023 +0200

    http: Add route for "/eval/latest?spec=...".
    
    * src/cuirass/http.scm (url-handler): Add route for
    "/eval/latest?spec=...".
---
 src/cuirass/http.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 2c5a5c1..c82105f 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -946,6 +946,15 @@ passed, only display JOBS targeting this SYSTEM."
                    `(((#:name . ,name)
                       (#:link . ,(string-append "/jobset/" name))))))))
 
+    (('GET "eval" "latest")
+     (let* ((params (request-parameters request))
+            (spec (assq-ref params 'spec))
+            (evaluation-id (and spec (db-get-latest-evaluation spec))))
+       (if evaluation-id
+           (redirect (string-append "/eval/"
+                                    (number->string evaluation-id)))
+           (respond-not-found "/eval/latest"))))
+
     (('GET "eval" id)
      (let* ((params (request-parameters request))
             (status (assq-ref params 'status))



reply via email to

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