mirror of
https://github.com/go-gitea/gitea
synced 2025-12-07 13:28:25 +00:00
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: https://gitlab.com/gitlab-org/gitlab/-/blob/11bd6dc826e0bea2832324a1d7356949a9398884/app/services/system_notes/merge_requests_service.rb#L6-L17 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e9b13732f3
commit
a70c00b80b
@@ -487,6 +487,8 @@ func (g *GiteaLocalUploader) CreateComments(comments ...*base.Comment) error {
|
||||
if comment.Meta["NewTitle"] != nil {
|
||||
cm.NewTitle = fmt.Sprintf("%s", comment.Meta["NewTitle"])
|
||||
}
|
||||
case issues_model.CommentTypePRScheduledToAutoMerge, issues_model.CommentTypePRUnScheduledToAutoMerge:
|
||||
cm.Content = ""
|
||||
default:
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user