guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Ludovic Courtès
Date: Fri, 20 Dec 2024 17:06:53 -0500 (EST)

branch: main
commit a1c4eaca3cfbf37ed32f61e8d206decabe86978b
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Dec 20 18:43:38 2024 +0100

    gitlab: Merge <gitlab-source> into <gitlab-project>.
    
    This is the same schema and in fact the same thing.
    
    * src/cuirass/forges/gitlab.scm (<gitlab-source>): Remove.
    (<gitlab-project>)[home-page, repository-url]: New fields.
    (gitlab-merge-request->specification): Adjust accordingly.
    * tests/gitlab.scm (default-mr-json, custom-mr-json-name-prefix): Add
    source “homepage” field.
---
 src/cuirass/forges/gitlab.scm | 20 +++++++-------------
 tests/gitlab.scm              |  2 ++
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/src/cuirass/forges/gitlab.scm b/src/cuirass/forges/gitlab.scm
index 44e0def..fdf4beb 100644
--- a/src/cuirass/forges/gitlab.scm
+++ b/src/cuirass/forges/gitlab.scm
@@ -46,21 +46,15 @@
 ;;;
 ;;; Code:
 
-(define-json-mapping <gitlab-source>
-  make-gitlab-source
-  gitlab-source?
-  json->gitlab-source
-  (repo-url gitlab-source-repo-url "git_http_url")
-  (name     gitlab-source-name "name"
-            string->symbol))
-
 (define-json-mapping <gitlab-project>
   make-gitlab-project
   gitlab-project?
   json->gitlab-project
-  (name    gitlab-project-name "name"
-           string->symbol)
-  (http-url gitlab-project-http-url "http_url"))
+  (name            gitlab-project-name "name"
+                   string->symbol)
+  (home-page       gitlab-project-home-page "homepage")
+  (repository-url  gitlab-project-repository-url "git_http_url")
+  (http-url        gitlab-project-http-url "http_url"))
 
 (define-json-mapping <gitlab-merge-request>
   make-gitlab-merge-request
@@ -69,7 +63,7 @@
   (action          gitlab-merge-request-action "action")
   (source-branch   gitlab-merge-request-source-branch "source_branch")
   (source          gitlab-merge-request-source "source"
-                   json->gitlab-source)
+                   json->gitlab-project)
   (id              gitlab-merge-request-id "iid")
   (url             gitlab-merge-request-url)
   (cuirass-options gitlab-merge-request-cuirass-options "cuirass"
@@ -105,7 +99,7 @@
   "Returns a SPECIFICATION built out of a GITLAB-MERGE-REQUEST."
   (let* ((project-name (gitlab-project-name project))
          (source-branch (gitlab-merge-request-source-branch merge-request))
-         (source-url (gitlab-source-repo-url
+         (source-url (gitlab-project-repository-url
                       (gitlab-merge-request-source merge-request)))
          (id (gitlab-merge-request-id merge-request))
          (cuirass-options (gitlab-merge-request-cuirass-options merge-request))
diff --git a/tests/gitlab.scm b/tests/gitlab.scm
index 27d25b8..59ee6cb 100644
--- a/tests/gitlab.scm
+++ b/tests/gitlab.scm
@@ -48,6 +48,7 @@
         \"source_branch\": \"test-branch\",
         \"source\": {
             \"git_http_url\": 
\"https://gitlab.instance.test/source-repo/fork-name.git\";,
+            \"homepage\": 
\"https://gitlab.instance.test/source-repo/fork-name\";,
             \"name\": \"test-project\"
         },
         \"url\": 
\"https://gitlab.instance.test/source-repo/-/merge_requests/1\";
@@ -146,6 +147,7 @@
         \"source_branch\": \"test-branch\",
         \"source\": {
             \"git_http_url\": 
\"https://gitlab.instance.test/source-repo/fork-name.git\";,
+            \"homepage\": 
\"https://gitlab.instance.test/source-repo/fork-name\";,
             \"name\": \"test-project\"
         },
         \"cuirass\": {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]