aboutsummaryrefslogtreecommitdiff
path: root/guix-qa-frontpage/guix-data-service.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix-qa-frontpage/guix-data-service.scm')
-rw-r--r--guix-qa-frontpage/guix-data-service.scm45
1 files changed, 32 insertions, 13 deletions
diff --git a/guix-qa-frontpage/guix-data-service.scm b/guix-qa-frontpage/guix-data-service.scm
index 3530d89..d931c3f 100644
--- a/guix-qa-frontpage/guix-data-service.scm
+++ b/guix-qa-frontpage/guix-data-service.scm
@@ -15,7 +15,10 @@
#:use-module (guix-qa-frontpage utils)
#:use-module (guix-qa-frontpage patchwork)
#:use-module (guix-qa-frontpage manage-patch-branches)
- #:export (&guix-data-service-error
+ #:export (%data-service-url-base
+ %data-service-guix-repository-id
+
+ &guix-data-service-error
guix-data-service-error?
guix-data-service-error-response-body
guix-data-service-error-response-code
@@ -54,6 +57,11 @@
package-reproducibility-url))
+(define %data-service-url-base
+ "https://data.qa.guix.gnu.org")
+
+(define %data-service-guix-repository-id 1)
+
(define-exception-type &guix-data-service-error &error
make-guix-data-service-error
guix-data-service-error?
@@ -211,7 +219,8 @@
#:key system target
no-build-from-build-server)
(string-append
- "https://data.qa.guix.gnu.org/revision/"
+ %data-service-url-base
+ "/revision/"
commit
"/package-derivations.json?"
"system=" system
@@ -225,7 +234,8 @@
(define* (compare-package-derivations-url base-and-target-refs #:key systems)
(string-append
- "https://data.qa.guix.gnu.org/compare/package-derivations.json?"
+ %data-service-url-base
+ "/compare/package-derivations.json?"
"base_commit=" (assq-ref base-and-target-refs 'base)
"&target_commit=" (assq-ref base-and-target-refs 'target)
(string-join
@@ -238,7 +248,8 @@
(define* (compare-package-cross-derivations-url base-and-target-refs #:key systems)
(string-append
- "https://data.qa.guix.gnu.org/compare/package-derivations.json?"
+ %data-service-url-base
+ "/compare/package-derivations.json?"
"base_commit=" (assq-ref base-and-target-refs 'base)
"&target_commit=" (assq-ref base-and-target-refs 'target)
(string-join
@@ -257,7 +268,8 @@
(define* (revision-comparison-url base-and-target-refs #:key (json? #t))
(string-append
- "https://data.qa.guix.gnu.org/compare"
+ %data-service-url-base
+ "/compare"
(if json? ".json" "")
"?"
"base_commit=" (assq-ref base-and-target-refs 'base)
@@ -267,7 +279,8 @@
(guix-data-service-request url))
(define (list-branches-url repository-id)
- (simple-format #f "https://data.qa.guix.gnu.org/repository/~A.json"
+ (simple-format #f "~A/repository/~A.json"
+ %data-service-url-base
repository-id))
(define (list-branches url)
@@ -280,8 +293,9 @@
(let ((json-body
(guix-data-service-request
(string-append
- "https://data.qa.guix.gnu.org"
- "/repository/2"
+ %data-service-url-base
+ "/repository/"
+ (number->string %data-service-guix-repository-id)
"/branch/" branch
"/latest-processed-revision.json"))))
(assoc-ref
@@ -291,7 +305,8 @@
(define (branch-revisions-url repository-id branch-name)
(simple-format
#f
- "https://data.qa.guix.gnu.org/repository/~A/branch/~A.json"
+ "~A/repository/~A/branch/~A.json"
+ %data-service-url-base
repository-id
branch-name))
@@ -304,7 +319,8 @@
(define* (revision-details-url commit)
(simple-format
#f
- "https://data.qa.guix.gnu.org/revision/~A.json"
+ "~A/revision/~A.json"
+ %data-service-url-base
commit))
(define (revision-details url)
@@ -313,7 +329,8 @@
(define* (revision-system-tests-url commit #:key (system "x86_64-linux"))
(simple-format
#f
- "https://data.qa.guix.gnu.org/revision/~A/system-tests.json?system=~A"
+ "~A/revision/~A/system-tests.json?system=~A"
+ %data-service-url-base
commit
system))
@@ -326,7 +343,8 @@
(define* (package-substitute-availability-url commit)
(simple-format
#f
- "https://data.qa.guix.gnu.org/revision/~A/package-substitute-availability.json"
+ "~A/revision/~A/package-substitute-availability.json"
+ %data-service-url-base
commit))
(define (package-substitute-availability url)
@@ -339,5 +357,6 @@
(define* (package-reproducibility-url commit)
(simple-format
#f
- "https://data.qa.guix.gnu.org/revision/~A/package-reproducibility.json"
+ "~A/revision/~A/package-reproducibility.json"
+ %data-service-url-base
commit))