mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 10:12:06 +03:00
jira: tag bugs with the base URL, tighten the matching
This commit is contained in:
parent
8389df0711
commit
4397766800
@ -216,7 +216,16 @@ func (ji *jiraImporter) ensureIssue(repo *cache.RepoCache, issue Issue) (*cache.
|
|||||||
return nil, err
|
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 {
|
if err != nil && err != bug.ErrBugNotExist {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -241,6 +250,7 @@ func (ji *jiraImporter) ensureIssue(repo *cache.RepoCache, issue Issue) (*cache.
|
|||||||
metaKeyJiraId: issue.ID,
|
metaKeyJiraId: issue.ID,
|
||||||
metaKeyJiraKey: issue.Key,
|
metaKeyJiraKey: issue.Key,
|
||||||
metaKeyJiraProject: ji.conf[confKeyProject],
|
metaKeyJiraProject: ji.conf[confKeyProject],
|
||||||
|
metaKeyJiraBaseUrl: ji.conf[confKeyBaseUrl],
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -20,6 +20,7 @@ const (
|
|||||||
metaKeyJiraKey = "jira-key"
|
metaKeyJiraKey = "jira-key"
|
||||||
metaKeyJiraUser = "jira-user"
|
metaKeyJiraUser = "jira-user"
|
||||||
metaKeyJiraProject = "jira-project"
|
metaKeyJiraProject = "jira-project"
|
||||||
|
metaKeyJiraBaseUrl = "jira-base-url"
|
||||||
metaKeyJiraExportTime = "jira-export-time"
|
metaKeyJiraExportTime = "jira-export-time"
|
||||||
metaKeyJiraLogin = "jira-login"
|
metaKeyJiraLogin = "jira-login"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user