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: Wed, 7 Nov 2018 09:28:24 -0500 (EST)

branch: master
commit 0b40dca734468e8b12b3ff58e3e779679f17d38e
Author: Ludovic Courtès <address@hidden>
Date:   Wed Nov 7 15:20:10 2018 +0100

    templates: Mark failures on the evaluation page.
    
    * src/cuirass/templates.scm (evaluation-badges): Use a special badge
    denoting failure when the sum of all jobs is zero.
---
 src/cuirass/templates.scm | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index 27bb51f..8ef3275 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -136,15 +136,26 @@
 
 (define (evaluation-badges evaluation)
   (if (zero? (assq-ref evaluation #:in-progress))
-      `((a (@ (href "/eval/" ,(assq-ref evaluation #:id) "?status=succeeded")
-              (class "badge badge-success"))
-           ,(assq-ref evaluation #:succeeded))
-        (a (@ (href "/eval/" ,(assq-ref evaluation #:id) "?status=failed")
-              (class "badge badge-danger"))
-           ,(assq-ref evaluation #:failed))
-        (a (@ (href "/eval/" ,(assq-ref evaluation #:id) "?status=pending")
-              (class "badge badge-secondary"))
-           ,(assq-ref evaluation #:scheduled)))
+      (let ((succeeded (assq-ref evaluation #:succeeded))
+            (failed    (assq-ref evaluation #:failed))
+            (scheduled (assq-ref evaluation #:scheduled)))
+        ;; XXX: Since we don't have information in the database about whether
+        ;; an evaluation failed, assume that it failed when it produced zero
+        ;; build jobs.
+        (if (zero? (+ succeeded failed scheduled))
+            `((span (@ (class "oi oi-x text-danger")
+                       (title "Failed")
+                       (aria-hidden "true"))
+                    ""))
+            `((a (@ (href "/eval/" ,(assq-ref evaluation #:id) 
"?status=succeeded")
+                    (class "badge badge-success"))
+                 ,succeeded)
+              (a (@ (href "/eval/" ,(assq-ref evaluation #:id) 
"?status=failed")
+                    (class "badge badge-danger"))
+                 ,failed)
+              (a (@ (href "/eval/" ,(assq-ref evaluation #:id) 
"?status=pending")
+                    (class "badge badge-secondary"))
+                 ,scheduled))))
       '((em "In progress…"))))
 
 (define (evaluation-info-table name evaluations id-min id-max)



reply via email to

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