aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web/build-server
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2022-07-08 13:48:08 +0100
committerChristopher Baines <mail@cbaines.net>2022-07-08 13:48:08 +0100
commit788571f53f7d4ec8b46a48f05dec73ec7d46453f (patch)
treea98a2d41b9cf081f6d4bc3e897cc7d75303031b4 /guix-data-service/web/build-server
parent6da5e8e67b4a5241243abbae812c4b9ba2bbb5cd (diff)
downloaddata-service-788571f53f7d4ec8b46a48f05dec73ec7d46453f.tar
data-service-788571f53f7d4ec8b46a48f05dec73ec7d46453f.tar.gz
Set builds derivation output details set id if information available
The build event information can now contain the derivation outputs, as well as the name of the derivation. This allows the Guix Data Service to join builds up with derivations, even if it doesn't know about the derivation being built.
Diffstat (limited to 'guix-data-service/web/build-server')
-rw-r--r--guix-data-service/web/build-server/controller.scm32
1 files changed, 24 insertions, 8 deletions
diff --git a/guix-data-service/web/build-server/controller.scm b/guix-data-service/web/build-server/controller.scm
index a91a1b0..73b105f 100644
--- a/guix-data-service/web/build-server/controller.scm
+++ b/guix-data-service/web/build-server/controller.scm
@@ -120,14 +120,30 @@
(define (handle-derivation-events conn items)
(unless (null? items)
(let ((build-ids
- (insert-builds conn
- build-server-id
- (map (lambda (item)
- (assoc-ref item "derivation"))
- items)
- (map (lambda (item)
- (assoc-ref item "build_id"))
- items))))
+ (insert-builds
+ conn
+ build-server-id
+ (map (lambda (item)
+ (assoc-ref item "derivation"))
+ items)
+ (map (lambda (item)
+ (and=>
+ (assoc-ref item "derivation_outputs")
+ (lambda (outputs)
+ (map
+ (lambda (output)
+ `((path . ,(assoc-ref output "output"))
+ (hash_algorithm
+ . ,(or (assoc-ref output "hash_algorithm")
+ NULL))
+ (hash . ,(or (assoc-ref output "hash")
+ NULL))
+ (recursive . ,(assoc-ref output "recursive"))))
+ (vector->list outputs)))))
+ items)
+ (map (lambda (item)
+ (assoc-ref item "build_id"))
+ items))))
(insert-build-statuses
conn
build-ids