forgejo/services/migrations
Sebastian Brückner 542badbb76
Properly migrate automatic merge GitLab comments (#27873)
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 two specific kinds of events: Scheduling and
un-scheduling of automatic merges on a PR. When detected, they are
downloaded using Gitea's type for these events, 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 these two types.

ref:
11bd6dc826/app/services/system_notes/merge_requests_service.rb (L6-L17)

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit a70c00b80bcb5de8479e407f1b8f08dcf756019d)
2024-02-26 22:30:26 +01:00
..
testdata/gitlab [GITEA] Avoid conflicts of issue and PR numbers in GitLab migration (#1790) 2024-02-05 16:09:41 +01:00
codebase.go
codebase_test.go
common.go
dump.go
error.go
forgejo_downloader.go [BRANDING] add Forgejo Git Service and migration UI 2024-02-05 16:05:02 +01:00
forgejo_downloader_test.go [BRANDING] add Forgejo Git Service and migration UI 2024-02-05 16:05:02 +01:00
git.go
gitbucket.go
gitea_downloader.go
gitea_downloader_test.go
gitea_uploader.go Properly migrate automatic merge GitLab comments (#27873) 2024-02-26 22:30:26 +01:00
gitea_uploader_test.go [TESTS] add log.Level to test.NewLogChecker 2024-02-05 16:54:44 +01:00
github.go
github_test.go
gitlab.go Properly migrate automatic merge GitLab comments (#27873) 2024-02-26 22:30:26 +01:00
gitlab_test.go Properly migrate automatic merge GitLab comments (#27873) 2024-02-26 22:30:26 +01:00
gogs.go
gogs_test.go
http_client.go
main_test.go
migrate.go [BRANDING] add Forgejo Git Service and migration UI 2024-02-05 16:05:02 +01:00
migrate_test.go
onedev.go
onedev_test.go
restore.go
update.go