diff options
author | Christopher Baines <mail@cbaines.net> | 2020-10-21 19:26:18 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-10-21 19:26:18 +0100 |
commit | efb26a616dd374d73e4fbcce4652eac04bae2c38 (patch) | |
tree | c16d1ab1f9a49cb499d2edd64158ef33dfdde06e | |
parent | 41a7f38f44c10878e536135cbfabd4e37ca4fb21 (diff) | |
download | data-service-efb26a616dd374d73e4fbcce4652eac04bae2c38.tar data-service-efb26a616dd374d73e4fbcce4652eac04bae2c38.tar.gz |
Add a view build link on the build page
-rw-r--r-- | guix-data-service/model/build.scm | 8 | ||||
-rw-r--r-- | guix-data-service/web/build-server/controller.scm | 3 | ||||
-rw-r--r-- | guix-data-service/web/build-server/html.scm | 13 |
3 files changed, 18 insertions, 6 deletions
diff --git a/guix-data-service/model/build.scm b/guix-data-service/model/build.scm index cd2eb54..8ec0af2 100644 --- a/guix-data-service/model/build.scm +++ b/guix-data-service/model/build.scm @@ -245,6 +245,7 @@ ORDER BY latest_build_status.timestamp DESC") (define query " SELECT build_servers.url, + builds.build_server_build_id, builds.derivation_file_name, ( SELECT JSON_AGG( @@ -273,8 +274,9 @@ GROUP BY builds.id, build_servers.url, builds.derivation_file_name") query (list (number->string build-server-id) build-server-build-id)) - (((build-server-url derivation-file-name statuses-json)) + (((build-server-url build-server-build-id derivation-file-name statuses-json)) (list build-server-url + build-server-build-id derivation-file-name (json-string->scm statuses-json))) (() @@ -285,6 +287,7 @@ GROUP BY builds.id, build_servers.url, builds.derivation_file_name") (define query " SELECT build_servers.url, + builds.build_server_build_id, builds.derivation_file_name, ( SELECT JSON_AGG( @@ -313,10 +316,11 @@ GROUP BY builds.id, build_servers.url, builds.derivation_file_name") query (list (number->string build-server-id) derivation-file-name)) - (((build-server-url derivation-file-name statuses-json)) + (((build-server-url build-server-build-id derivation-file-name statuses-json)) ;; Returning the derivation-file-name is for consistency with ;; select-build-by-build-server-and-build-server-build-id (list build-server-url + build-server-build-id derivation-file-name (json-string->scm statuses-json))) (() diff --git a/guix-data-service/web/build-server/controller.scm b/guix-data-service/web/build-server/controller.scm index 9c185c6..8587278 100644 --- a/guix-data-service/web/build-server/controller.scm +++ b/guix-data-service/web/build-server/controller.scm @@ -74,7 +74,8 @@ (view-build query-parameters build (match build - ((url derivation-file-name statuses) + ((build-server-url build-server-build-id + derivation-file-name statuses) (if (member (assoc-ref (last (vector->list statuses)) "status") diff --git a/guix-data-service/web/build-server/html.scm b/guix-data-service/web/build-server/html.scm index 0078e8e..f16a570 100644 --- a/guix-data-service/web/build-server/html.scm +++ b/guix-data-service/web/build-server/html.scm @@ -40,7 +40,8 @@ (div (@ (class "row")) ,@(match build - ((url derivation-file-name statuses) + ((build-server-url build-server-build-id + derivation-file-name statuses) `((div (@ (class "col-sm-6")) (dl @@ -48,8 +49,14 @@ (dt "Derivation") (dd ,(display-possible-store-item derivation-file-name)) (dt "Build server URL") - (dd (a (@ (href ,url)) - ,url)))) + (dd (a (@ (href ,build-server-url)) + ,build-server-url))) + (a (@ (style "display: inline-block; margin-top: 0.4em;") + (href ,(build-server-link-url + build-server-url + build-server-build-id + derivation-file-name))) + "View build on " ,build-server-url)) (div (@ (class "col-sm-6")) (h3 "Timeline") |