[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/buildbot f5b97b439a 12/22: fixing a bug where build vie
From: |
ELPA Syncer |
Subject: |
[elpa] externals/buildbot f5b97b439a 12/22: fixing a bug where build view shows the wrong revision info |
Date: |
Thu, 13 Jul 2023 00:57:38 -0400 (EDT) |
branch: externals/buildbot
commit f5b97b439a2a1a7d13c60f1b711edf704542a038
Author: Yuchen Pei <hi@ypei.me>
Commit: Yuchen Pei <hi@ypei.me>
fixing a bug where build view shows the wrong revision info
...by correcting outdated revision info when opening build view.
---
buildbot-utils.el | 30 +++++++++++++-----------
buildbot-view.el | 70 +++++++++++++++++++++++++++++--------------------------
2 files changed, 53 insertions(+), 47 deletions(-)
diff --git a/buildbot-utils.el b/buildbot-utils.el
index 3f79d63e42..57c0a22de4 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)
diff --git a/buildbot-view.el b/buildbot-view.el
index dd0d4b082f..8e3590d21b 100644
--- a/buildbot-view.el
+++ b/buildbot-view.el
@@ -84,7 +84,7 @@
(alist-get 'failure stats)
(alist-get 'pending stats)))
-(defun buildbot-view-format-build (build)
+(defun buildbot-view-format-build (revision build)
(propertize
(format "\n[%s | %s]\n%s"
(buildbot-get-builder-name-by-id (alist-get 'builderid build))
@@ -95,20 +95,22 @@
(mapcar (lambda (test) (alist-get 'test_name test))
(alist-get 'failed_tests build))
"\n"))
- 'build build 'type 'build))
+ 'revision revision 'build build 'type 'build))
(defun buildbot-view-format-change-info (change-info &optional no-branch)
- (concat
- (unless no-branch
- (concat (buildbot-view-format-branch (alist-get 'branch change-info))
- "\n"))
- (buildbot-view-format-build-stats (alist-get 'build-stats change-info))
- "\n"
- (string-join
- (mapcar
- 'buildbot-view-format-build
- (alist-get 'builds change-info))
- "\n")))
+ (let ((revision (alist-get 'revision change-info)))
+ (concat
+ (unless no-branch
+ (concat (buildbot-view-format-branch (alist-get 'branch change-info))
+ "\n"))
+ (buildbot-view-format-build-stats (alist-get 'build-stats change-info))
+ "\n"
+ (string-join
+ (mapcar
+ (lambda (build)
+ (buildbot-view-format-build revision build))
+ (alist-get 'builds change-info))
+ "\n"))))
(defun buildbot-view-format-step (step)
(propertize
@@ -128,24 +130,15 @@
'log log 'type 'log))
(defun buildbot-revision-format (revision-and-changes-info &optional no-branch)
- (concat
- (buildbot-view-format-revision-info
- (alist-get 'revision-info revision-and-changes-info))
- "\n\n"
- (string-join
- (mapcar (lambda (change-info)
- (buildbot-view-format-change-info change-info no-branch))
- (alist-get 'changes-info revision-and-changes-info))
- "\n")))
-
-;; (defun buildbot-revision-get-info (change)
-;; (list (cons 'revision (alist-get 'revision change))
-;; (cons 'author (alist-get 'author change))
-;; (cons 'created-at (buildbot-format-epoch-time
-;; (alist-get 'when_timestamp change)))
-;; (cons 'comments (alist-get 'comments change))
-;; (cons 'build-stats (buildbot-revision-get-build-stats
-;; (alist-get 'builds change)))))
+ (let ((revision-info (alist-get 'revision-info revision-and-changes-info)))
+ (concat
+ (buildbot-view-format-revision-info revision-info)
+ "\n\n"
+ (string-join
+ (mapcar (lambda (change-info)
+ (buildbot-view-format-change-info change-info no-branch))
+ (alist-get 'changes-info revision-and-changes-info))
+ "\n"))))
(defun buildbot-view-format-branch (branch)
(propertize
@@ -169,7 +162,7 @@
(concat
(buildbot-view-format-revision-info revision-info)
"\n"
- (buildbot-view-format-build build)
+ (buildbot-view-format-build (alist-get 'revision revision-info) build)
"\n"
(string-join
(mapcar 'buildbot-view-format-step steps)
@@ -257,6 +250,15 @@
(alist-get 'revision-info revision-and-changes-info))
(insert (buildbot-revision-format revision-and-changes-info))))
('build
+ (let ((revision (alist-get 'revision-id buildbot-view-data)))
+ (unless (equal (alist-get 'revision
+ (alist-get 'revision-info
buildbot-view-data))
+ revision)
+ (setf (alist-get 'revision-info buildbot-view-data)
+ (buildbot-get-revision-info-from-change
+ (elt
+ (buildbot-get-changes-by-revision revision)
+ 0)))))
(insert (buildbot-build-format
(alist-get 'revision-info buildbot-view-data)
(alist-get 'build buildbot-view-data)
@@ -296,7 +298,9 @@
(buildbot-view-open 'revision data force))
('build
(setf (alist-get 'build data)
- (get-text-property (point) 'build))
+ (get-text-property (point) 'build)
+ (alist-get 'revision-id data)
+ (get-text-property (point) 'revision))
(buildbot-view-open 'build data force))
('step
(setf (alist-get 'step data)
- [elpa] externals/buildbot a52cc6222a 18/22: Prepare for elpa, (continued)
- [elpa] externals/buildbot a52cc6222a 18/22: Prepare for elpa, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot 16947d6b1a 11/22: Adding function to go to next / previous header of the same thing, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot f9792cdcfa 01/22: first commit, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot c79dd7c405 08/22: linting, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot 20fd138b70 04/22: Unify the three modes into one (view mode), ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot 527fdf6d17 15/22: fixing bug caused by updated signature of buildbot-view-format-build, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot 9714d2e9b7 06/22: branch view (first imp); faces for status; revision with multiple changes, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot 47521e2661 07/22: fixing branches and revisions are many-to-many relations, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot f5a35a82a6 13/22: started working on builder view, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot 319b7224fc 14/22: Adding builder view, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot f5b97b439a 12/22: fixing a bug where build view shows the wrong revision info,
ELPA Syncer <=
- [elpa] externals/buildbot 519956a4f6 10/22: minor update readme, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot 3de5304a5c 16/22: Updated readme to add info about buildbot-builder-open, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot d3c7fcb511 19/22: Adding commentary, ELPA Syncer, 2023/07/13
- [elpa] externals/buildbot 071ba8408a 21/22: Fixing flymake complaints., ELPA Syncer, 2023/07/13