messages: Add bugs-by-severity.
authorRicardo Wurmus <rekado@elephly.net>
Fri, 1 Feb 2019 11:44:40 +0000 (12:44 +0100)
committerRicardo Wurmus <rekado@elephly.net>
Fri, 1 Feb 2019 17:36:01 +0000 (18:36 +0100)
* mumi/messages.scm (bugs-by-severity): New procedure.

mumi/messages.scm

index 3cae441b21ce65c4f0b428b6ac8753df58eed35b..63534a029580fe3fb477d873a9c613a31a4f3051 100644 (file)
@@ -34,6 +34,7 @@
   #:export (search-bugs
             fetch-bug
             recent-bugs
+            bugs-by-severity
 
             multipart-message?
             extract-attachment))
@@ -200,6 +201,16 @@ we have to do this in a very convoluted way."
          (ids (take unique (min amount (length unique)))))
     (status-with-cache ids)))
 
+(define* (bugs-by-severity severity #:optional status)
+  "Return severe bugs."
+  (let* ((ids
+          (soap-invoke* (%config 'debbugs)
+                        get-bugs
+                        `((package . "guix")
+                          (severity . ,severity)
+                          ,@(if status `((status . ,status)) '())))))
+    (status-with-cache ids)))
+
 (define (ago unit amount)
   "Return the point in time that lies AMOUNT UNITs in the past."
   (let ((amount* (match unit