aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix-qa-frontpage/guix-data-service.scm31
1 files changed, 21 insertions, 10 deletions
diff --git a/guix-qa-frontpage/guix-data-service.scm b/guix-qa-frontpage/guix-data-service.scm
index 3996cea..a215ff7 100644
--- a/guix-qa-frontpage/guix-data-service.scm
+++ b/guix-qa-frontpage/guix-data-service.scm
@@ -1,6 +1,7 @@
(define-module (guix-qa-frontpage guix-data-service)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
+ #:use-module (ice-9 match)
#:use-module (web uri)
#:use-module (web client)
#:use-module (web response)
@@ -24,10 +25,15 @@
(define* (patch-series-derivation-changes-url checks #:key systems)
(define comparison-check
- (find (lambda (check)
- (string=? (assoc-ref check "context")
- "comparison"))
- checks))
+ (match (sort (filter (lambda (check)
+ (string=? (assoc-ref check "context")
+ "comparison"))
+ checks)
+ (lambda (a b)
+ (string>? (assoc-ref a "date")
+ (assoc-ref b "date"))))
+ ((first . rest) first)
+ (() #f)))
(and comparison-check
(let ((url-query-params
@@ -68,12 +74,17 @@
(define (patch-series-compare-url series)
(define comparison-check
- (find (lambda (check)
- (string=? (assoc-ref check "context")
- "comparison"))
- (patchwork-patch-checks
- (assoc-ref (first (assoc-ref series "patches"))
- "checks"))))
+ (match (sort (filter (lambda (check)
+ (string=? (assoc-ref check "context")
+ "comparison"))
+ (patchwork-patch-checks
+ (assoc-ref (first (assoc-ref series "patches"))
+ "checks")))
+ (lambda (a b)
+ (string>? (assoc-ref a "date")
+ (assoc-ref b "date"))))
+ ((first . rest) first)
+ (() #f)))
(and comparison-check
(let ((url-query-params