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 Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
codebase_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
common.go Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00
dump.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
error.go Bump google/go-github to v57 (#28514) 2023-12-18 15:42:04 -06:00
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 Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
gitbucket.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
gitea_downloader.go Fix DownloadFunc when migrating releases (#27887) 2023-11-03 15:56:53 +08:00
gitea_downloader_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
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 Bump google/go-github to v57 (#28514) 2023-12-18 15:42:04 -06:00
github_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
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 Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
gogs_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
http_client.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
migrate.go [BRANDING] add Forgejo Git Service and migration UI 2024-02-05 16:05:02 +01:00
migrate_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
onedev.go Replace interface{} with any (#25686) 2023-07-04 18:36:08 +00:00
onedev_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
restore.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
update.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00