aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/gitlab/import.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-03-28 17:06:33 +0100
committerMichael Muré <batolettre@gmail.com>2020-03-28 17:06:33 +0100
commit8389df0711dbd5cb13b187fa31ce0dbd5c781460 (patch)
tree565cccb3d53729ea790b0b594b8eb35ef66bb140 /bridge/gitlab/import.go
parent49285b03c9f255e5205e585e30ff61c87cb548ad (diff)
downloadgit-bug-8389df0711dbd5cb13b187fa31ce0dbd5c781460.tar.gz
gitlab: match bugs on IDs + baseURL because the URL is not stable
Diffstat (limited to 'bridge/gitlab/import.go')
-rw-r--r--bridge/gitlab/import.go7
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
}