aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/jira
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-03-28 17:11:16 +0100
committerGitHub <noreply@github.com>2020-03-28 17:11:16 +0100
commit58abc6b0a35b679ac0c34579ff1cb53c8fa71af4 (patch)
treea2a9556a580d21f1850c06eeb591a44acc0d2373 /bridge/jira
parent5491d12873732d05d2f08cfe784985eee6e41a20 (diff)
parenta8666bfeb8255c2a0a9eed55ba143d65237febbf (diff)
downloadgit-bug-58abc6b0a35b679ac0c34579ff1cb53c8fa71af4.tar.gz
Merge pull request #358 from MichaelMure/gitlab-tests
gitlab: fix issues import url
Diffstat (limited to 'bridge/jira')
-rw-r--r--bridge/jira/import.go12
-rw-r--r--bridge/jira/jira.go1
2 files changed, 12 insertions, 1 deletions
diff --git a/bridge/jira/import.go b/bridge/jira/import.go
index 3d6d5414..b66b0fa3 100644
--- a/bridge/jira/import.go
+++ b/bridge/jira/import.go
@@ -216,7 +216,16 @@ func (ji *jiraImporter) ensureIssue(repo *cache.RepoCache, issue Issue) (*cache.
return nil, err
}
- b, err := repo.ResolveBugCreateMetadata(metaKeyJiraId, issue.ID)
+ b, err := repo.ResolveBugMatcher(func(excerpt *cache.BugExcerpt) bool {
+ if _, ok := excerpt.CreateMetadata[metaKeyJiraBaseUrl]; ok &&
+ excerpt.CreateMetadata[metaKeyJiraBaseUrl] != ji.conf[confKeyBaseUrl] {
+ return false
+ }
+
+ return excerpt.CreateMetadata[core.MetaKeyOrigin] == target &&
+ excerpt.CreateMetadata[metaKeyJiraId] == issue.ID &&
+ excerpt.CreateMetadata[metaKeyJiraProject] == ji.conf[confKeyProject]
+ })
if err != nil && err != bug.ErrBugNotExist {
return nil, err
}
@@ -241,6 +250,7 @@ func (ji *jiraImporter) ensureIssue(repo *cache.RepoCache, issue Issue) (*cache.
metaKeyJiraId: issue.ID,
metaKeyJiraKey: issue.Key,
metaKeyJiraProject: ji.conf[confKeyProject],
+ metaKeyJiraBaseUrl: ji.conf[confKeyBaseUrl],
})
if err != nil {
return nil, err
diff --git a/bridge/jira/jira.go b/bridge/jira/jira.go
index 066c6597..6423843c 100644
--- a/bridge/jira/jira.go
+++ b/bridge/jira/jira.go
@@ -20,6 +20,7 @@ const (
metaKeyJiraKey = "jira-key"
metaKeyJiraUser = "jira-user"
metaKeyJiraProject = "jira-project"
+ metaKeyJiraBaseUrl = "jira-base-url"
metaKeyJiraExportTime = "jira-export-time"
metaKeyJiraLogin = "jira-login"