aboutsummaryrefslogtreecommitdiff
path: root/buildbot-utils.el
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2023-03-30 00:38:30 +1100
committerYuchen Pei <hi@ypei.me>2023-03-30 00:38:30 +1100
commitf5b97b439a2a1a7d13c60f1b711edf704542a038 (patch)
tree1391979515679041221e8bcb98932e7db19157a9 /buildbot-utils.el
parent16947d6b1a2679ca94f9986b0dc77683cfad900f (diff)
fixing a bug where build view shows the wrong revision info
...by correcting outdated revision info when opening build view.
Diffstat (limited to 'buildbot-utils.el')
-rw-r--r--buildbot-utils.el30
1 files changed, 16 insertions, 14 deletions
diff --git a/buildbot-utils.el b/buildbot-utils.el
index 3f79d63..57c0a22 100644
--- a/buildbot-utils.el
+++ b/buildbot-utils.el
@@ -140,27 +140,29 @@
builds)
results))
-(defun buildbot-get-revision-and-changes-info (changes)
- "Get revision-info and builds from a set of changes of the same revision.
+(defun buildbot-get-revision-info-from-change (change)
+ (list
+ (assq 'revision change)
+ (assq 'author change)
+ (cons 'created-at
+ (buildbot-format-epoch-time
+ (alist-get 'when_timestamp change)))
+ (assq 'comments change)))
-Concat all builds."
- (let* ((changes-info
+(defun buildbot-get-revision-and-changes-info (changes)
+ "Get revision-info and builds from a set of changes of the same revision."
+ (let* ((first-change (elt changes 0))
+ (revision-info (buildbot-get-revision-info-from-change first-change))
+ (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))
- (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))))
+ (alist-get 'builds change)))
+ (assq 'revision first-change)))
+ changes)))
`((revision-info . ,revision-info) (changes-info . ,changes-info))))
(provide 'buildbot-utils)