aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/jira/import.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-12-23 01:48:14 +0100
committerGitHub <noreply@github.com>2022-12-23 01:48:14 +0100
commit0a5a0ec1ef4ad98bc2116a953e201f96474941ab (patch)
tree660a9b17b5247fe2f954bfa814cce3193c5afa23 /bridge/jira/import.go
parent108518530e822e3bdf59c8bfc333ad0bbe2d5fc8 (diff)
parent95911100823b5c809225d664de74ad2d64e91972 (diff)
downloadgit-bug-0a5a0ec1ef4ad98bc2116a953e201f96474941ab.tar.gz
Merge pull request #938 from MichaelMure/cache-reorg
Generic cache layer
Diffstat (limited to 'bridge/jira/import.go')
-rw-r--r--bridge/jira/import.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/bridge/jira/import.go b/bridge/jira/import.go
index ff9fbb7a..d8a5f8dd 100644
--- a/bridge/jira/import.go
+++ b/bridge/jira/import.go
@@ -184,7 +184,7 @@ func (ji *jiraImporter) ImportAll(ctx context.Context, repo *cache.RepoCache, si
// Create a bug.Person from a JIRA user
func (ji *jiraImporter) ensurePerson(repo *cache.RepoCache, user User) (*cache.IdentityCache, error) {
// Look first in the cache
- i, err := repo.ResolveIdentityImmutableMetadata(
+ i, err := repo.Identities().ResolveIdentityImmutableMetadata(
metaKeyJiraUser, string(user.Key))
if err == nil {
return i, nil
@@ -193,7 +193,7 @@ func (ji *jiraImporter) ensurePerson(repo *cache.RepoCache, user User) (*cache.I
return nil, err
}
- i, err = repo.NewIdentityRaw(
+ i, err = repo.Identities().NewRaw(
user.DisplayName,
user.EmailAddress,
user.Key,
@@ -219,7 +219,7 @@ func (ji *jiraImporter) ensureIssue(repo *cache.RepoCache, issue Issue) (*cache.
return nil, err
}
- b, err := repo.ResolveBugMatcher(func(excerpt *cache.BugExcerpt) bool {
+ b, err := repo.Bugs().ResolveMatcher(func(excerpt *cache.BugExcerpt) bool {
if _, ok := excerpt.CreateMetadata[metaKeyJiraBaseUrl]; ok &&
excerpt.CreateMetadata[metaKeyJiraBaseUrl] != ji.conf[confKeyBaseUrl] {
return false
@@ -229,12 +229,12 @@ func (ji *jiraImporter) ensureIssue(repo *cache.RepoCache, issue Issue) (*cache.
excerpt.CreateMetadata[metaKeyJiraId] == issue.ID &&
excerpt.CreateMetadata[metaKeyJiraProject] == ji.conf[confKeyProject]
})
- if err != nil && err != bug.ErrBugNotExist {
+ if err != nil && !entity.IsErrNotFound(err) {
return nil, err
}
- if err == bug.ErrBugNotExist {
- b, _, err = repo.NewBugRaw(
+ if entity.IsErrNotFound(err) {
+ b, _, err = repo.Bugs().NewRaw(
author,
issue.Fields.Created.Unix(),
text.CleanupOneLine(issue.Fields.Summary),