diff options
author | Christopher Baines <mail@cbaines.net> | 2023-09-26 18:42:32 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-09-26 19:24:04 +0100 |
commit | 71c0888ed6cd6fbcb4b860baa54e43113288ed36 (patch) | |
tree | dee18c4b5b15a560110c8d4e04b2c175c5be0927 /guix-qa-frontpage/patchwork.scm | |
parent | 4db90aa5ceb966071971eb5f2f1d8126e1557cba (diff) | |
download | qa-frontpage-71c0888ed6cd6fbcb4b860baa54e43113288ed36.tar qa-frontpage-71c0888ed6cd6fbcb4b860baa54e43113288ed36.tar.gz |
Show the guix usertags on the issue page
Diffstat (limited to 'guix-qa-frontpage/patchwork.scm')
-rw-r--r-- | guix-qa-frontpage/patchwork.scm | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/guix-qa-frontpage/patchwork.scm b/guix-qa-frontpage/patchwork.scm index d69ea28..335d4d1 100644 --- a/guix-qa-frontpage/patchwork.scm +++ b/guix-qa-frontpage/patchwork.scm @@ -2,6 +2,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (ice-9 regex) + #:use-module (ice-9 match) #:use-module (rnrs bytevectors) #:use-module (json) #:use-module (web uri) @@ -10,6 +11,7 @@ #:use-module (web response) #:use-module (guix-build-coordinator utils) #:use-module (guix-qa-frontpage mumi) + #:use-module (guix-qa-frontpage debbugs) #:export (%patchwork-instance patchwork-patches @@ -162,12 +164,34 @@ (call-with-delay-logging mumi-bulk-issues #:args (list - (map first data))))) + (map first data)))) + (debbugs-guix-usertag-data + (call-with-delay-logging debbugs-get-issues-with-guix-usertag)) + (usertag-lookup + (let ((hash-table (make-hash-table))) + (for-each + (match-lambda + ((tag . issues) + (for-each + (lambda (issue) + (hash-set! hash-table + issue + (cons tag + (or (hash-ref hash-table issue) + '())))) + (if (pair? issues) + issues + (list issues))))) + debbugs-guix-usertag-data) + hash-table))) (sort! (filter-map (lambda (data mumi) (if (assq-ref mumi 'open?) `(,@data - (mumi . ,mumi)) + (mumi . ,mumi) + (usertags . ,(or (hash-ref usertag-lookup + (car data)) + '()))) #f)) data mumi-data) |