[Top][All Lists]

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

[PATCH] http: Support fetching builds by derivation.

From: Christopher Baines
Subject: [PATCH] http: Support fetching builds by derivation.
Date: Sun, 29 Sep 2019 19:15:27 +0100

There's a one to one mapping of build id to derivation, so allow querying by
derivation file name as well. I'm looking at this as I'm interested in getting
build information in to the Guix Data Service.

* src/cuirass/http.scm (url-handler): Add new clause to match statement, to
return build information by derivation file name.
 src/cuirass/http.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 2da3637..3f37716 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -248,6 +248,13 @@ Hydra format."
        (if hydra-build
            (respond-json (object->json-string hydra-build))
            (respond-build-not-found build-id))))
+    (("build" "gnu" "store" derivation-file-name)
+     (let* ((full-derivation-file-name
+             (string-append "/gnu/store/" derivation-file-name))
+            (hydra-build (handle-build-request full-derivation-file-name)))
+       (if hydra-build
+           (respond-json (object->json-string hydra-build))
+           (respond-build-not-found full-derivation-file-name))))
     (("build" build-id "details")
      (let ((build (db-get-build (string->number build-id))))
        (if build

reply via email to

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