aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2025-02-27 15:05:55 +0000
committerChristopher Baines <mail@cbaines.net>2025-02-27 15:05:55 +0000
commit479c9864ade372f5b3a2dfcb774f8471f9f472b0 (patch)
treee7f6859d17098172dfebdf5fd8ea8de68ac62207
parentd4bd4e943eb2312df68b5df9d0a2a83c0b1897ff (diff)
downloadqa-frontpage-479c9864ade372f5b3a2dfcb774f8471f9f472b0.tar
qa-frontpage-479c9864ade372f5b3a2dfcb774f8471f9f472b0.tar.gz
Use an appropriate URL for the patches repository
Fixes an issue identified by NoƩ Lopez, since people attempting to run QA locally won't have SSH access to the patches Git repository, a https url should be used instead.
-rw-r--r--guix-qa-frontpage/git-repository.scm24
-rw-r--r--scripts/guix-qa-frontpage.in2
2 files changed, 25 insertions, 1 deletions
diff --git a/guix-qa-frontpage/git-repository.scm b/guix-qa-frontpage/git-repository.scm
index 6ff3eb2..15f8fec 100644
--- a/guix-qa-frontpage/git-repository.scm
+++ b/guix-qa-frontpage/git-repository.scm
@@ -14,6 +14,7 @@
#:use-module (guix build utils)
#:use-module ((guix build utils) #:select (with-directory-excursion))
#:export (%git-repository-location
+ %git-repository-patches-remote-use-ssh?
ensure-repository-exists!
update-repository!
@@ -29,6 +30,15 @@
(define %git-repository-location
(make-parameter #f))
+(define %git-repository-patches-remote-use-ssh?
+ (make-parameter #f))
+
+(define* (patches-repository-remote-url
+ #:key (use-ssh? (%git-repository-patches-remote-use-ssh?)))
+ (if use-ssh?
+ "git@git.qa.guix.gnu.org:guix-patches"
+ "https://git.qa.guix.gnu.org/git/guix-patches"))
+
(define* (guix.git-excursion thunk #:optional dir)
(when (current-scheduler)
(error "guix.git-excursion can't be used from fibers"))
@@ -51,12 +61,24 @@
(invoke "git" "remote" "add" "origin"
"https://git.savannah.gnu.org/git/guix.git")
(invoke "git" "remote" "add" "patches"
- "git@git.qa.guix.gnu.org:guix-patches")
+ (patches-repository-remote-url))
(invoke "git" "config" "user.name" "Guix Patches Tester")
(invoke "git" "config" "user.email" "")))))))
(define (update-repository!)
+ (let* ((repo (repository-open (%git-repository-location)))
+ (patches-remote
+ (remote-lookup repo "patches"))
+ (current-patches-url
+ (remote-url patches-remote)))
+ (unless (string=?
+ (patches-repository-remote-url)
+ current-patches-url)
+ (remote-set-url! repo
+ "patches"
+ (patches-repository-remote-url))))
+
(with-bare-git-repository
(lambda ()
(invoke "git" "prune")
diff --git a/scripts/guix-qa-frontpage.in b/scripts/guix-qa-frontpage.in
index 4e1aa2e..7f070ee 100644
--- a/scripts/guix-qa-frontpage.in
+++ b/scripts/guix-qa-frontpage.in
@@ -268,6 +268,8 @@
(with-fluids ((%file-port-name-canonicalization 'none))
(parameterize
((%git-repository-location (string-append (getcwd) "/guix.git"))
+ (%git-repository-patches-remote-use-ssh?
+ (assq-ref opts 'manage-patch-branches))
(%patchwork-series-default-count patch-issues-to-show))
(let* ((metrics-registry (make-metrics-registry
#:namespace