From f7dbc0cb3ac572e4dabad88696550c4a19d0e1a5 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 17 Sep 2020 10:41:11 +0100 Subject: Better describe the default hooks --- guix-build-coordinator/hooks.scm | 9 +++++++++ scripts/guix-build-coordinator.in | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/guix-build-coordinator/hooks.scm b/guix-build-coordinator/hooks.scm index 629372f..c99f291 100644 --- a/guix-build-coordinator/hooks.scm +++ b/guix-build-coordinator/hooks.scm @@ -39,6 +39,8 @@ build-failure-retry-hook default-build-missing-inputs-hook + %default-hooks + build-submitted-send-event-to-guix-data-service-hook build-started-send-event-to-guix-data-service-hook build-success-send-event-to-guix-data-service-hook @@ -261,6 +263,13 @@ missing-input))))) missing-inputs)))) +(define %default-hooks + `((build-submitted . ,default-build-submitted-hook) + (build-started . ,default-build-started-hook) + (build-success . ,default-build-success-hook) + (build-failure . ,default-build-failure-hook) + (build-missing-inputs . ,default-build-missing-inputs-hook))) + (define (build-submitted-send-event-to-guix-data-service-hook target-url) (lambda (build-coordinator build-id) (define datastore diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in index 346f289..72182b1 100644 --- a/scripts/guix-build-coordinator.in +++ b/scripts/guix-build-coordinator.in @@ -186,12 +186,7 @@ ;; Alist of default option values `((agent-communication . ,%default-agent-uri) (client-communication . ,%default-client-uri) - (allocation-strategy . ,basic-build-allocation-strategy) - (build-submitted-hook . ,default-build-submitted-hook) - (build-started-hook . ,default-build-started-hook) - (build-success-hook . ,default-build-success-hook) - (build-failure-hook . ,default-build-failure-hook) - (build-missing-inputs-hook . ,default-build-missing-inputs-hook))) + (allocation-strategy . ,basic-build-allocation-strategy))) (define %agent-options (list (option '("uuid") #t #f @@ -412,9 +407,14 @@ processed?: ~A (build-success . ,(assq-ref opts 'build-success-hook)) (build-failure . ,(assq-ref opts 'build-failure-hook)) (build-missing-inputs . ,(assq-ref opts 'build-missing-inputs-hook)))) + (hooks-with-defaults + `(,@(filter identity hooks) + ,@(remove (match-lambda + ((name . _) (assq-ref hooks name))) + %default-hooks))) (build-coordinator (make-build-coordinator #:datastore datastore - #:hooks hooks + #:hooks hooks-with-defaults #:metrics-registry metrics-registry #:allocation-strategy (assq-ref opts 'allocation-strategy)))) -- cgit v1.2.3