diff options
-rw-r--r-- | guix-data-service/web/query-parameters.scm | 14 | ||||
-rw-r--r-- | guix-data-service/web/repository/controller.scm | 1 | ||||
-rw-r--r-- | guix-data-service/web/revision/controller.scm | 7 | ||||
-rw-r--r-- | guix-data-service/web/revision/html.scm | 11 |
4 files changed, 33 insertions, 0 deletions
diff --git a/guix-data-service/web/query-parameters.scm b/guix-data-service/web/query-parameters.scm index 2212ef1..4572ff3 100644 --- a/guix-data-service/web/query-parameters.scm +++ b/guix-data-service/web/query-parameters.scm @@ -45,6 +45,7 @@ parse-result-limit parse-system parse-target + parse-derivation-build-status valid-targets->options)) @@ -235,6 +236,19 @@ "" target)) +(define (parse-derivation-build-status status) + (define options + '("none" "working" "failing" "unknown")) + + (if (member status options) + (if (string=? status "none") + #f + status) + (make-invalid-query-parameter + status + (string-append "unknown derivation build status: " + status)))) + (define (valid-targets->options targets) `(("(no target)" . "none") ,@(map (lambda (target) diff --git a/guix-data-service/web/repository/controller.scm b/guix-data-service/web/repository/controller.scm index 060b9fb..c38c387 100644 --- a/guix-data-service/web/repository/controller.scm +++ b/guix-data-service/web/repository/controller.scm @@ -276,6 +276,7 @@ (target ,parse-target #:multi-value) (maximum_builds ,parse-number) (minimum_builds ,parse-number) + (build_status ,parse-derivation-build-status) (field ,identity #:multi-value #:default ("system" "target" "builds")) (after_name ,identity) diff --git a/guix-data-service/web/revision/controller.scm b/guix-data-service/web/revision/controller.scm index 67369af..8dc75a8 100644 --- a/guix-data-service/web/revision/controller.scm +++ b/guix-data-service/web/revision/controller.scm @@ -203,6 +203,7 @@ (target ,parse-target #:multi-value) (maximum_builds ,parse-number) (minimum_builds ,parse-number) + (build_status ,parse-derivation-build-status) (field ,identity #:multi-value #:default ("system" "target" "builds")) (after_name ,identity) @@ -989,6 +990,9 @@ #:targets (assq-ref query-parameters 'target) #:maximum-builds (assq-ref query-parameters 'maximum_builds) #:minimum-builds (assq-ref query-parameters 'minimum_builds) + #:build-status (and=> (assq-ref query-parameters + 'build_status) + string->symbol) #:limit-results limit-results #:after-name (assq-ref query-parameters 'after_name) #:include-builds? (member "builds" fields)) @@ -999,6 +1003,9 @@ #:targets (assq-ref query-parameters 'target) #:maximum-builds (assq-ref query-parameters 'maximum_builds) #:minimum-builds (assq-ref query-parameters 'minimum_builds) + #:build-status (and=> (assq-ref query-parameters + 'build_status) + string->symbol) #:limit-results limit-results #:after-name (assq-ref query-parameters 'after_name) #:include-builds? (member "builds" fields)))))) diff --git a/guix-data-service/web/revision/html.scm b/guix-data-service/web/revision/html.scm index 0e7a389..58f1bb1 100644 --- a/guix-data-service/web/revision/html.scm +++ b/guix-data-service/web/revision/html.scm @@ -1502,6 +1502,12 @@ figure { #:key (path-base "/revision/") header-text header-link) + (define derivation-build-status-options + '(("" . "none") + ("Working" . "working") + ("Failing" . "failing") + ("Unknown" . "unknown"))) + (define field-options (map (lambda (field) @@ -1557,6 +1563,11 @@ figure { "Maximum builds" query-parameters #:help-text "Only show derivations with a maximum number of known builds.") ,(form-horizontal-control + "Build status" query-parameters + #:allow-selecting-multiple-options #f + #:options derivation-build-status-options + #:help-text "Only show derivations with this overall build status.") + ,(form-horizontal-control "Fields" query-parameters #:name "field" #:options field-options |