Improve the revision page when a revision hasn't been processed
This commit is contained in:
parent
9a9d156366
commit
b0b87cced7
2 changed files with 88 additions and 29 deletions
|
|
@ -123,7 +123,7 @@
|
||||||
(render-revision-news mime-types
|
(render-revision-news mime-types
|
||||||
commit-hash
|
commit-hash
|
||||||
parsed-query-parameters))
|
parsed-query-parameters))
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "packages")
|
(('GET "revision" commit-hash "packages")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -152,7 +152,7 @@
|
||||||
commit-hash
|
commit-hash
|
||||||
parsed-query-parameters
|
parsed-query-parameters
|
||||||
#:path-base path))
|
#:path-base path))
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "packages-translation-availability")
|
(('GET "revision" commit-hash "packages-translation-availability")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -162,7 +162,7 @@
|
||||||
(render-revision-packages-translation-availability mime-types
|
(render-revision-packages-translation-availability mime-types
|
||||||
commit-hash
|
commit-hash
|
||||||
#:path-base path)
|
#:path-base path)
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "package" name)
|
(('GET "revision" commit-hash "package" name)
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -172,7 +172,7 @@
|
||||||
(render-revision-package mime-types
|
(render-revision-package mime-types
|
||||||
commit-hash
|
commit-hash
|
||||||
name)
|
name)
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "package" name version)
|
(('GET "revision" commit-hash "package" name version)
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -188,7 +188,7 @@
|
||||||
name
|
name
|
||||||
version
|
version
|
||||||
parsed-query-parameters))
|
parsed-query-parameters))
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "package-derivations")
|
(('GET "revision" commit-hash "package-derivations")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -218,7 +218,7 @@
|
||||||
commit-hash
|
commit-hash
|
||||||
parsed-query-parameters
|
parsed-query-parameters
|
||||||
#:path-base path))
|
#:path-base path))
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "fixed-output-package-derivations")
|
(('GET "revision" commit-hash "fixed-output-package-derivations")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -244,7 +244,7 @@
|
||||||
commit-hash
|
commit-hash
|
||||||
parsed-query-parameters
|
parsed-query-parameters
|
||||||
#:path-base path))
|
#:path-base path))
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "package-derivation-outputs")
|
(('GET "revision" commit-hash "package-derivation-outputs")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -275,7 +275,7 @@
|
||||||
commit-hash
|
commit-hash
|
||||||
parsed-query-parameters
|
parsed-query-parameters
|
||||||
#:path-base path))
|
#:path-base path))
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "system-tests")
|
(('GET "revision" commit-hash "system-tests")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -290,7 +290,7 @@
|
||||||
commit-hash
|
commit-hash
|
||||||
parsed-query-parameters
|
parsed-query-parameters
|
||||||
#:path-base path))
|
#:path-base path))
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "channel-instances")
|
(('GET "revision" commit-hash "channel-instances")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -300,7 +300,7 @@
|
||||||
(render-revision-channel-instances mime-types
|
(render-revision-channel-instances mime-types
|
||||||
commit-hash
|
commit-hash
|
||||||
#:path-base path)
|
#:path-base path)
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "package-substitute-availability")
|
(('GET "revision" commit-hash "package-substitute-availability")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -310,7 +310,7 @@
|
||||||
(render-revision-package-substitute-availability mime-types
|
(render-revision-package-substitute-availability mime-types
|
||||||
commit-hash
|
commit-hash
|
||||||
#:path-base path)
|
#:path-base path)
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "package-reproducibility")
|
(('GET "revision" commit-hash "package-reproducibility")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -320,7 +320,7 @@
|
||||||
(render-revision-package-reproduciblity mime-types
|
(render-revision-package-reproduciblity mime-types
|
||||||
commit-hash
|
commit-hash
|
||||||
#:path-base path)
|
#:path-base path)
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "builds")
|
(('GET "revision" commit-hash "builds")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -345,7 +345,7 @@
|
||||||
commit-hash
|
commit-hash
|
||||||
parsed-query-parameters
|
parsed-query-parameters
|
||||||
#:path-base path))
|
#:path-base path))
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(('GET "revision" commit-hash "lint-warnings")
|
(('GET "revision" commit-hash "lint-warnings")
|
||||||
(if (parallel-via-thread-pool-channel
|
(if (parallel-via-thread-pool-channel
|
||||||
|
|
@ -368,7 +368,7 @@
|
||||||
commit-hash
|
commit-hash
|
||||||
parsed-query-parameters
|
parsed-query-parameters
|
||||||
#:path-base path))
|
#:path-base path))
|
||||||
(render-unknown-revision mime-types
|
(render-unprocessed-revision mime-types
|
||||||
commit-hash)))
|
commit-hash)))
|
||||||
(_ #f)))
|
(_ #f)))
|
||||||
|
|
||||||
|
|
@ -412,6 +412,37 @@
|
||||||
git-repositories-and-branches
|
git-repositories-and-branches
|
||||||
jobs-and-events))))))
|
jobs-and-events))))))
|
||||||
|
|
||||||
|
(define (render-unprocessed-revision mime-types commit-hash)
|
||||||
|
(case (most-appropriate-mime-type
|
||||||
|
'(application/json text/html)
|
||||||
|
mime-types)
|
||||||
|
((application/json)
|
||||||
|
(render-json
|
||||||
|
'((unknown_commit . ,commit-hash))
|
||||||
|
#:code 404))
|
||||||
|
(else
|
||||||
|
(letpar& ((job
|
||||||
|
(with-thread-postgresql-connection
|
||||||
|
(lambda (conn)
|
||||||
|
(select-job-for-commit conn commit-hash))))
|
||||||
|
(git-repositories-and-branches
|
||||||
|
(with-thread-postgresql-connection
|
||||||
|
(lambda (conn)
|
||||||
|
(git-branches-with-repository-details-for-commit conn
|
||||||
|
commit-hash))))
|
||||||
|
(jobs-and-events
|
||||||
|
(with-thread-postgresql-connection
|
||||||
|
(lambda (conn)
|
||||||
|
(select-jobs-and-events-for-commit conn commit-hash)))))
|
||||||
|
|
||||||
|
(render-html
|
||||||
|
#:code 404
|
||||||
|
#:sxml (unprocessed-revision
|
||||||
|
commit-hash
|
||||||
|
job
|
||||||
|
git-repositories-and-branches
|
||||||
|
jobs-and-events))))))
|
||||||
|
|
||||||
(define* (render-view-revision mime-types
|
(define* (render-view-revision mime-types
|
||||||
commit-hash
|
commit-hash
|
||||||
#:key path-base
|
#:key path-base
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,8 @@
|
||||||
view-revision-channel-instances
|
view-revision-channel-instances
|
||||||
view-revision-builds
|
view-revision-builds
|
||||||
view-revision-lint-warnings
|
view-revision-lint-warnings
|
||||||
unknown-revision))
|
unknown-revision
|
||||||
|
unprocessed-revision))
|
||||||
|
|
||||||
(define* (view-revision-news commit-hash
|
(define* (view-revision-news commit-hash
|
||||||
query-parameters
|
query-parameters
|
||||||
|
|
@ -2350,3 +2351,30 @@ figure {
|
||||||
(p "No known revision with commit "
|
(p "No known revision with commit "
|
||||||
(strong (samp ,commit-hash)))))))))
|
(strong (samp ,commit-hash)))))))))
|
||||||
|
|
||||||
|
(define (unprocessed-revision commit-hash job git-repositories-and-branches
|
||||||
|
jobs-and-events)
|
||||||
|
(layout
|
||||||
|
#:body
|
||||||
|
`(,(header)
|
||||||
|
(div
|
||||||
|
(@ (class "container"))
|
||||||
|
,@(if job
|
||||||
|
`((div
|
||||||
|
(@ (class "row"))
|
||||||
|
(div
|
||||||
|
(@ (class "col-md-12"))
|
||||||
|
(h1 (@ (style "white-space: nowrap;"))
|
||||||
|
"Revision " (samp ,commit-hash) (br) "not yet processed")))
|
||||||
|
(div
|
||||||
|
(@ (class "row"))
|
||||||
|
(div
|
||||||
|
(@ (class "col-md-12"))
|
||||||
|
,@(if (null? git-repositories-and-branches)
|
||||||
|
'()
|
||||||
|
(view-revision/git-repositories
|
||||||
|
git-repositories-and-branches
|
||||||
|
commit-hash))
|
||||||
|
,@(view-revision/jobs-and-events jobs-and-events))))
|
||||||
|
`((h1 "Unknown revision")
|
||||||
|
(p "No known revision with commit "
|
||||||
|
(strong (samp ,commit-hash)))))))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue