aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-02-17 17:46:32 +0000
committerChristopher Baines <mail@cbaines.net>2023-02-17 17:46:32 +0000
commit9ecef359dfe3dd1edf289165384708183fe3278d (patch)
tree10968489635f42b4af4361031afd0ee22e3886c2
parentd8003e4d93d3d94f641109d0553be675005fdfbd (diff)
downloadqa-frontpage-9ecef359dfe3dd1edf289165384708183fe3278d.tar
qa-frontpage-9ecef359dfe3dd1edf289165384708183fe3278d.tar.gz
Tweak and join up how many patch series are processed
By different parts of the code.
-rw-r--r--guix-qa-frontpage/manage-builds.scm9
-rw-r--r--guix-qa-frontpage/manage-patch-branches.scm5
-rw-r--r--guix-qa-frontpage/server.scm19
-rw-r--r--scripts/guix-qa-frontpage.in19
4 files changed, 34 insertions, 18 deletions
diff --git a/guix-qa-frontpage/manage-builds.scm b/guix-qa-frontpage/manage-builds.scm
index ccbfed5..2bc9268 100644
--- a/guix-qa-frontpage/manage-builds.scm
+++ b/guix-qa-frontpage/manage-builds.scm
@@ -26,9 +26,10 @@
"powerpc64le-linux"
"i586-gnu"))
-(define (start-submit-patch-builds-thread database
- build-coordinator
- guix-data-service)
+(define* (start-submit-patch-builds-thread database
+ build-coordinator
+ guix-data-service
+ #:key (series-count 200))
(define (priority-for-change change)
(if (member (assoc-ref change "system")
'("x86_64-linux" "aarch64-linux"))
@@ -101,7 +102,7 @@
#:priority priority-for-change))))
(simple-format #t "no derivation changes url for issue ~A\n"
issue-number)))))
- (take series 150))))
+ (take series series-count))))
(call-with-new-thread
(lambda ()
diff --git a/guix-qa-frontpage/manage-patch-branches.scm b/guix-qa-frontpage/manage-patch-branches.scm
index a03b3dc..c15f843 100644
--- a/guix-qa-frontpage/manage-patch-branches.scm
+++ b/guix-qa-frontpage/manage-patch-branches.scm
@@ -204,7 +204,8 @@
#:unwind? #t))
#:remove-after? #t)))
-(define (start-manage-patch-branches-thread database)
+(define* (start-manage-patch-branches-thread database
+ #:key (series-count 200))
(define (dig alist . parts)
(if (pair? alist)
(match parts
@@ -272,7 +273,7 @@
(series-to-create-branches-for
(let ((recent-series
(take all-patchwork-series
- 200)))
+ series-count)))
(append
recent-series
(filter-map
diff --git a/guix-qa-frontpage/server.scm b/guix-qa-frontpage/server.scm
index 44a09ae..32c812c 100644
--- a/guix-qa-frontpage/server.scm
+++ b/guix-qa-frontpage/server.scm
@@ -53,7 +53,8 @@
start-refresh-patch-branches-data-thread
start-refresh-non-patch-branches-data-thread))
-(define (make-controller assets-directory database metrics-registry)
+(define* (make-controller assets-directory database metrics-registry
+ #:key (patch-issues-to-show 200))
(define handle-static-assets
(if (string-prefix? (%store-prefix)
@@ -172,8 +173,8 @@
(render-html
#:sxml
(patches-view (if (> (length sorted-latest-series)
- 200)
- (take sorted-latest-series 200)
+ patch-issues-to-show)
+ (take sorted-latest-series patch-issues-to-show)
sorted-latest-series)))))
(('GET "issue" (? (lambda (s) (string-suffix? ".svg" s)) number.svg))
(let* ((number
@@ -418,9 +419,11 @@ has no patches or has been closed.")
#:code 500))))
(define* (start-guix-qa-frontpage-web-server port host assets-directory
- database metrics-registry)
+ database metrics-registry
+ #:key (controller-args '()))
(define controller
- (make-controller assets-directory database metrics-registry))
+ (apply make-controller assets-directory database metrics-registry
+ controller-args))
(call-with-error-handling
(lambda ()
@@ -442,8 +445,10 @@ Check if it's already running, or whether another process is using that
port. Also, the port used can be changed by passing the --port option.\n"
port)))))))
-(define (start-refresh-patch-branches-data-thread database)
- (define number-of-series-to-refresh 250)
+(define* (start-refresh-patch-branches-data-thread
+ database
+ #:key
+ (number-of-series-to-refresh 250))
(define (refresh-data)
(simple-format (current-error-port)
diff --git a/scripts/guix-qa-frontpage.in b/scripts/guix-qa-frontpage.in
index 5cc5b5f..d60c711 100644
--- a/scripts/guix-qa-frontpage.in
+++ b/scripts/guix-qa-frontpage.in
@@ -119,15 +119,22 @@
"guixqafrontpage"))
(database
(setup-database (assq-ref opts 'database)
- metrics-registry)))
+ metrics-registry))
- (start-refresh-patch-branches-data-thread database)
+ (patch-issues-to-show 200))
+
+ (start-refresh-patch-branches-data-thread
+ database
+ #:number-of-series-to-refresh
+ (+ patch-issues-to-show 10))
(start-refresh-non-patch-branches-data-thread database)
(when (assq-ref opts 'submit-builds)
(start-submit-patch-builds-thread database
"http://127.0.0.1:8746"
- "https://data.qa.guix.gnu.org")
+ "https://data.qa.guix.gnu.org"
+ #:series-count
+ patch-issues-to-show)
(start-submit-branch-builds-thread database
"http://127.0.0.1:8746"
"https://data.qa.guix.gnu.org")
@@ -136,11 +143,13 @@
"https://data.qa.guix.gnu.org"))
(when (assq-ref opts 'manage-patch-branches)
- (start-manage-patch-branches-thread database))
+ (start-manage-patch-branches-thread database
+ #:series-count patch-issues-to-show))
(start-guix-qa-frontpage-web-server
(assq-ref opts 'port)
(assq-ref opts 'host)
(assq-ref opts 'assets-directory)
database
- metrics-registry))))
+ metrics-registry
+ #:controller-args `(#:patch-issues-to-show ,patch-issues-to-show)))))