mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-22 17:48:23 +08: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:
@ -532,6 +532,7 @@ func (g *GithubDownloaderV3) getComments(issueContext base.IssueContext) ([]*bas
|
||||
|
||||
allComments = append(allComments, &base.Comment{
|
||||
IssueIndex: issueContext.LocalID(),
|
||||
Index: comment.GetID(),
|
||||
PosterID: comment.GetUser().GetID(),
|
||||
PosterName: comment.GetUser().GetLogin(),
|
||||
PosterEmail: comment.GetUser().GetEmail(),
|
||||
@ -607,6 +608,7 @@ func (g *GithubDownloaderV3) GetAllComments(page, perPage int) ([]*base.Comment,
|
||||
issueIndex, _ := strconv.ParseInt((*comment.IssueURL)[idx+1:], 10, 64)
|
||||
allComments = append(allComments, &base.Comment{
|
||||
IssueIndex: issueIndex,
|
||||
Index: comment.GetID(),
|
||||
PosterID: comment.GetUser().GetID(),
|
||||
PosterName: comment.GetUser().GetLogin(),
|
||||
PosterEmail: comment.GetUser().GetEmail(),
|
||||
|
Reference in New Issue
Block a user