diff options
Diffstat (limited to 'bridge/gitlab')
-rw-r--r-- | bridge/gitlab/import.go | 7 | ||||
-rw-r--r-- | bridge/gitlab/import_test.go | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go index 5ed5f0e3..0a47a783 100644 --- a/bridge/gitlab/import.go +++ b/bridge/gitlab/import.go @@ -123,7 +123,12 @@ func (gi *gitlabImporter) ensureIssue(repo *cache.RepoCache, issue *gitlab.Issue } // resolve bug - b, err := repo.ResolveBugCreateMetadata(metaKeyGitlabUrl, issue.WebURL) + b, err := repo.ResolveBugMatcher(func(excerpt *cache.BugExcerpt) bool { + return excerpt.CreateMetadata[core.MetaKeyOrigin] == target && + excerpt.CreateMetadata[metaKeyGitlabId] == parseID(issue.IID) && + excerpt.CreateMetadata[metaKeyGitlabBaseUrl] == gi.conf[confKeyProjectID] && + excerpt.CreateMetadata[metaKeyGitlabProject] == gi.conf[confKeyGitlabBaseUrl] + }) if err == nil { return b, nil } diff --git a/bridge/gitlab/import_test.go b/bridge/gitlab/import_test.go index f916d20c..42a37cda 100644 --- a/bridge/gitlab/import_test.go +++ b/bridge/gitlab/import_test.go @@ -29,7 +29,7 @@ func TestImport(t *testing.T) { }{ { name: "simple issue", - url: "https://gitlab.com/git-bug/test/issues/1", + url: "https://gitlab.com/git-bug/test/-/issues/1", bug: &bug.Snapshot{ Operations: []bug.Operation{ bug.NewCreateOp(author, 0, "simple issue", "initial comment", nil), @@ -40,7 +40,7 @@ func TestImport(t *testing.T) { }, { name: "empty issue", - url: "https://gitlab.com/git-bug/test/issues/2", + url: "https://gitlab.com/git-bug/test/-/issues/2", bug: &bug.Snapshot{ Operations: []bug.Operation{ bug.NewCreateOp(author, 0, "empty issue", "", nil), @@ -49,7 +49,7 @@ func TestImport(t *testing.T) { }, { name: "complex issue", - url: "https://gitlab.com/git-bug/test/issues/3", + url: "https://gitlab.com/git-bug/test/-/issues/3", bug: &bug.Snapshot{ Operations: []bug.Operation{ bug.NewCreateOp(author, 0, "complex issue", "initial comment", nil), @@ -66,7 +66,7 @@ func TestImport(t *testing.T) { }, { name: "editions", - url: "https://gitlab.com/git-bug/test/issues/4", + url: "https://gitlab.com/git-bug/test/-/issues/4", bug: &bug.Snapshot{ Operations: []bug.Operation{ bug.NewCreateOp(author, 0, "editions", "initial comment edited", nil), |