guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Ludovic Courtès
Date: Sat, 18 Nov 2023 13:12:02 -0500 (EST)

branch: master
commit 0daae8bfc902ff3fb00edddfd9d0a60eda018624
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Nov 18 12:46:19 2023 +0100

    templates: Distinguish failure counter when there are new failures.
    
    The failed-build counter on /eval/ID pages is now orange when there are
    no new build failures, red when there are new build failures.
    
    * src/cuirass/templates.scm (newly-failed-build-badge): New procedure.
    (specifications-table): Use it instead of ‘failed-build-badge’.
    (evaluation-badges): Use ‘newly-failed-build-badge’ when ABSOLUTE has
    a positive ‘new-failed’.
---
 src/cuirass/templates.scm | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index dedb801..8ef9a7f 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -405,7 +405,7 @@ system whose names start with " (code "guile-") ":" (br)
                                (@ (class "job-rel d-none"))
                                ,(successful-build-badge
                                  (evaluation-summary-succeeded summary))
-                               ,(failed-build-badge
+                               ,(newly-failed-build-badge
                                  (evaluation-summary-failed summary))
                                ,(scheduled-build-badge
                                  (evaluation-summary-scheduled summary)))))
@@ -969,7 +969,7 @@ the existing SPEC otherwise."
                     (evaluation-summary-succeeded absolute)
                     0)))
              ,(dashboard-link
-               (failed-build-badge
+               (newly-failed-build-badge
                 (if absolute
                     (evaluation-summary-failed absolute)
                     0)))
@@ -986,12 +986,15 @@ the existing SPEC otherwise."
                                        (number->string
                                         (build-summary-evaluation-id 
evaluation))
                                        "?status=succeeded"))
-             ,(failed-build-badge (build-summary-failed evaluation)
-                                  (string-append
-                                   "/eval/"
-                                   (number->string
-                                    (build-summary-evaluation-id evaluation))
-                                   "?status=failed"))
+             ,((if (> (evaluation-summary-newly-failed absolute) 0)
+                   newly-failed-build-badge
+                   failed-build-badge)
+               (build-summary-failed evaluation)
+               (string-append
+                "/eval/"
+                (number->string
+                 (build-summary-evaluation-id evaluation))
+                "?status=failed"))
              ,(scheduled-build-badge (build-summary-scheduled evaluation)
                                      (string-append
                                       "/eval/"
@@ -1450,7 +1453,9 @@ the channel's URL."
 (define successful-build-badge
   (cut build-counter-badge <> "badge-success" "Succeeded" <...>))
 (define failed-build-badge
-  (cut build-counter-badge <> "badge-danger" "Failed" <...>))
+  (cut build-counter-badge <> "badge-warning" "Failed" <...>))
+(define newly-failed-build-badge
+  (cut build-counter-badge <> "badge-danger" "Failed, including new failures" 
<...>))
 (define scheduled-build-badge
   (cut build-counter-badge <> "badge-secondary" "Scheduled" <...>))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]