aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/gitlab
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-15 15:39:49 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-15 15:46:36 +0100
commite231b6e83956635e5e4923c064cab19e6730150a (patch)
treea0740cc0b8b82fac54e9e863e76f7a7ad85cd672 /bridge/gitlab
parent02548c0e8f96a5c08efe46bd5f71f97fdd211de3 (diff)
downloadgit-bug-e231b6e83956635e5e4923c064cab19e6730150a.tar.gz
bridges: pass the context to Init for when a client build process needs it
Diffstat (limited to 'bridge/gitlab')
-rw-r--r--bridge/gitlab/export.go2
-rw-r--r--bridge/gitlab/export_test.go7
-rw-r--r--bridge/gitlab/import.go2
-rw-r--r--bridge/gitlab/import_test.go5
4 files changed, 9 insertions, 7 deletions
diff --git a/bridge/gitlab/export.go b/bridge/gitlab/export.go
index 156aabaa..918e6b5e 100644
--- a/bridge/gitlab/export.go
+++ b/bridge/gitlab/export.go
@@ -38,7 +38,7 @@ type gitlabExporter struct {
}
// Init .
-func (ge *gitlabExporter) Init(repo *cache.RepoCache, conf core.Configuration) error {
+func (ge *gitlabExporter) Init(_ context.Context, repo *cache.RepoCache, conf core.Configuration) error {
ge.conf = conf
ge.identityClient = make(map[entity.Id]*gitlab.Client)
ge.cachedOperationIDs = make(map[string]string)
diff --git a/bridge/gitlab/export_test.go b/bridge/gitlab/export_test.go
index 5fbb392f..d704ac3b 100644
--- a/bridge/gitlab/export_test.go
+++ b/bridge/gitlab/export_test.go
@@ -191,15 +191,16 @@ func TestPushPull(t *testing.T) {
return deleteRepository(context.TODO(), projectID, token)
})
+ ctx := context.Background()
+
// initialize exporter
exporter := &gitlabExporter{}
- err = exporter.Init(backend, core.Configuration{
+ err = exporter.Init(ctx, backend, core.Configuration{
confKeyProjectID: strconv.Itoa(projectID),
confKeyGitlabBaseUrl: defaultBaseURL,
})
require.NoError(t, err)
- ctx := context.Background()
start := time.Now()
// export all bugs
@@ -221,7 +222,7 @@ func TestPushPull(t *testing.T) {
require.NoError(t, err)
importer := &gitlabImporter{}
- err = importer.Init(backend, core.Configuration{
+ err = importer.Init(ctx, backend, core.Configuration{
confKeyProjectID: strconv.Itoa(projectID),
confKeyGitlabBaseUrl: defaultBaseURL,
})
diff --git a/bridge/gitlab/import.go b/bridge/gitlab/import.go
index c8d74bef..5faf5c48 100644
--- a/bridge/gitlab/import.go
+++ b/bridge/gitlab/import.go
@@ -30,7 +30,7 @@ type gitlabImporter struct {
out chan<- core.ImportResult
}
-func (gi *gitlabImporter) Init(repo *cache.RepoCache, conf core.Configuration) error {
+func (gi *gitlabImporter) Init(_ context.Context, repo *cache.RepoCache, conf core.Configuration) error {
gi.conf = conf
creds, err := auth.List(repo,
diff --git a/bridge/gitlab/import_test.go b/bridge/gitlab/import_test.go
index b70b291e..ea7acc18 100644
--- a/bridge/gitlab/import_test.go
+++ b/bridge/gitlab/import_test.go
@@ -104,14 +104,15 @@ func TestImport(t *testing.T) {
err = auth.Store(repo, token)
require.NoError(t, err)
+ ctx := context.Background()
+
importer := &gitlabImporter{}
- err = importer.Init(backend, core.Configuration{
+ err = importer.Init(ctx, backend, core.Configuration{
confKeyProjectID: projectID,
confKeyGitlabBaseUrl: defaultBaseURL,
})
require.NoError(t, err)
- ctx := context.Background()
start := time.Now()
events, err := importer.ImportAll(ctx, backend, time.Time{})