guix-commits
[Top][All Lists]
Advanced

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

branch master updated: Handle badge jobset errors.


From: Mathieu Othacehe
Subject: branch master updated: Handle badge jobset errors.
Date: Fri, 28 May 2021 08:23:57 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix-cuirass.

The following commit(s) were added to refs/heads/master by this push:
     new 3ac739b  Handle badge jobset errors.
3ac739b is described below

commit 3ac739b97dbf3684f925eac7a5d609e79ec1ac5f
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Fri May 28 14:22:59 2021 +0200

    Handle badge jobset errors.
    
    * src/cuirass/database.scm (db-get-latest-evaluation): Return false when no
    evaluation is found.
    * src/cuirass/http.scm (url-handler): Adapt it.
---
 src/cuirass/database.scm | 3 ++-
 src/cuirass/http.scm     | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 0f752cb..357ef44 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -1501,7 +1501,8 @@ WHERE specification=" spec))
 SELECT max(id) FROM Evaluations
 WHERE status = 0 AND specification =  " spec
 " GROUP BY Evaluations.specification;"))
-      ((eval) (and eval (string->number eval))))))
+      ((eval) (and eval (string->number eval)))
+      (else #f))))
 
 (define (db-get-latest-evaluations)
   "Return the latest successful evaluation for each specification."
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index dd70ad8..d6323d0 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -1076,8 +1076,8 @@ passed, only display JOBS targeting this SYSTEM."
 
     (('GET "jobset" spec "badge")
      (let* ((params (request-parameters request))
-            (summary (db-get-evaluation-absolute-summary
-                      (db-get-latest-evaluation spec))))
+            (summary (and=> (db-get-latest-evaluation spec)
+                            db-get-evaluation-absolute-summary)))
        (respond-svg
         (badge-svg badge-string summary))))
 



reply via email to

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