[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Ludovic Courtès |
Date: |
Tue, 5 Sep 2023 16:44:45 -0400 (EDT) |
branch: master
commit 82c785d4f30bd78e6f9c80c5749db3d799ec7acb
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Sep 5 22:44:07 2023 +0200
templates: Tolerate missing checkout info.
* src/cuirass/templates.scm (checkout-table): Tolerate CHECKOUT as #f.
---
src/cuirass/templates.scm | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index a676439..dfcb424 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -1273,19 +1273,26 @@ the nearest exact even integer."
(th (@ (class "border-0") (scope "col")) "Commit")))
(tbody
,@(map (lambda (checkout)
- (let* ((name (checkout-channel checkout))
- (channel (find (lambda (channel)
- (eq? (channel-name channel)
- name))
- channels)))
- ;; Some checkout entries may refer to removed
- ;; inputs.
- (if channel
- (let ((url (channel-url channel))
- (commit (checkout-commit checkout)))
- `(tr (td ,url)
- (td (code ,(commit-hyperlink url commit)))))
- '())))
+ ;; Normally CHECKOUT is a <checkout> record that was
+ ;; returned by 'latest-checkouts'. However, due to old
+ ;; bugs, the database might yield #f for channels that are
+ ;; indirect dependencies; deal with it gracefully.
+ (if checkout
+ (let* ((name (checkout-channel checkout))
+ (channel (find (lambda (channel)
+ (eq? (channel-name channel)
+ name))
+ channels)))
+ ;; Some checkout entries may refer to removed
+ ;; inputs.
+ (if channel
+ (let ((url (channel-url channel))
+ (commit (checkout-commit checkout)))
+ `(tr (td ,url)
+ (td (code ,(commit-hyperlink url
commit)))))
+ '()))
+ `(tr (td "?")
+ (td (i "checkout information is missing")))))
checkouts))))
(define* (build-counter-badge value class title