Fix the no latest revision behaviour for the latest revision links
Previously the render-unknown-revision procedure would error, as it wasn't meant for this purpose.
This commit is contained in:
parent
f68166514f
commit
a8d5ea4654
2 changed files with 47 additions and 15 deletions
|
|
@ -215,8 +215,9 @@
|
||||||
#:header-text
|
#:header-text
|
||||||
`("Latest processed revision for branch "
|
`("Latest processed revision for branch "
|
||||||
(samp ,branch-name)))
|
(samp ,branch-name)))
|
||||||
(render-unknown-revision mime-types
|
(render-no-latest-revision mime-types
|
||||||
commit-hash))))
|
repository-id
|
||||||
|
branch-name))))
|
||||||
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "packages")
|
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "packages")
|
||||||
(letpar& ((commit-hash
|
(letpar& ((commit-hash
|
||||||
(with-thread-postgresql-connection
|
(with-thread-postgresql-connection
|
||||||
|
|
@ -255,8 +256,9 @@
|
||||||
"/repository/" repository-id
|
"/repository/" repository-id
|
||||||
"/branch/" branch-name
|
"/branch/" branch-name
|
||||||
"/latest-processed-revision")))
|
"/latest-processed-revision")))
|
||||||
(render-unknown-revision mime-types
|
(render-no-latest-revision mime-types
|
||||||
commit-hash))))
|
repository-id
|
||||||
|
branch-name))))
|
||||||
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package-derivations")
|
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package-derivations")
|
||||||
(letpar& ((commit-hash
|
(letpar& ((commit-hash
|
||||||
(with-thread-postgresql-connection
|
(with-thread-postgresql-connection
|
||||||
|
|
@ -287,8 +289,9 @@
|
||||||
commit-hash
|
commit-hash
|
||||||
parsed-query-parameters
|
parsed-query-parameters
|
||||||
#:path-base path))
|
#:path-base path))
|
||||||
(render-unknown-revision mime-types
|
(render-no-latest-revision mime-types
|
||||||
commit-hash))))
|
repository-id
|
||||||
|
branch-name))))
|
||||||
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package-reproducibility")
|
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package-reproducibility")
|
||||||
(letpar& ((commit-hash
|
(letpar& ((commit-hash
|
||||||
(with-thread-postgresql-connection
|
(with-thread-postgresql-connection
|
||||||
|
|
@ -300,8 +303,9 @@
|
||||||
(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-no-latest-revision mime-types
|
||||||
commit-hash))))
|
repository-id
|
||||||
|
branch-name))))
|
||||||
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package-substitute-availability")
|
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package-substitute-availability")
|
||||||
(letpar& ((commit-hash
|
(letpar& ((commit-hash
|
||||||
(with-thread-postgresql-connection
|
(with-thread-postgresql-connection
|
||||||
|
|
@ -313,8 +317,9 @@
|
||||||
(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-no-latest-revision mime-types
|
||||||
commit-hash))))
|
repository-id
|
||||||
|
branch-name))))
|
||||||
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision"
|
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision"
|
||||||
"lint-warnings")
|
"lint-warnings")
|
||||||
(letpar& ((commit-hash
|
(letpar& ((commit-hash
|
||||||
|
|
@ -348,8 +353,9 @@
|
||||||
"/repository/" repository-id
|
"/repository/" repository-id
|
||||||
"/branch/" branch-name
|
"/branch/" branch-name
|
||||||
"/latest-processed-revision")))
|
"/latest-processed-revision")))
|
||||||
(render-unknown-revision mime-types
|
(render-no-latest-revision mime-types
|
||||||
commit-hash))))
|
repository-id
|
||||||
|
branch-name))))
|
||||||
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package" name version)
|
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package" name version)
|
||||||
(letpar& ((commit-hash
|
(letpar& ((commit-hash
|
||||||
(with-thread-postgresql-connection
|
(with-thread-postgresql-connection
|
||||||
|
|
@ -380,8 +386,9 @@
|
||||||
"/repository/" repository-id
|
"/repository/" repository-id
|
||||||
"/branch/" branch-name
|
"/branch/" branch-name
|
||||||
"/package/" name))
|
"/package/" name))
|
||||||
(render-unknown-revision mime-types
|
(render-no-latest-revision mime-types
|
||||||
commit-hash)))))
|
repository-id
|
||||||
|
branch-name)))))
|
||||||
(_ #f)))
|
(_ #f)))
|
||||||
|
|
||||||
(define (parse-build-system)
|
(define (parse-build-system)
|
||||||
|
|
@ -395,6 +402,19 @@
|
||||||
(make-invalid-query-parameter
|
(make-invalid-query-parameter
|
||||||
s "unknown system")))))
|
s "unknown system")))))
|
||||||
|
|
||||||
|
(define (render-no-latest-revision mime-types git-repository-id branch-name)
|
||||||
|
(case (most-appropriate-mime-type
|
||||||
|
'(application/json text/html)
|
||||||
|
mime-types)
|
||||||
|
((application/json)
|
||||||
|
(render-json
|
||||||
|
'((error . "no latest revision"))
|
||||||
|
#:code 404))
|
||||||
|
(else
|
||||||
|
(render-html
|
||||||
|
#:code 404
|
||||||
|
#:sxml (view-no-latest-revision branch-name)))))
|
||||||
|
|
||||||
(define (render-branch-package-derivation-history request
|
(define (render-branch-package-derivation-history request
|
||||||
mime-types
|
mime-types
|
||||||
repository-id
|
repository-id
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@
|
||||||
view-branch
|
view-branch
|
||||||
view-branch-package
|
view-branch-package
|
||||||
view-branch-package-derivations
|
view-branch-package-derivations
|
||||||
view-branch-package-outputs))
|
view-branch-package-outputs
|
||||||
|
view-no-latest-revision))
|
||||||
|
|
||||||
(define* (view-git-repositories git-repositories)
|
(define* (view-git-repositories git-repositories)
|
||||||
(layout
|
(layout
|
||||||
|
|
@ -781,3 +782,14 @@
|
||||||
(rationalize width 1)))))))))))
|
(rationalize width 1)))))))))))
|
||||||
versions-list
|
versions-list
|
||||||
outputs-by-revision-range))))))))))
|
outputs-by-revision-range))))))))))
|
||||||
|
|
||||||
|
(define (view-no-latest-revision branch-name)
|
||||||
|
(layout
|
||||||
|
#:body
|
||||||
|
`(,(header)
|
||||||
|
(div
|
||||||
|
(@ (class "container"))
|
||||||
|
(h1 "No latest revision")
|
||||||
|
(p "No latest revision for "
|
||||||
|
(strong (samp ,branch-name))
|
||||||
|
" branch")))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue