diff options
author | Christopher Baines <mail@cbaines.net> | 2020-10-11 17:05:38 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-10-11 17:05:38 +0100 |
commit | d05a7397fb3b4fc18cd5fc992183252d6b154e8a (patch) | |
tree | 53a0d025772fa8e62739d01ab893df6d31ab3c44 | |
parent | efbbac50990daa29432440979e83a736b13a42bf (diff) | |
download | data-service-d05a7397fb3b4fc18cd5fc992183252d6b154e8a.tar data-service-d05a7397fb3b4fc18cd5fc992183252d6b154e8a.tar.gz |
Improve latest processed revision pages for reproducibility stuff
Support the package-derivation-outputs page, and switch the
package-reproducibility page across to use it.
-rw-r--r-- | guix-data-service/web/repository/controller.scm | 59 | ||||
-rw-r--r-- | guix-data-service/web/revision/controller.scm | 15 | ||||
-rw-r--r-- | guix-data-service/web/revision/html.scm | 13 |
3 files changed, 78 insertions, 9 deletions
diff --git a/guix-data-service/web/repository/controller.scm b/guix-data-service/web/repository/controller.scm index d72639d..8e8c1bb 100644 --- a/guix-data-service/web/repository/controller.scm +++ b/guix-data-service/web/repository/controller.scm @@ -292,6 +292,50 @@ (render-no-latest-revision mime-types repository-id branch-name)))) + (('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package-derivation-outputs") + (letpar& ((commit-hash + (with-thread-postgresql-connection + (lambda (conn) + (latest-processed-commit-for-branch conn + repository-id + branch-name))))) + (if commit-hash + (let ((parsed-query-parameters + (guard-against-mutually-exclusive-query-parameters + (parse-query-parameters + request + `((search_query ,identity) + (after_path ,identity) + (substitutes_available_from ,parse-number + #:multi-value) + (substitutes_not_available_from ,parse-number + #:multi-value) + (output_consistency ,identity + #:default "any") + (system ,parse-system #:default "x86_64-linux") + (target ,parse-target) + (limit_results ,parse-result-limit + #:no-default-when (all_results) + #:default 10) + (all_results ,parse-checkbox-value))) + '((limit_results all_results))))) + + (render-revision-package-derivation-outputs + mime-types + commit-hash + parsed-query-parameters + #:path-base path + #:header-text + `("Latest processed revision for branch " + (samp ,branch-name)) + #:header-link + (string-append + "/repository/" repository-id + "/branch/" branch-name + "/latest-processed-revision"))) + (render-no-latest-revision mime-types + repository-id + branch-name)))) (('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package-reproducibility") (letpar& ((commit-hash (with-thread-postgresql-connection @@ -300,9 +344,18 @@ repository-id branch-name))))) (if commit-hash - (render-revision-package-reproduciblity mime-types - commit-hash - #:path-base path) + (render-revision-package-reproduciblity + mime-types + commit-hash + #:path-base path + #:header-text + `("Latest processed revision for branch " + (samp ,branch-name)) + #:header-link + (string-append + "/repository/" repository-id + "/branch/" branch-name + "/latest-processed-revision")) (render-no-latest-revision mime-types repository-id branch-name)))) diff --git a/guix-data-service/web/revision/controller.scm b/guix-data-service/web/revision/controller.scm index f6fef86..a67c2df 100644 --- a/guix-data-service/web/revision/controller.scm +++ b/guix-data-service/web/revision/controller.scm @@ -58,6 +58,7 @@ render-revision-package-reproduciblity render-revision-package-substitute-availability render-revision-package-derivations + render-revision-package-derivation-outputs render-unknown-revision render-view-revision)) @@ -560,7 +561,14 @@ (define* (render-revision-package-reproduciblity mime-types commit-hash - #:key path-base) + #:key + (path-base "/revision/") + (header-text + `("Revision " + (samp ,commit-hash))) + (header-link + (string-append "/revision/" + commit-hash))) (letpar& ((output-consistency (with-thread-postgresql-connection (lambda (conn) @@ -575,7 +583,10 @@ (render-html #:sxml (view-revision-package-reproducibility commit-hash - output-consistency)))))) + output-consistency + #:path-base path-base + #:header-text header-text + #:header-link header-link)))))) (define (render-revision-news mime-types commit-hash diff --git a/guix-data-service/web/revision/html.scm b/guix-data-service/web/revision/html.scm index bb0e72c..571f6f6 100644 --- a/guix-data-service/web/revision/html.scm +++ b/guix-data-service/web/revision/html.scm @@ -1248,7 +1248,10 @@ figure { substitute-availability))))) (define* (view-revision-package-reproducibility revision-commit-hash - output-consistency) + output-consistency + #:key (path-base "/revision/") + header-text + header-link) (layout #:body `(,(header) @@ -1320,8 +1323,8 @@ figure { (div (@ (class "col-sm-12")) (h3 (a (@ (style "white-space: nowrap;") - (href ,(string-append "/revision/" revision-commit-hash))) - "Revision " (samp ,revision-commit-hash))) + (href ,header-link)) + ,@header-text)) (h1 "Package reproducibility"))) (div (@ (class "row")) @@ -1470,7 +1473,9 @@ figure { colour ";")))) (a (@ (href ,(string-append - "/revision/" revision-commit-hash + (string-join + (drop-right (string-split path-base #\/) 1) + "/") "/package-derivation-outputs?" "output_consistency=" key "&system=" system))) |