diff --git a/src/main/gitlab/base.lisp b/src/main/gitlab/base.lisp --- a/src/main/gitlab/base.lisp +++ b/src/main/gitlab/base.lisp @@ -78,6 +78,12 @@ Useful to create backlinks to the previous system, or addition migration information") +(defvar *snippet-suffix* nil + "A function that takes an argument of a forgerie-core:snippet and + returns a string that will be appended to the description of created snippets (pastes). + + Useful to create backlinks to the previous system, or addition migration information") + (defvar *limit-to-active-users* nil "If non nil, will only add users to the gitlab instance if they are active in the items also coming over for processing. Useful when doing piecemeal conversions.") diff --git a/src/main/gitlab/export.lisp b/src/main/gitlab/export.lisp --- a/src/main/gitlab/export.lisp +++ b/src/main/gitlab/export.lisp @@ -1133,7 +1133,11 @@ (let ((content (with-open-file (str (forgerie-core:file-location file) :element-type 'unsigned-byte) - (let ((seq (make-sequence 'vector (file-length str)))) (read-sequence seq str) (trivial-utf-8:utf-8-bytes-to-string seq))))) + (let ((seq (make-sequence 'vector (file-length str)))) + (read-sequence seq str) + (trivial-utf-8:utf-8-bytes-to-string seq)))) + () + ) (post-request (format nil "/projects/~A/snippets" (getf default-project :id)) ; This is deprecated, but it's an easier interface for now. Someday we may have @@ -1143,6 +1147,7 @@ ; See https://docs.gitlab.com/ee/api/snippets.html#create-new-snippet `(("title" . ,(or (forgerie-core:snippet-title snippet) "Forgerie Generated Title")) ("content" . ,content) + ("description" . ,(when *snippet-suffix* (funcall *snippet-suffix* (forgerie-core:snippet-id snippet)))) ("visibility" . ,(if (forgerie-core:snippet-private snippet) "private" "public")) ("file_name" . ,(forgerie-core:file-name file)))))) (error (e) diff --git a/src/main/gitlab/package.lisp b/src/main/gitlab/package.lisp --- a/src/main/gitlab/package.lisp +++ b/src/main/gitlab/package.lisp @@ -2,4 +2,5 @@ (:export #:*private-token* #:*server-address* #:*default-project* #:*ssh-public-key* #:*default-group* #:*group-structure* #:*single-project* #:*rails-command* #:*rails-command-args* - #:*namespace-for-repo* #:*merge-request-suffix* #:*ticket-suffix* #:*limit-to-active-users*)) + #:*namespace-for-repo* #:*merge-request-suffix* #:*ticket-suffix* #:*limit-to-active-users* + #:*snippet-suffix*))