Change keyUser to keyOwner in Github bridge

Amine Hilaly created

Change summary

bridge/github/github.go      |  3 ++-
bridge/github/import.go      |  5 +++--
bridge/github/import_test.go |  6 +++---
bridge/github/iterator.go    | 14 +++++++-------
4 files changed, 15 insertions(+), 13 deletions(-)

Detailed changes

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() {

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() {

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)
 

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),
 			},
 		},
 	}