Simplify format of issues in MR descriptions

This commit is contained in:
Ray Miller 2025-06-27 09:28:20 +00:00
parent 3816a547fe
commit 58b85e4f5e

View file

@ -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))