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:
parent
b24e8d38af
commit
cc643284de
8 changed files with 20 additions and 3 deletions
|
@ -178,7 +178,9 @@ func (c *compareDump) assertEquals(repoBefore, repoAfter *repo_model.Repository)
|
|||
assert.GreaterOrEqual(c.t, len(issues), 1)
|
||||
for _, issue := range issues {
|
||||
filename := filepath.Join("comments", fmt.Sprintf("%d.yml", issue.Number))
|
||||
comments, ok := c.assertEqual(filename, []base.Comment{}, compareFields{}).([]*base.Comment)
|
||||
comments, ok := c.assertEqual(filename, []base.Comment{}, compareFields{
|
||||
"Index": {ignore: true},
|
||||
}).([]*base.Comment)
|
||||
assert.True(c.t, ok)
|
||||
for _, comment := range comments {
|
||||
assert.EqualValues(c.t, issue.Number, comment.IssueIndex)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue