1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-09 03:57:19 +00:00

Include resource state events in Gitlab downloads (#29382)

Some specific events on Gitlab issues and merge requests are stored
separately from comments as "resource state events". With this change,
all relevant resource state events are downloaded during issue and merge
request migration, and converted to comments.

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

ref: https://docs.gitlab.com/ee/api/resource_state_events.html
This commit is contained in:
Sebastian Brückner
2024-02-26 04:08:21 +00:00
committed by GitHub
parent 65952417a8
commit 17f170ee37
4 changed files with 86 additions and 40 deletions

View File

@ -483,6 +483,10 @@ func (g *GiteaLocalUploader) CreateComments(comments ...*base.Comment) error {
}
switch cm.Type {
case issues_model.CommentTypeReopen:
cm.Content = ""
case issues_model.CommentTypeClose:
cm.Content = ""
case issues_model.CommentTypeAssignees:
if assigneeID, ok := comment.Meta["AssigneeID"].(int); ok {
cm.AssigneeID = int64(assigneeID)
@ -503,6 +507,8 @@ func (g *GiteaLocalUploader) CreateComments(comments ...*base.Comment) error {
cm.NewRef = fmt.Sprint(comment.Meta["NewRef"])
cm.Content = ""
}
case issues_model.CommentTypeMergePull:
cm.Content = ""
case issues_model.CommentTypePRScheduledToAutoMerge, issues_model.CommentTypePRUnScheduledToAutoMerge:
cm.Content = ""
default: