Add a list of the queued revisions to the index page
This commit is contained in:
parent
ffdd2416f4
commit
623347d835
3 changed files with 88 additions and 45 deletions
|
|
@ -16,7 +16,8 @@
|
||||||
#:use-module (guix-data-service model package-metadata)
|
#:use-module (guix-data-service model package-metadata)
|
||||||
#:use-module (guix-data-service model derivation)
|
#:use-module (guix-data-service model derivation)
|
||||||
#:export (process-next-load-new-guix-revision-job
|
#:export (process-next-load-new-guix-revision-job
|
||||||
select-job-for-commit))
|
select-job-for-commit
|
||||||
|
most-recent-n-load-new-guix-revision-jobs))
|
||||||
|
|
||||||
(define (inferior-guix->package-ids store conn inf)
|
(define (inferior-guix->package-ids store conn inf)
|
||||||
(let* ((packages (inferior-packages inf))
|
(let* ((packages (inferior-packages inf))
|
||||||
|
|
@ -173,6 +174,14 @@
|
||||||
(list commit))))
|
(list commit))))
|
||||||
result))
|
result))
|
||||||
|
|
||||||
|
(define (most-recent-n-load-new-guix-revision-jobs conn n)
|
||||||
|
(let ((result
|
||||||
|
(exec-query
|
||||||
|
conn
|
||||||
|
"SELECT * FROM load_new_guix_revision_jobs LIMIT $1"
|
||||||
|
(list (number->string n)))))
|
||||||
|
result))
|
||||||
|
|
||||||
(define (process-next-load-new-guix-revision-job conn)
|
(define (process-next-load-new-guix-revision-job conn)
|
||||||
(let ((next
|
(let ((next
|
||||||
(exec-query
|
(exec-query
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,9 @@
|
||||||
(define (controller request body conn)
|
(define (controller request body conn)
|
||||||
(match-lambda
|
(match-lambda
|
||||||
((GET)
|
((GET)
|
||||||
(apply render-html (index (most-recent-n-guix-revisions conn 10))))
|
(apply render-html (index
|
||||||
|
(most-recent-n-guix-revisions conn 10)
|
||||||
|
(most-recent-n-load-new-guix-revision-jobs conn 1000))))
|
||||||
((GET "compare")
|
((GET "compare")
|
||||||
(with-base-and-target-commits
|
(with-base-and-target-commits
|
||||||
request conn
|
request conn
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
"source code here") ".")))))
|
"source code here") ".")))))
|
||||||
#:extra-headers ,extra-headers))
|
#:extra-headers ,extra-headers))
|
||||||
|
|
||||||
(define (index guix-revisions)
|
(define (index guix-revisions queued-guix-revisions)
|
||||||
(layout
|
(layout
|
||||||
#:extra-headers
|
#:extra-headers
|
||||||
'((cache-control . ((max-age . 60))))
|
'((cache-control . ((max-age . 60))))
|
||||||
|
|
@ -89,9 +89,16 @@
|
||||||
`(,(header)
|
`(,(header)
|
||||||
(div
|
(div
|
||||||
(@ (class "container"))
|
(@ (class "container"))
|
||||||
(h1 "Guix Data Service")
|
(div
|
||||||
(form (@ (id "compare")
|
(@ (class "row"))
|
||||||
|
(h1 "Guix Data Service"))
|
||||||
|
(div
|
||||||
|
(@ (class "row"))
|
||||||
|
(form
|
||||||
|
(@ (id "compare")
|
||||||
(action "/compare"))
|
(action "/compare"))
|
||||||
|
(div
|
||||||
|
(@ (class "col-md-6"))
|
||||||
(div
|
(div
|
||||||
(@ (class "form-group"))
|
(@ (class "form-group"))
|
||||||
(label (@ (for "base_commit"))
|
(label (@ (for "base_commit"))
|
||||||
|
|
@ -109,11 +116,15 @@
|
||||||
(class "form-control")
|
(class "form-control")
|
||||||
(id "target_commit")
|
(id "target_commit")
|
||||||
(name "target_commit")
|
(name "target_commit")
|
||||||
(placeholder "target commit"))))
|
(placeholder "target commit")))))
|
||||||
|
(div
|
||||||
|
(@ (class "col-md-6"))
|
||||||
(button
|
(button
|
||||||
(@ (type "submit")
|
(@ (type "submit")
|
||||||
(class "btn btn-lg btn-primary"))
|
(class "btn btn-lg btn-primary"))
|
||||||
"Compare"))
|
"Compare"))))
|
||||||
|
(div
|
||||||
|
(@ (class "row"))
|
||||||
(h3 "Recent fetched revisions")
|
(h3 "Recent fetched revisions")
|
||||||
,(if (null? guix-revisions)
|
,(if (null? guix-revisions)
|
||||||
'(p "No revisions")
|
'(p "No revisions")
|
||||||
|
|
@ -130,7 +141,28 @@
|
||||||
`(tr
|
`(tr
|
||||||
(td ,url)
|
(td ,url)
|
||||||
(td (samp ,commit)))))
|
(td (samp ,commit)))))
|
||||||
guix-revisions))))))))
|
guix-revisions)))))
|
||||||
|
(div
|
||||||
|
(@ (class "row"))
|
||||||
|
(h3 "Queued revisions")
|
||||||
|
,(if (null? queued-guix-revisions)
|
||||||
|
'(p "No queued revisions")
|
||||||
|
`(table
|
||||||
|
(@ (class "table"))
|
||||||
|
(thead
|
||||||
|
(tr
|
||||||
|
(th (@ (class "col-md-4")) "Source Repository URL")
|
||||||
|
(th (@ (class "col-md-4")) "Commit")
|
||||||
|
(th (@ (class "col-md-4")) "Source")))
|
||||||
|
(tbody
|
||||||
|
,@(map
|
||||||
|
(match-lambda
|
||||||
|
((id url commit source)
|
||||||
|
`(tr
|
||||||
|
(td ,url)
|
||||||
|
(td (samp ,commit))
|
||||||
|
(td ,source))))
|
||||||
|
queued-guix-revisions)))))))))
|
||||||
|
|
||||||
(define (compare base-commit
|
(define (compare base-commit
|
||||||
target-commit
|
target-commit
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue