aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/gitlab/import.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-12-21 21:54:36 +0100
committerMichael Muré <batolettre@gmail.com>2022-12-21 21:54:36 +0100
commit9b98fc06489353053564b431ac0c0d73a5c55a56 (patch)
tree67cab95c0c6167c0982516a2dda610bd5ece9eab /bridge/gitlab/import.go
parent905c9a90f134842b97e2cf729d8b11ff59bfd766 (diff)
downloadgit-bug-9b98fc06489353053564b431ac0c0d73a5c55a56.tar.gz
cache: tie up the refactor up to compiling
Diffstat (limited to 'bridge/gitlab/import.go')
-rw-r--r--bridge/gitlab/import.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go
index 85999e90..5947fb60 100644
--- a/bridge/gitlab/import.go
+++ b/bridge/gitlab/import.go
@@ -11,7 +11,6 @@ import (
"github.com/MichaelMure/git-bug/bridge/core"
"github.com/MichaelMure/git-bug/bridge/core/auth"
"github.com/MichaelMure/git-bug/cache"
- "github.com/MichaelMure/git-bug/entities/bug"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/util/text"
)
@@ -109,7 +108,7 @@ func (gi *gitlabImporter) ensureIssue(repo *cache.RepoCache, issue *gitlab.Issue
}
// resolve bug
- b, err := repo.ResolveBugMatcher(func(excerpt *cache.BugExcerpt) bool {
+ b, err := repo.Bugs().ResolveMatcher(func(excerpt *cache.BugExcerpt) bool {
return excerpt.CreateMetadata[core.MetaKeyOrigin] == target &&
excerpt.CreateMetadata[metaKeyGitlabId] == fmt.Sprintf("%d", issue.IID) &&
excerpt.CreateMetadata[metaKeyGitlabBaseUrl] == gi.conf[confKeyGitlabBaseUrl] &&
@@ -123,7 +122,7 @@ func (gi *gitlabImporter) ensureIssue(repo *cache.RepoCache, issue *gitlab.Issue
}
// if bug was never imported, create bug
- b, _, err = repo.NewBugRaw(
+ b, _, err = repo.Bugs().NewRaw(
author,
issue.CreatedAt.Unix(),
text.CleanupOneLine(issue.Title),
@@ -338,7 +337,7 @@ func (gi *gitlabImporter) ensureIssueEvent(repo *cache.RepoCache, b *cache.BugCa
func (gi *gitlabImporter) ensurePerson(repo *cache.RepoCache, id int) (*cache.IdentityCache, error) {
// Look first in the cache
- i, err := repo.ResolveIdentityImmutableMetadata(metaKeyGitlabId, strconv.Itoa(id))
+ i, err := repo.Identities().ResolveIdentityImmutableMetadata(metaKeyGitlabId, strconv.Itoa(id))
if err == nil {
return i, nil
}
@@ -351,7 +350,7 @@ func (gi *gitlabImporter) ensurePerson(repo *cache.RepoCache, id int) (*cache.Id
return nil, err
}
- i, err = repo.NewIdentityRaw(
+ i, err = repo.Identities().NewRaw(
user.Name,
user.PublicEmail,
user.Username,