Fix the latest-processed-revision pages
This commit is contained in:
parent
7f8ffb4bea
commit
75226a1499
2 changed files with 12 additions and 9 deletions
|
|
@ -96,20 +96,21 @@ WHERE git_branches.commit = $1")
|
||||||
query
|
query
|
||||||
(list branch-name git-repository-id))))
|
(list branch-name git-repository-id))))
|
||||||
|
|
||||||
(define* (latest-processed-commit-for-branch conn branch-name)
|
(define* (latest-processed-commit-for-branch conn repository-id branch-name)
|
||||||
(define query
|
(define query
|
||||||
(string-append
|
(string-append
|
||||||
"SELECT git_branches.commit "
|
"SELECT git_branches.commit "
|
||||||
"FROM git_branches "
|
"FROM git_branches "
|
||||||
"INNER JOIN guix_revisions ON git_branches.commit = guix_revisions.commit "
|
"INNER JOIN guix_revisions ON git_branches.commit = guix_revisions.commit "
|
||||||
"WHERE git_branches.name = $1 "
|
"WHERE guix_revisions.git_repository_id = $1 AND "
|
||||||
|
"git_branches.git_repository_id = $1 AND git_branches.name = $2 "
|
||||||
"ORDER BY datetime DESC "
|
"ORDER BY datetime DESC "
|
||||||
"LIMIT 1"))
|
"LIMIT 1"))
|
||||||
|
|
||||||
(match (exec-query
|
(match (exec-query
|
||||||
conn
|
conn
|
||||||
query
|
query
|
||||||
(list branch-name))
|
(list repository-id branch-name))
|
||||||
(((commit-hash))
|
(((commit-hash))
|
||||||
commit-hash)
|
commit-hash)
|
||||||
('()
|
('()
|
||||||
|
|
|
||||||
|
|
@ -716,9 +716,9 @@
|
||||||
'after_date)
|
'after_date)
|
||||||
#:before-date (assq-ref parsed-query-parameters
|
#:before-date (assq-ref parsed-query-parameters
|
||||||
'before_date)))))))
|
'before_date)))))))
|
||||||
(('GET "branch" branch-name "latest-processed-revision")
|
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision")
|
||||||
(let ((commit-hash
|
(let ((commit-hash
|
||||||
(latest-processed-commit-for-branch conn branch-name)))
|
(latest-processed-commit-for-branch conn repository-id branch-name)))
|
||||||
(if commit-hash
|
(if commit-hash
|
||||||
(render-view-revision mime-types
|
(render-view-revision mime-types
|
||||||
conn
|
conn
|
||||||
|
|
@ -730,9 +730,9 @@
|
||||||
(render-unknown-revision mime-types
|
(render-unknown-revision mime-types
|
||||||
conn
|
conn
|
||||||
commit-hash))))
|
commit-hash))))
|
||||||
(('GET "branch" branch-name "latest-processed-revision" "packages")
|
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "packages")
|
||||||
(let ((commit-hash
|
(let ((commit-hash
|
||||||
(latest-processed-commit-for-branch conn branch-name)))
|
(latest-processed-commit-for-branch conn repository-id branch-name)))
|
||||||
(if commit-hash
|
(if commit-hash
|
||||||
(let ((parsed-query-parameters
|
(let ((parsed-query-parameters
|
||||||
(guard-against-mutually-exclusive-query-parameters
|
(guard-against-mutually-exclusive-query-parameters
|
||||||
|
|
@ -761,14 +761,15 @@
|
||||||
(samp ,branch-name))
|
(samp ,branch-name))
|
||||||
#:header-link
|
#:header-link
|
||||||
(string-append
|
(string-append
|
||||||
|
"/repository/" repository-id
|
||||||
"/branch/" branch-name
|
"/branch/" branch-name
|
||||||
"/latest-processed-revision")))
|
"/latest-processed-revision")))
|
||||||
(render-unknown-revision mime-types
|
(render-unknown-revision mime-types
|
||||||
conn
|
conn
|
||||||
commit-hash))))
|
commit-hash))))
|
||||||
(('GET "branch" branch-name "latest-processed-revision" "package" name version)
|
(('GET "repository" repository-id "branch" branch-name "latest-processed-revision" "package" name version)
|
||||||
(let ((commit-hash
|
(let ((commit-hash
|
||||||
(latest-processed-commit-for-branch conn branch-name)))
|
(latest-processed-commit-for-branch conn repository-id branch-name)))
|
||||||
(if commit-hash
|
(if commit-hash
|
||||||
(render-revision-package mime-types
|
(render-revision-package mime-types
|
||||||
conn
|
conn
|
||||||
|
|
@ -780,6 +781,7 @@
|
||||||
(samp ,branch-name))
|
(samp ,branch-name))
|
||||||
#:header-link
|
#:header-link
|
||||||
(string-append
|
(string-append
|
||||||
|
"/repository/" repository-id
|
||||||
"/branch/" branch-name
|
"/branch/" branch-name
|
||||||
"/latest-processed-revision"))
|
"/latest-processed-revision"))
|
||||||
(render-unknown-revision mime-types
|
(render-unknown-revision mime-types
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue