aboutsummaryrefslogtreecommitdiff
path: root/guix-qa-frontpage/view/patches.scm
blob: 8a7665c7163ef032b06fa3c9b49823d8ed3d9bcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(define-module (guix-qa-frontpage view patches)
  #:use-module (srfi srfi-1)
  #:use-module (ice-9 match)
  #:use-module (guix-qa-frontpage view util)
  #:export (patches-view))

(define (patches-view latest-series systems-with-low-substitute-availability)
  (layout
   #:title "Patches"
   #:body
   `((main
      (p "The aim with this page is that the patches to look at should be towards the
top.")
      (p "For issues with the green status (important checks passing), the oldest ones
will appear first.")
      ,@(if (or (eq? #f systems-with-low-substitute-availability)
                (null? systems-with-low-substitute-availability))
            '()
            `((p (@ (style "text-align: center; font-weight: bold;"))
                 "Builds for new patch series suspended as "
                 (a (@ (href "/branch/master"))
                    "master branch substitute availability")
                 " is low for: "
                 ,@(append-map
                    (lambda (system)
                      `((span (@ (style "font-family: monospace;"))
                              ,system
                              " ")))
                    systems-with-low-substitute-availability))))
      (table
       (tbody
        ,@(map (match-lambda
                 ((id . details)
                  (let ((status (assq-ref details 'overall-status)))
                    `(tr
                      (td (a (@ (href ,(simple-format #f "/issue/~A" id)))
                             ,id))
                      (td
                       (@ (style "vertical-align: middle;"))
                       ,@(cond
                          ((eq? status 'important-checks-passing)
                           `((span (@ (aria-label "status: green")
                                      (class "green-dot"))
                                   (*ENTITY* "#10004"))))
                          ((eq? status 'important-checks-failing)
                           `((span (@ (aria-label "status: red")
                                      (class "red-dot"))
                                   (*ENTITY* "#10005"))))
                          ((eq? status 'needs-looking-at)
                           `((span (@ (aria-label "status: orange")
                                      (class "orange-dot"))
                                   (*ENTITY* "#9888"))))
                          (else
                           `((span (@ (aria-label "status: grey")
                                      (class "grey-dot"))
                                   "?")))))
                      (td (@ (style "text-align: left;"))
                          ,(assoc-ref details "name"))))))
               latest-series)))))))