aboutsummaryrefslogtreecommitdiff
path: root/emacs/guix-hydra-jobset.el
blob: a4a55a36f2a0ae9ecf60e291a946bab785dfd047 (about) (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
;;; guix-hydra-jobset.el --- Interface for Hydra jobsets  -*- lexical-binding: t -*-

;; Copyright © 2015 Alex Kost <alezost@gmail.com>

;; This file is part of GNU Guix.

;; GNU Guix is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Guix is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; This file provides an interface for displaying Hydra jobsets in
;; 'list' and 'info' buffers.

;;; Code:

(require 'cl-lib)
(require 'guix-buffer)
(require 'guix-list)
(require 'guix-info)
(require 'guix-hydra)
(require 'guix-hydra-build)
(require 'guix-utils)

(guix-hydra-define-entry-type hydra-jobset
  :search-types '((project . guix-hydra-jobset-api-url))
  :filters '(guix-hydra-jobset-filter-id)
  :filter-names '((nrscheduled . scheduled)
                  (nrsucceeded . succeeded)
                  (nrfailed . failed)
                  (nrtotal . total)))

(defun guix-hydra-jobset-get-display (search-type &rest args)
  "Search for Hydra builds and show results."
  (apply #'guix-list-get-display-entries
         'hydra-jobset search-type args))


;;; Defining URLs

(defun guix-hydra-jobset-url (project jobset)
  "Return Hydra URL of a PROJECT's JOBSET."
  (guix-hydra-url "jobset/" project "/" jobset))

(defun guix-hydra-jobset-api-url (project)
  "Return Hydra API URL for jobsets by PROJECT."
  (guix-hydra-api-url "jobsets"
    `(("project" . ,project))))


;;; Filters for processing raw entries

(defun guix-hydra-jobset-filter-id (entry)
  "Add 'ID' parameter to 'hydra-jobset' ENTRY."
  (cons `(id . ,(guix-entry-value entry 'name))
        entry))


;;; Hydra jobset 'info'

(guix-hydra-info-define-interface hydra-jobset
  :mode-name "Hydra-Jobset-Info"
  :buffer-name "*Guix Hydra Jobset Info*"
  :format '((name ignore (simple guix-info-heading))
            ignore
            guix-hydra-jobset-info-insert-url
            (project   format guix-hydra-jobset-info-insert-project)
            (scheduled format (format guix-hydra-jobset-info-scheduled))
            (succeeded format (format guix-hydra-jobset-info-succeeded))
            (failed    format (format guix-hydra-jobset-info-failed))
            (total     format (format guix-hydra-jobset-info-total))))

(defface guix-hydra-jobset-info-scheduled
  '((t))
  "Face used for the number of scheduled builds."
  :group 'guix-hydra-jobset-info-faces)

(defface guix-hydra-jobset-info-succeeded
  '((t :inherit guix-hydra-build-status-succeeded))
  "Face used for the number of succeeded builds."
  :group 'guix-hydra-jobset-info-faces)

(defface guix-hydra-jobset-info-failed
  '((t :inherit guix-hydra-build-status-failed))
  "Face used for the number of failed builds."
  :group 'guix-hydra-jobset-info-faces)

(defface guix-hydra-jobset-info-total
  '((t))
  "Face used for the total number of builds."
  :group 'guix-hydra-jobset-info-faces)

(defun guix-hydra-jobset-info-insert-project (project entry)
  "Insert PROJECT button for the jobset ENTRY."
  (let ((jobset (guix-entry-value entry 'name)))
    (guix-insert-button
     project 'guix-hydra-build-project
     'action (lambda (btn)
               (let ((args (guix-hydra-build-latest-prompt-args
                            :project (button-get btn 'project)
                            :jobset  (button-get btn 'jobset))))
                 (apply #'guix-hydra-build-get-display
                        'latest args)))
     'project project
     'jobset jobset)))

(defun guix-hydra-jobset-info-insert-url (entry)
  "Insert Hydra URL for the jobset ENTRY."
  (guix-insert-button (guix-hydra-jobset-url
                       (guix-entry-value entry 'project)
                       (guix-entry-value entry 'name))
                      'guix-url))


;;; Hydra jobset 'list'

(guix-hydra-list-define-interface hydra-jobset
  :mode-name "Hydra-Jobset-List"
  :buffer-name "*Guix Hydra Jobset List*"
  :format '((name nil 25 t)
            (project nil 10 t)
            (scheduled nil 12 t)
            (succeeded nil 12 t)
            (failed nil 9 t)
            (total nil 10 t)))

(let ((map guix-hydra-jobset-list-mode-map))
  (define-key map (kbd "B") 'guix-hydra-jobset-list-latest-builds))

(defun guix-hydra-jobset-list-latest-builds (number &rest args)
  "Display latest NUMBER of Hydra builds of the current jobset.
Interactively, prompt for NUMBER.  With prefix argument, prompt
for all ARGS."
  (interactive
   (let ((entry (guix-list-current-entry)))
     (guix-hydra-build-latest-prompt-args
      :project (guix-entry-value entry 'project)
      :jobset  (guix-entry-value entry 'name))))
  (apply #'guix-hydra-latest-builds number args))


;;; Interactive commands

;;;###autoload
(defun guix-hydra-jobsets (project)
  "Display jobsets of PROJECT."
  (interactive (list (guix-hydra-read-project)))
  (guix-hydra-jobset-get-display 'project project))

(provide 'guix-hydra-jobset)

;;; guix-hydra-jobset.el ends here
lid-file-name'. Ludovic Courtès 2020-11-05gnu: ungoogled-chromium: Fix hardware acceleration....* gnu/packages/chromium.scm (ungoogled-chromium)[arguments]: Patch in absolute file name of libGL.so, and install Chromiums own libEGL.so and libGLESv2.so. Marius Bakke 2020-11-05gnu: ungoogled-chromium: Update to 86.0.4240.183-0.b68e17f [security fixes]....This fixes CVE-2020-16004, CVE-2020-16005, CVE-2020-16006, CVE-2020-16007, CVE-2020-16008, CVE-2020-16009, and CVE-2020-16011. * gnu/packages/chromium.scm (%ungoogled-revision, %ungoogled-origin): Update to b68e17f. (ungoogled-chromium): Update to 86.0.4240.183. Marius Bakke 2020-11-05gnu: ungoogled-chromium: Add search path for installed extensions....* gnu/packages/patches/ungoogled-chromium-extension-search-path.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/chromium.scm (%guix-patches): New variable. (ungoogled-chromium-snippet): Apply %GUIX-PATCHES. (ungoogled-chromium)[arguments]: Don't hard-code extensions directory. [native-search-paths]: New field. Marius Bakke 2020-10-22gnu: ungoogled-chromium: Update to 86.0.4240.111-0.c34a56d [security fixes]....This fixes CVE-2020-15999, CVE-2020-16000, CVE-2020-16001, CVE-2020-16002, and CVE-2020-16003. * gnu/packages/chromium.scm (ungoogled-chromium): Update to 86.0.4240.111-0.c34a56d. Marius Bakke 2020-10-22gnu: ungoogled-chromium: Embed absolute references to libGL and friends....* gnu/packages/chromium.scm (ungoogled-chromium)[arguments]: Provide absolute references to dlopen'd Mesa libraries. Marius Bakke 2020-10-19gnu: ungoogled-chromium: Update to 86.0.4240.75-0.c34a56d....* gnu/packages/chromium.scm (%preserved-third-party-files): Adjust for 86. Include bundled libc++, jsoncpp, re2 and libvpx for now. (gentoo-patch, chromium-gcc-patchset, %gentoo-patches, %gentoo-revision, xcb-proto/python2): Remove variables. (%debian-revision, %debian-patches): Update to debian/84.0.4147.105-1. Remove jsoncpp unbundling patch. (%ungoogled-revision, %ungoogled-origin): Update to c34a56db4c121238fface560. (%chromium-version, arch-patch, %arch-revision): New variables. (%arch-patches): Add more patches. (ungoogled-chromium-snippet): Don't apply GCC or Gentoo patches. Don't unbundle libvpx or re2. (ungoogled-chromium): Update to 86.0.4240.75-0.c34a56d. [arguments]: Adjust #:configure-flags and substitutions for 86. Add workaround for building with bundled libc++. Adjust install phase to take a hard coded list of files instead of using SCANDIR and REGEXP-EXEC. [native-inputs]: Change from CLANG-10 to CLANG-11. [inputs]: Remove JSONCPP, RE2 and XCB-PROTO/PYTHON2. Marius Bakke 2020-08-19gnu: ungoogled-chromium: Update to 84.0.4147.125-0.57244cd....* gnu/packages/chromium.scm (%ungoogled-revision, %ungoogled-origin): Update to commit 57244cdfc21dc05910862152d91cc528103c988a. (ungoogled-chromium): Update to 84.0.4147.125. Marius Bakke