GNU bug report logs -
#78109
[PATCH Cuirass 0/3] Configuration of a Guix mirror.
Previous Next
To reply to this bug, email your comments to 78109 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#78109
; Package
guix-patches
.
(Mon, 28 Apr 2025 10:05:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Romain GARBAGE <romain.garbage <at> inria.fr>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Mon, 28 Apr 2025 10:05:06 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
This patch series adds support for configuring a Guix mirror in
forge-related specifications, that are generated automatically.
Romain GARBAGE (3):
parameters: Add %guix-mirror-url.
forges: Add %default-forges-channels.
forges: Use %default-forges-channels instead of %default-channels.
src/cuirass/forges.scm | 17 ++++++++++++++++-
src/cuirass/forges/forgejo.scm | 2 +-
src/cuirass/forges/gitlab.scm | 2 +-
src/cuirass/parameters.scm | 8 +++++++-
tests/forgejo.scm | 2 +-
tests/forges-notification.scm | 7 ++++---
tests/forges.scm | 11 ++++++++++-
tests/gitlab.scm | 10 +++++-----
8 files changed, 45 insertions(+), 14 deletions(-)
base-commit: 91549453f00466e3778a1ceb191de11f5c94ef84
--
2.49.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#78109
; Package
guix-patches
.
(Mon, 28 Apr 2025 10:10:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 78109 <at> debbugs.gnu.org (full text, mbox):
* src/cuirass/parameters.scm (%guix-mirror-url): New variable.
---
src/cuirass/parameters.scm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/cuirass/parameters.scm b/src/cuirass/parameters.scm
index 2f28dcc..4edfc19 100644
--- a/src/cuirass/parameters.scm
+++ b/src/cuirass/parameters.scm
@@ -32,7 +32,9 @@
%mastodon-instance-url
%mastodon-instance-token
- %forgejo-notification-type))
+ %forgejo-notification-type
+
+ %guix-mirror-url))
;; This variable is looked up by 'mu-message-send'.
(define-public mu-debug 0)
@@ -78,3 +80,7 @@
;; The type of notification to send to a Forgejo server.
(define %forgejo-notification-type
(make-parameter 'create-review))
+
+;; The URL of a Guix mirror.
+(define %guix-mirror-url
+ (make-parameter #f))
base-commit: 91549453f00466e3778a1ceb191de11f5c94ef84
--
2.49.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#78109
; Package
guix-patches
.
(Mon, 28 Apr 2025 10:10:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 78109 <at> debbugs.gnu.org (full text, mbox):
* src/cuirass/forges.scm (%default-forges-channels): New variable.
* tests/forges.scm: Add test for %default-forges-channels.
---
src/cuirass/forges.scm | 17 ++++++++++++++++-
tests/forges.scm | 11 ++++++++++-
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/cuirass/forges.scm b/src/cuirass/forges.scm
index aeebbec..c5741d5 100644
--- a/src/cuirass/forges.scm
+++ b/src/cuirass/forges.scm
@@ -18,7 +18,9 @@
(define-module (cuirass forges)
#:use-module ((guix utils) #:select (%current-system))
+ #:use-module (guix channels)
#:use-module (cuirass config)
+ #:use-module (cuirass parameters)
#:use-module (cuirass specification)
#:use-module (cuirass logging)
#:use-module (json)
@@ -38,7 +40,9 @@
jobset-options-systems
forge-get-token
- %forge-token-directory))
+ %forge-token-directory
+
+ %default-forges-channels))
;;; Commentary:
;;;
@@ -143,3 +147,14 @@ both strings. As an exemple, a token for a Git repository located at
(if (unspecified? v)
#f
(vector->list v)))))
+
+;; This expands %DEFAULT-CHANNELS to take into account mirror setting.
+(define (%default-forges-channels)
+ (map (lambda (c)
+ (if (and (%guix-mirror-url)
+ (eq? (channel-name c) 'guix))
+ (channel
+ (inherit c)
+ (url (%guix-mirror-url)))
+ c))
+ %default-channels))
diff --git a/tests/forges.scm b/tests/forges.scm
index 86556da..258addc 100644
--- a/tests/forges.scm
+++ b/tests/forges.scm
@@ -16,7 +16,10 @@
;;; You should have received a copy of the GNU General Public License
;;; along with Cuirass. If not, see <http://www.gnu.org/
-(use-modules (cuirass forges))
+(use-modules (cuirass forges)
+ (cuirass parameters)
+ (guix channels)
+ (srfi srfi-1))
(parameterize ((%forge-token-directory (mkdtemp "/tmp/cuirass-tokens-XXXXXX")))
(call-with-output-file (pk 'file (string-append (pk 'tmp (%forge-token-directory))
@@ -35,3 +38,9 @@
(test-equal "forge-get-token: non-existing server file"
#f
(forge-get-token "non-existing" "namespace")))
+
+(parameterize ((%guix-mirror-url "https://codeberg.org/guix/guix-mirror.git"))
+ (test-equal "%default-forges-channels honors %guix-mirror-url"
+ '("https://codeberg.org/guix/guix-mirror.git")
+ (map channel-url
+ (%default-forges-channels))))
--
2.49.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#78109
; Package
guix-patches
.
(Mon, 28 Apr 2025 10:10:04 GMT)
Full text and
rfc822 format available.
Message #14 received at 78109 <at> debbugs.gnu.org (full text, mbox):
* src/cuirass/forges/forgejo.scm (forgejo-pull-request->specification), src/cuirass/forges/gitlab.scm (gitlab-merge-request->specification): Use %default-forges-channels instead of %default-channels.
* tests/forgejo.scm, tests/forges-notification.scm, tests/gitlab.scm : Update tests.
---
src/cuirass/forges/forgejo.scm | 2 +-
src/cuirass/forges/gitlab.scm | 2 +-
tests/forgejo.scm | 2 +-
tests/forges-notification.scm | 7 ++++---
tests/gitlab.scm | 10 +++++-----
5 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/cuirass/forges/forgejo.scm b/src/cuirass/forges/forgejo.scm
index 42fa3f3..bbda806 100644
--- a/src/cuirass/forges/forgejo.scm
+++ b/src/cuirass/forges/forgejo.scm
@@ -168,7 +168,7 @@
(name project-name)
(url source-url)
(branch source-branch))
- %default-channels))
+ (%default-forges-channels)))
(priority priority)
(period period)
(systems systems)
diff --git a/src/cuirass/forges/gitlab.scm b/src/cuirass/forges/gitlab.scm
index ced8907..922ace0 100644
--- a/src/cuirass/forges/gitlab.scm
+++ b/src/cuirass/forges/gitlab.scm
@@ -139,7 +139,7 @@
(name project-name)
(url source-url)
(branch source-branch))
- %default-channels))
+ (%default-forges-channels)))
(priority priority)
(period period)
(systems systems)
diff --git a/tests/forgejo.scm b/tests/forgejo.scm
index 6b3e0dd..22d4f70 100644
--- a/tests/forgejo.scm
+++ b/tests/forgejo.scm
@@ -88,7 +88,7 @@
(name 'project-name)
(url "https://forgejo.instance.test/source-repo/fork-name.git")
(branch "test-branch"))
- %default-channels))
+ (%default-forges-channels)))
(priority %default-jobset-options-priority)
(period %default-jobset-options-period)
(systems %default-jobset-options-systems)
diff --git a/tests/forges-notification.scm b/tests/forges-notification.scm
index fff10ee..fa673f4 100644
--- a/tests/forges-notification.scm
+++ b/tests/forges-notification.scm
@@ -17,6 +17,7 @@
;;; along with Cuirass. If not, see <http://www.gnu.org/
(use-modules (cuirass forges notification)
+ (cuirass forges)
(cuirass specification)
(cuirass tests http)
(fibers)
@@ -34,7 +35,7 @@
(name 'project-name)
(url "https://instance.local/path/to/channel")
(branch "test-branch"))
- %default-channels)))))
+ (%default-forges-channels))))))
(run-fibers (lambda ()
(spawn-forge-notification-service spec)))))
@@ -48,7 +49,7 @@
(name 'project-name)
(url "https://instance.local/path/to/channel")
(branch "test-branch"))
- %default-channels))
+ (%default-forges-channels)))
(properties '((forge-type . unsupported-forge))))))
(run-fibers (lambda ()
(spawn-forge-notification-service spec)))))
@@ -65,7 +66,7 @@
(name 'project-name)
(url "https://instance.local/path/to/channel")
(branch "test-branch"))
- %default-channels))
+ (%default-forges-channels)))
(properties `((forge-type . ,forge-type)))))
(channel (make-channel))
(%handler-values '())
diff --git a/tests/gitlab.scm b/tests/gitlab.scm
index 1e29f73..89331e1 100644
--- a/tests/gitlab.scm
+++ b/tests/gitlab.scm
@@ -208,7 +208,7 @@
(name 'project-name)
(url "https://gitlab.instance.test/source-repo/fork-name.git")
(branch "test-branch"))
- %default-channels))
+ (%default-forges-channels)))
(priority %default-jobset-options-priority)
(period %default-jobset-options-period)
(systems %default-jobset-options-systems)
@@ -232,7 +232,7 @@
(name 'project-name)
(url "https://gitlab.instance.test/source-repo/fork-name.git")
(branch "test-branch"))
- %default-channels))
+ (%default-forges-channels)))
(priority 3)
(period 25)
(systems (list "x86_64-linux"
@@ -257,7 +257,7 @@
(name 'project-name)
(url "https://gitlab.instance.test/source-repo/fork-name.git")
(branch "test-branch"))
- %default-channels))
+ (%default-forges-channels)))
(priority %default-jobset-options-priority)
(period %default-jobset-options-period)
(systems %default-jobset-options-systems)
@@ -281,7 +281,7 @@
(name 'project-name)
(url "https://gitlab.instance.test/source-repo/fork-name.git")
(branch "test-branch"))
- %default-channels))
+ (%default-forges-channels)))
(priority %default-jobset-options-priority)
(period %default-jobset-options-period)
(systems %default-jobset-options-systems)
@@ -305,7 +305,7 @@
(name 'project-name)
(url "https://gitlab.instance.test/source-repo/fork-name.git")
(branch "test-branch"))
- %default-channels))
+ (%default-forges-channels)))
(priority 3)
(period 25)
(systems (list "x86_64-linux"
--
2.49.0
This bug report was last modified 5 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.