Filter builds on the revision builds page by revision
This commit is contained in:
parent
ff433dfce6
commit
e4a7f221c9
2 changed files with 25 additions and 5 deletions
|
|
@ -87,7 +87,8 @@ ORDER BY status"))
|
||||||
(list revision-commit)
|
(list revision-commit)
|
||||||
'()))))))
|
'()))))))
|
||||||
|
|
||||||
(define (select-builds-with-context conn build-statuses build-server-ids)
|
(define* (select-builds-with-context conn build-statuses build-server-ids
|
||||||
|
#:key revision-commit)
|
||||||
(define where-conditions
|
(define where-conditions
|
||||||
(filter
|
(filter
|
||||||
string?
|
string?
|
||||||
|
|
@ -103,15 +104,29 @@ ORDER BY status"))
|
||||||
"builds.build_server_id IN ("
|
"builds.build_server_id IN ("
|
||||||
(string-join (map number->string build-server-ids)
|
(string-join (map number->string build-server-ids)
|
||||||
", ")
|
", ")
|
||||||
")")))))
|
")"))
|
||||||
|
(when revision-commit
|
||||||
|
"guix_revisions.commit = $1"))))
|
||||||
|
|
||||||
(define query
|
(define query
|
||||||
(string-append "
|
(string-append
|
||||||
|
"
|
||||||
SELECT builds.id, build_servers.url, derivations.file_name,
|
SELECT builds.id, build_servers.url, derivations.file_name,
|
||||||
latest_build_status.timestamp, latest_build_status.status
|
latest_build_status.timestamp, latest_build_status.status
|
||||||
FROM builds
|
FROM builds
|
||||||
INNER JOIN build_servers ON build_servers.id = builds.build_server_id
|
INNER JOIN build_servers ON build_servers.id = builds.build_server_id
|
||||||
INNER JOIN derivations ON derivations.file_name = builds.derivation_file_name
|
INNER JOIN derivations ON derivations.file_name = builds.derivation_file_name
|
||||||
|
"
|
||||||
|
(if revision-commit
|
||||||
|
"
|
||||||
|
INNER JOIN package_derivations
|
||||||
|
ON derivations.id = package_derivations.derivation_id
|
||||||
|
INNER JOIN guix_revision_package_derivations
|
||||||
|
ON guix_revision_package_derivations.package_derivation_id = package_derivations.id
|
||||||
|
INNER JOIN guix_revisions
|
||||||
|
ON guix_revision_package_derivations.revision_id = guix_revisions.id"
|
||||||
|
"")
|
||||||
|
"
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
(
|
(
|
||||||
SELECT DISTINCT ON (build_id) *
|
SELECT DISTINCT ON (build_id) *
|
||||||
|
|
@ -129,7 +144,11 @@ ON latest_build_status.build_id = builds.id
|
||||||
ORDER BY latest_build_status.timestamp DESC
|
ORDER BY latest_build_status.timestamp DESC
|
||||||
LIMIT 100"))
|
LIMIT 100"))
|
||||||
|
|
||||||
(exec-query conn query))
|
(exec-query conn
|
||||||
|
query
|
||||||
|
(if revision-commit
|
||||||
|
(list revision-commit)
|
||||||
|
'())))
|
||||||
|
|
||||||
(define (select-builds-with-context-by-derivation-file-name
|
(define (select-builds-with-context-by-derivation-file-name
|
||||||
conn derivation-file-name)
|
conn derivation-file-name)
|
||||||
|
|
|
||||||
|
|
@ -774,7 +774,8 @@
|
||||||
(assq-ref query-parameters
|
(assq-ref query-parameters
|
||||||
'build_status)
|
'build_status)
|
||||||
(assq-ref query-parameters
|
(assq-ref query-parameters
|
||||||
'build_server))))))
|
'build_server)
|
||||||
|
#:revision-commit commit-hash)))))
|
||||||
|
|
||||||
(define* (render-revision-lint-warnings mime-types
|
(define* (render-revision-lint-warnings mime-types
|
||||||
conn
|
conn
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue