]> source.dussan.org Git - gitea.git/commit
Properly migrate target branch change GitLab comment (#29340)
authorSebastian Brückner <code@nik.dev>
Sat, 24 Feb 2024 07:49:16 +0000 (07:49 +0000)
committerGitHub <noreply@github.com>
Sat, 24 Feb 2024 07:49:16 +0000 (07:49 +0000)
commit6e5966597c2d498d1a8540dad965461d44ff8e57
tree46650a560e88b42edd54ed0c8d5478cc8b4bdce3
parentb79c30435f439af8243ee281310258cdf141e27b
Properly migrate target branch change GitLab comment (#29340)

GitLab generates "system notes" whenever an event happens within the
platform. Unlike Gitea, those events are stored and retrieved as text
comments with no semantic details. The only way to tell whether a
comment was generated in this manner is the `system` flag on the note
type.

This PR adds detection for a new specific kind of event: Changing the
target branch of a PR. When detected, it is downloaded using Gitea's
type for this event, and eventually uploaded into Gitea in the expected
format, i.e. with no text content in the comment.

This PR also updates the template used to render comments to add support
for migrated comments of this type.

ref:
https://gitlab.com/gitlab-org/gitlab/-/blob/11bd6dc826e0bea2832324a1d7356949a9398884/app/services/system_notes/merge_requests_service.rb#L102
services/migrations/gitea_uploader.go
services/migrations/gitlab.go
services/migrations/gitlab_test.go
templates/repo/issue/view_content/comments.tmpl