mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
Add Index to comment for migrations and mirroring (#18806)
Comments have an id (see Gitea[0], GitLab[1], GitHub[2], etc.), and the comment migration format must represent it during migrations so that it can be used during mirroring or incremental migrations. [0] https://try.gitea.io/api/swagger#/issue/issueGetComment [1] https://docs.gitlab.com/ee/api/discussions.html#get-single-issue-discussion-item [2] https://docs.github.com/en/rest/reference/issues#get-an-issue-comment Signed-off-by: Loïc Dachary <loic@dachary.org> Co-authored-by: Loïc Dachary <loic@dachary.org>
This commit is contained in:
@ -485,6 +485,7 @@ func (g *GitlabDownloader) GetComments(opts base.GetCommentOptions) ([]*base.Com
|
||||
for _, note := range comment.Notes {
|
||||
allComments = append(allComments, &base.Comment{
|
||||
IssueIndex: context.LocalID(),
|
||||
Index: int64(note.ID),
|
||||
PosterID: int64(note.Author.ID),
|
||||
PosterName: note.Author.Username,
|
||||
PosterEmail: note.Author.Email,
|
||||
@ -496,6 +497,7 @@ func (g *GitlabDownloader) GetComments(opts base.GetCommentOptions) ([]*base.Com
|
||||
c := comment.Notes[0]
|
||||
allComments = append(allComments, &base.Comment{
|
||||
IssueIndex: context.LocalID(),
|
||||
Index: int64(c.ID),
|
||||
PosterID: int64(c.Author.ID),
|
||||
PosterName: c.Author.Username,
|
||||
PosterEmail: c.Author.Email,
|
||||
|
Reference in New Issue
Block a user