From 0ac39a7ab5db077fcf0df827e32bf6e625e980da Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 19 Nov 2022 11:33:12 +0100 Subject: WIP --- bridge/jira/import.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bridge/jira/import.go') diff --git a/bridge/jira/import.go b/bridge/jira/import.go index ff9fbb7a..4cec1133 100644 --- a/bridge/jira/import.go +++ b/bridge/jira/import.go @@ -229,11 +229,11 @@ 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 { + if entity.IsErrNotFound(err) { b, _, err = repo.NewBugRaw( author, issue.Fields.Created.Unix(), -- cgit From 9b98fc06489353053564b431ac0c0d73a5c55a56 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 21 Dec 2022 21:54:36 +0100 Subject: cache: tie up the refactor up to compiling --- bridge/jira/import.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bridge/jira/import.go') diff --git a/bridge/jira/import.go b/bridge/jira/import.go index 4cec1133..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 @@ -234,7 +234,7 @@ func (ji *jiraImporter) ensureIssue(repo *cache.RepoCache, issue Issue) (*cache. } if entity.IsErrNotFound(err) { - b, _, err = repo.NewBugRaw( + b, _, err = repo.Bugs().NewRaw( author, issue.Fields.Created.Unix(), text.CleanupOneLine(issue.Fields.Summary), -- cgit