aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bridge/github/github.go3
-rw-r--r--bridge/github/import.go5
-rw-r--r--bridge/github/import_test.go6
-rw-r--r--bridge/github/iterator.go14
4 files changed, 15 insertions, 13 deletions
diff --git a/bridge/github/github.go b/bridge/github/github.go
index 5fee7487..3e717ee9 100644
--- a/bridge/github/github.go
+++ b/bridge/github/github.go
@@ -4,9 +4,10 @@ package github
import (
"context"
- "github.com/MichaelMure/git-bug/bridge/core"
"github.com/shurcooL/githubv4"
"golang.org/x/oauth2"
+
+ "github.com/MichaelMure/git-bug/bridge/core"
)
func init() {
diff --git a/bridge/github/import.go b/bridge/github/import.go
index 2b9e5561..edb97c4f 100644
--- a/bridge/github/import.go
+++ b/bridge/github/import.go
@@ -5,13 +5,14 @@ import (
"fmt"
"time"
+ "github.com/shurcooL/githubv4"
+
"github.com/MichaelMure/git-bug/bridge/core"
"github.com/MichaelMure/git-bug/bug"
"github.com/MichaelMure/git-bug/cache"
"github.com/MichaelMure/git-bug/identity"
"github.com/MichaelMure/git-bug/util/git"
"github.com/MichaelMure/git-bug/util/text"
- "github.com/shurcooL/githubv4"
)
const (
@@ -42,7 +43,7 @@ func (gi *githubImporter) Init(conf core.Configuration) error {
// ImportAll iterate over all the configured repository issues and ensure the creation of the
// missing issues / timeline items / edits / label events ...
func (gi *githubImporter) ImportAll(repo *cache.RepoCache, since time.Time) error {
- gi.iterator = NewIterator(gi.conf[keyUser], gi.conf[keyProject], gi.conf[keyToken], since)
+ gi.iterator = NewIterator(gi.conf[keyOwner], gi.conf[keyProject], gi.conf[keyToken], since)
// Loop over all matching issues
for gi.iterator.NextIssue() {
diff --git a/bridge/github/import_test.go b/bridge/github/import_test.go
index 1e31501b..9704e56f 100644
--- a/bridge/github/import_test.go
+++ b/bridge/github/import_test.go
@@ -140,9 +140,9 @@ func Test_Importer(t *testing.T) {
importer := &githubImporter{}
err = importer.Init(core.Configuration{
- "user": "MichaelMure",
- "project": "git-bug-test-github-bridge",
- "token": token,
+ keyOwner: "MichaelMure",
+ keyProject: "git-bug-test-github-bridge",
+ keyToken: token,
})
require.NoError(t, err)
diff --git a/bridge/github/iterator.go b/bridge/github/iterator.go
index 5935276a..2bb197de 100644
--- a/bridge/github/iterator.go
+++ b/bridge/github/iterator.go
@@ -60,7 +60,7 @@ type iterator struct {
}
// NewIterator create and initalize a new iterator
-func NewIterator(user, project, token string, since time.Time) *iterator {
+func NewIterator(owner, project, token string, since time.Time) *iterator {
i := &iterator{
gc: buildClient(token),
since: since,
@@ -70,22 +70,22 @@ func NewIterator(user, project, token string, since time.Time) *iterator {
issueEdit: indexer{-1},
commentEdit: indexer{-1},
variables: map[string]interface{}{
- "owner": githubv4.String(user),
- "name": githubv4.String(project),
+ keyOwner: githubv4.String(owner),
+ "name": githubv4.String(project),
},
},
commentEdit: commentEditIterator{
index: -1,
variables: map[string]interface{}{
- "owner": githubv4.String(user),
- "name": githubv4.String(project),
+ keyOwner: githubv4.String(owner),
+ "name": githubv4.String(project),
},
},
issueEdit: issueEditIterator{
index: -1,
variables: map[string]interface{}{
- "owner": githubv4.String(user),
- "name": githubv4.String(project),
+ keyOwner: githubv4.String(owner),
+ "name": githubv4.String(project),
},
},
}