aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web/build-server
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-06-28 21:54:11 +0100
committerChristopher Baines <mail@cbaines.net>2020-07-01 09:35:29 +0100
commit919255033121c0aeab6c4c16d58359a07b3408b5 (patch)
tree652766b4fdba9f1bba89274fe6282fd6e3e63808 /guix-data-service/web/build-server
parent879021f21f464c1f06aaa3595cc59d6d643b0347 (diff)
downloaddata-service-919255033121c0aeab6c4c16d58359a07b3408b5.tar
data-service-919255033121c0aeab6c4c16d58359a07b3408b5.tar.gz
Implement more support for builds from the Guix Build Coordinator
Builds from the Guix Build Coordinator might not have timestamps, and the id from the build server is more important, as one build server can build the same derivation many times.
Diffstat (limited to 'guix-data-service/web/build-server')
-rw-r--r--guix-data-service/web/build-server/controller.scm23
-rw-r--r--guix-data-service/web/build-server/html.scm12
2 files changed, 23 insertions, 12 deletions
diff --git a/guix-data-service/web/build-server/controller.scm b/guix-data-service/web/build-server/controller.scm
index c9db9a0..c68ef7d 100644
--- a/guix-data-service/web/build-server/controller.scm
+++ b/guix-data-service/web/build-server/controller.scm
@@ -53,18 +53,25 @@
#f))))
(let* ((derivation-file-name
(assq-ref query-parameters 'derivation_file_name))
+ (build-server-build-id
+ (assq-ref query-parameters 'build_server_build_id))
(build
- (select-build-by-build-server-and-derivation-file-name
- conn
- build-server-id
- derivation-file-name)))
+ (if build-server-build-id
+ (select-build-by-build-server-and-build-server-build-id
+ conn
+ build-server-id
+ build-server-build-id)
+ (select-build-by-build-server-and-derivation-file-name
+ conn
+ build-server-id
+ derivation-file-name))))
(if build
(render-html
#:sxml
(view-build query-parameters
build
(if (string=?
- (assoc-ref (last (vector->list (second build)))
+ (assoc-ref (last (vector->list (third build)))
"status")
"failed-dependency")
(select-required-builds-that-failed
@@ -105,6 +112,9 @@
build-server-id
(map (lambda (item)
(assoc-ref item "derivation"))
+ items)
+ (map (lambda (item)
+ (assoc-ref item "build_id"))
items))))
(insert-build-statuses
conn
@@ -212,7 +222,8 @@
(let ((parsed-query-parameters
(parse-query-parameters
request
- `((derivation_file_name ,identity #:required)))))
+ `((derivation_file_name ,identity)
+ (build_server_build_id ,identity)))))
(render-build mime-types
conn
(string->number build-server-id)
diff --git a/guix-data-service/web/build-server/html.scm b/guix-data-service/web/build-server/html.scm
index 319ab79..0078e8e 100644
--- a/guix-data-service/web/build-server/html.scm
+++ b/guix-data-service/web/build-server/html.scm
@@ -27,9 +27,6 @@
(define (view-build query-parameters
build
required-failed-builds)
- (define derivation
- (assq-ref query-parameters 'derivation_file_name))
-
(layout
#:body
`(,(header)
@@ -43,13 +40,13 @@
(div
(@ (class "row"))
,@(match build
- ((url statuses)
+ ((url derivation-file-name statuses)
`((div
(@ (class "col-sm-6"))
(dl
(@ (class "dl-horizontal"))
(dt "Derivation")
- (dd ,(display-possible-store-item derivation))
+ (dd ,(display-possible-store-item derivation-file-name))
(dt "Build server URL")
(dd (a (@ (href ,url))
,url))))
@@ -65,7 +62,10 @@
(tbody
,@(map (lambda (status)
`(tr
- (td ,(assoc-ref status "timestamp"))
+ (td ,(let ((timestamp (assoc-ref status "timestamp")))
+ (if (eq? timestamp 'null)
+ "(unknown)"
+ timestamp)))
(td ,(build-status-span
(assoc-ref status "status")))))
(vector->list statuses)))))))))