diff options
author | Michael Muré <batolettre@gmail.com> | 2022-11-15 12:25:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 12:25:48 +0100 |
commit | 9b393b487308da156c5988bb7c2d2747f7b7f8aa (patch) | |
tree | 8cf4307bf48f016e0f8728c311bcc53ce38432e3 /bridge/gitlab/import.go | |
parent | 55a2e8e4485fe63fbda759540958c7190dfeb85c (diff) | |
parent | 3c6ebc2bfd50b72ff786a2cfd3bbdeb15b478dd3 (diff) | |
download | git-bug-9b393b487308da156c5988bb7c2d2747f7b7f8aa.tar.gz |
Merge pull request #913 from MichaelMure/comment-id-fix
core: bubble up the comment ID when created, or edited the first comment
Diffstat (limited to 'bridge/gitlab/import.go')
-rw-r--r-- | bridge/gitlab/import.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go index cf6b5ca6..c7909c8f 100644 --- a/bridge/gitlab/import.go +++ b/bridge/gitlab/import.go @@ -178,7 +178,7 @@ func (gi *gitlabImporter) ensureIssueEvent(repo *cache.RepoCache, b *cache.BugCa return err } - gi.out <- core.NewImportStatusChange(op.Id()) + gi.out <- core.NewImportStatusChange(b.Id(), op.Id()) case EventReopened: if errResolve == nil { @@ -196,7 +196,7 @@ func (gi *gitlabImporter) ensureIssueEvent(repo *cache.RepoCache, b *cache.BugCa return err } - gi.out <- core.NewImportStatusChange(op.Id()) + gi.out <- core.NewImportStatusChange(b.Id(), op.Id()) case EventDescriptionChanged: firstComment := b.Snapshot().Comments[0] @@ -219,7 +219,7 @@ func (gi *gitlabImporter) ensureIssueEvent(repo *cache.RepoCache, b *cache.BugCa return err } - gi.out <- core.NewImportTitleEdition(op.Id()) + gi.out <- core.NewImportTitleEdition(b.Id(), op.Id()) } case EventComment: @@ -229,7 +229,7 @@ func (gi *gitlabImporter) ensureIssueEvent(repo *cache.RepoCache, b *cache.BugCa if errResolve == cache.ErrNoMatchingOp { // add comment operation - op, err := b.AddCommentRaw( + commentId, _, err := b.AddCommentRaw( author, event.CreatedAt().Unix(), cleanText, @@ -241,7 +241,7 @@ func (gi *gitlabImporter) ensureIssueEvent(repo *cache.RepoCache, b *cache.BugCa if err != nil { return err } - gi.out <- core.NewImportComment(op.Id()) + gi.out <- core.NewImportComment(b.Id(), commentId) return nil } @@ -256,7 +256,7 @@ func (gi *gitlabImporter) ensureIssueEvent(repo *cache.RepoCache, b *cache.BugCa // compare local bug comment with the new event body if comment.Message != cleanText { // comment edition - op, err := b.EditCommentRaw( + _, err := b.EditCommentRaw( author, event.(NoteEvent).UpdatedAt.Unix(), comment.CombinedId(), @@ -267,7 +267,7 @@ func (gi *gitlabImporter) ensureIssueEvent(repo *cache.RepoCache, b *cache.BugCa if err != nil { return err } - gi.out <- core.NewImportCommentEdition(op.Id()) + gi.out <- core.NewImportCommentEdition(b.Id(), comment.CombinedId()) } return nil @@ -290,7 +290,7 @@ func (gi *gitlabImporter) ensureIssueEvent(repo *cache.RepoCache, b *cache.BugCa return err } - gi.out <- core.NewImportTitleEdition(op.Id()) + gi.out <- core.NewImportTitleEdition(b.Id(), op.Id()) case EventAddLabel: _, err = b.ForceChangeLabelsRaw( |