From 58b85e4f5eb2272fceab22065b9ad939887f31ae Mon Sep 17 00:00:00 2001 From: Ray Miller Date: Fri, 27 Jun 2025 09:28:20 +0000 Subject: [PATCH] Simplify format of issues in MR descriptions --- anarres/gitlab.scm | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/anarres/gitlab.scm b/anarres/gitlab.scm index 03d6945..a8150a5 100644 --- a/anarres/gitlab.scm +++ b/anarres/gitlab.scm @@ -201,15 +201,10 @@ values strings or #f, in which case the parameter is skipped." (define (get-tag s) (let ((i (string-index s #\:))) (and i (substring s 0 i)))) - (define (format-issue x) - (format #f "* ~a [~a](~a)~%" - (assoc-ref x 'type) - (assoc-ref x 'name) - (assoc-ref x 'url))) (let ((tag (get-tag title)) (issues (if (null? related-issues) "n/a" - (string-join (map format-issue related-issues) "\n"))) + (string-join (map (cut format #f "* ~a~%" <>) related-issues) "\n"))) (s merge-request-template)) (define (tag-selected x) (if (string=? x tag) "X" " ")) (-> s @@ -225,15 +220,15 @@ values strings or #f, in which case the parameter is skipped." (string-replace-substring "@@chore@@" (tag-selected "Chore")) (string-replace-substring "@@issues@@" issues)))) -(define*-public (create-merge-request client - #:key project-path +(define*-public (create-merge-request client #:key + project-path source-branch target-branch title (description "") (related-issues '()) assignee - reviewers + (reviewers '()) (remove-source-branch #t) (squash #t)) (let* ((project-id (get-project-id client project-path))