From 47521e266136087846ef928c1377e6a0e4630ce8 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 27 Mar 2023 00:28:59 +1100 Subject: fixing branches and revisions are many-to-many relations - in branch view, show revisions with build stats and all builds - in revision view, show branches with build stats and all builds --- buildbot-utils.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'buildbot-utils.el') diff --git a/buildbot-utils.el b/buildbot-utils.el index e268e52..b748f6d 100644 --- a/buildbot-utils.el +++ b/buildbot-utils.el @@ -120,23 +120,27 @@ builds) results)) -(defun buildbot-get-info-and-builds (changes) +(defun buildbot-get-revision-and-changes-info (changes) "Get revision-info and builds from a set of changes of the same revision. Concat all builds." - (let* ((builds (seq-mapcat - (lambda (change) - (alist-get 'builds change)) + (let* ((changes-info + (mapcar (lambda (change) + (list + (assq 'branch change) + (assq 'builds change) + (cons 'build-stats + (buildbot-get-build-stats + (alist-get 'builds change))))) changes)) (first-change (elt changes 0)) - (info (list + (revision-info (list (assq 'revision first-change) (assq 'author first-change) (cons 'created-at (buildbot-format-epoch-time (alist-get 'when_timestamp first-change))) - (assq 'comments first-change) - (cons 'build-stats (buildbot-get-build-stats builds))))) - `((revision-info . ,info) (builds . ,builds)))) + (assq 'comments first-change)))) + `((revision-info . ,revision-info) (changes-info . ,changes-info)))) (provide 'buildbot-utils) -- cgit v1.2.3