diff options
author | Michael Muré <batolettre@gmail.com> | 2020-03-28 17:06:33 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-03-28 17:06:33 +0100 |
commit | 8389df0711dbd5cb13b187fa31ce0dbd5c781460 (patch) | |
tree | 565cccb3d53729ea790b0b594b8eb35ef66bb140 | |
parent | 49285b03c9f255e5205e585e30ff61c87cb548ad (diff) | |
download | git-bug-8389df0711dbd5cb13b187fa31ce0dbd5c781460.tar.gz |
gitlab: match bugs on IDs + baseURL because the URL is not stable
-rw-r--r-- | bridge/gitlab/import.go | 7 |
1 files changed, 6 insertions, 1 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 } |