aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-07-22 20:51:54 +0100
committerChristopher Baines <mail@cbaines.net>2019-07-22 20:51:54 +0100
commit05db0a87f92dbc705d0f9285becff22a2ffdc887 (patch)
tree247da2ab2663e8a44118fa7ffd426b87ad12ea71
parentc23822e14dc4e8a32522c563540e0b80941f4ccd (diff)
downloaddata-service-05db0a87f92dbc705d0f9285becff22a2ffdc887.tar
data-service-05db0a87f92dbc705d0f9285becff22a2ffdc887.tar.gz
Switch the index page to show branches for a repository
As that's probably more useful than recent revisions and jobs.
-rw-r--r--guix-data-service/web/controller.scm14
-rw-r--r--guix-data-service/web/view/html.scm49
2 files changed, 8 insertions, 55 deletions
diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm
index 6f2511c..3dec210 100644
--- a/guix-data-service/web/controller.scm
+++ b/guix-data-service/web/controller.scm
@@ -621,18 +621,8 @@
(lambda (git-repository-details)
(cons
git-repository-details
- (map
- (match-lambda
- ((id job-id job-events commit source)
- (list id
- job-id
- job-events
- commit
- source
- (git-branches-for-commit conn commit))))
- (guix-revisions-and-jobs-for-git-repository
- conn
- (car git-repository-details)))))
+ (all-branches-with-most-recent-commit
+ conn (first git-repository-details))))
(all-git-repositories conn)))))
(('GET "builds")
(render-html
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 970492d..a126f4d 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -233,54 +233,17 @@
(h1 "Guix Data Service")))
,@(map
(match-lambda
- (((repository-id label url) . revisions)
+ (((repository-id label url) . branches-with-most-recent-commits)
`(div
(@ (class "row"))
(div
(@ (class "col-sm-12"))
(h3 ,url)
- ,(if (null? revisions)
- '(p "No revisions")
- `(table
- (@ (class "table"))
- (thead
- (tr
- (th (@ (class "col-md-6")) "Branch")
- (th (@ (class "col-md-6")) "Commit")))
- (tbody
- ,@(map
- (match-lambda
- ((revision-id job-id job-events commit source branches)
- `(tr
- (td
- ,@(map
- (match-lambda
- ((name date)
- `(span
- (a (@ (href ,(string-append
- "/repository/"
- repository-id
- "/branch/" name)))
- ,name)
- " at "
- ,date)))
- branches))
- (td (a (@ (href ,(string-append
- "/revision/" commit)))
- (samp ,commit))
- " "
- ,(cond
- ((not (string-null? revision-id))
- '(span
- (@ (class "label label-success"))
- "✓"))
- ((member "failure" job-events)
- '(span (@ (class "label label-danger"))
- "Failed to import data"))
- (else
- '(span (@ (class "label label-default"))
- "No information yet")))))))
- revisions))))))))
+ ,(if (null? branches-with-most-recent-commits)
+ '(p "No branches")
+ (table/branches-with-most-recent-commits
+ repository-id
+ branches-with-most-recent-commits))))))
git-repositories-and-revisions)))))
(define (view-statistics guix-revisions-count derivations-count)