Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
upgrade to go-gh/v2 (#88)
Browse files Browse the repository at this point in the history
* upgrade to go-gh/v2

* bad find and replace

* tests too

* another one
  • Loading branch information
mntlty authored Apr 21, 2023
1 parent ce9101c commit da61dc5
Show file tree
Hide file tree
Showing 36 changed files with 247 additions and 242 deletions.
8 changes: 4 additions & 4 deletions cmd/close/close.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/cli/cli/v2/pkg/cmdutil"

"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/pkg/term"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/term"
"github.com/github/gh-projects/format"
"github.com/github/gh-projects/queries"
"github.com/shurcooL/githubv4"
Expand All @@ -26,7 +26,7 @@ type closeOpts struct {

type closeConfig struct {
tp tableprinter.TablePrinter
client api.GQLClient
client *api.GraphQLClient
opts closeOpts
}

Expand Down
13 changes: 6 additions & 7 deletions cmd/close/close_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"bytes"
"testing"

"github.com/cli/go-gh"
"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/stretchr/testify/assert"
"gopkg.in/h2non/gock.v1"
)
Expand Down Expand Up @@ -79,7 +78,7 @@ func TestRunClose_User(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -168,7 +167,7 @@ func TestRunClose_Org(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -253,7 +252,7 @@ func TestRunClose_Me(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -342,7 +341,7 @@ func TestRunClose_Reopen(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down
8 changes: 4 additions & 4 deletions cmd/copy/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/cli/cli/v2/pkg/cmdutil"

"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/pkg/term"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/term"
"github.com/github/gh-projects/format"
"github.com/github/gh-projects/queries"
"github.com/shurcooL/githubv4"
Expand All @@ -30,7 +30,7 @@ type copyOpts struct {

type copyConfig struct {
tp tableprinter.TablePrinter
client api.GQLClient
client *api.GraphQLClient
opts copyOpts
}

Expand Down
11 changes: 5 additions & 6 deletions cmd/copy/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"bytes"
"testing"

"github.com/cli/go-gh"
"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/stretchr/testify/assert"
"gopkg.in/h2non/gock.v1"
)
Expand Down Expand Up @@ -100,7 +99,7 @@ func TestRunCopy_User(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -211,7 +210,7 @@ func TestRunCopy_Org(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -314,7 +313,7 @@ func TestRunCopy_Me(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down
8 changes: 4 additions & 4 deletions cmd/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (

"github.com/cli/cli/v2/pkg/cmdutil"

"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/pkg/term"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/term"
"github.com/github/gh-projects/format"
"github.com/github/gh-projects/queries"
"github.com/shurcooL/githubv4"
Expand All @@ -24,7 +24,7 @@ type createOpts struct {

type createConfig struct {
tp tableprinter.TablePrinter
client api.GQLClient
client *api.GraphQLClient
opts createOpts
}

Expand Down
11 changes: 5 additions & 6 deletions cmd/create/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"bytes"
"testing"

"github.com/cli/go-gh"
"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/stretchr/testify/assert"
"gopkg.in/h2non/gock.v1"
)
Expand Down Expand Up @@ -54,7 +53,7 @@ func TestRunCreate_User(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -116,7 +115,7 @@ func TestRunCreate_Org(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -175,7 +174,7 @@ func TestRunCreate_Me(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down
8 changes: 4 additions & 4 deletions cmd/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/cli/cli/v2/pkg/cmdutil"

"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/pkg/term"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/term"
"github.com/github/gh-projects/format"
"github.com/github/gh-projects/queries"
"github.com/shurcooL/githubv4"
Expand All @@ -25,7 +25,7 @@ type deleteOpts struct {

type deleteConfig struct {
tp tableprinter.TablePrinter
client api.GQLClient
client *api.GraphQLClient
opts deleteOpts
}

Expand Down
11 changes: 5 additions & 6 deletions cmd/delete/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"bytes"
"testing"

"github.com/cli/go-gh"
"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/stretchr/testify/assert"
"gopkg.in/h2non/gock.v1"
)
Expand Down Expand Up @@ -75,7 +74,7 @@ func TestRunDelete_User(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -160,7 +159,7 @@ func TestRunDelete_Org(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -241,7 +240,7 @@ func TestRunDelete_Me(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down
8 changes: 4 additions & 4 deletions cmd/edit/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/cli/cli/v2/pkg/cmdutil"

"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/pkg/term"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/term"
"github.com/github/gh-projects/format"
"github.com/github/gh-projects/queries"
"github.com/shurcooL/githubv4"
Expand All @@ -29,7 +29,7 @@ type editOpts struct {

type editConfig struct {
tp tableprinter.TablePrinter
client api.GQLClient
client *api.GraphQLClient
opts editOpts
}

Expand Down
13 changes: 6 additions & 7 deletions cmd/edit/edit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"bytes"
"testing"

"github.com/cli/go-gh"
"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/stretchr/testify/assert"
"gopkg.in/h2non/gock.v1"
)
Expand Down Expand Up @@ -79,7 +78,7 @@ func TestRunUpdate_User(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -171,7 +170,7 @@ func TestRunUpdate_Org(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -259,7 +258,7 @@ func TestRunUpdate_Me(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down Expand Up @@ -351,7 +350,7 @@ func TestRunUpdate_OmitParams(t *testing.T) {
},
})

client, err := gh.GQLClient(&api.ClientOptions{AuthToken: "token"})
client, err := api.NewGraphQLClient(api.ClientOptions{AuthToken: "token"})
assert.NoError(t, err)

buf := bytes.Buffer{}
Expand Down
8 changes: 4 additions & 4 deletions cmd/field-create/field_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/cli/cli/v2/pkg/cmdutil"

"github.com/cli/go-gh/pkg/api"
"github.com/cli/go-gh/pkg/tableprinter"
"github.com/cli/go-gh/pkg/term"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/tableprinter"
"github.com/cli/go-gh/v2/pkg/term"
"github.com/github/gh-projects/format"
"github.com/github/gh-projects/queries"
"github.com/shurcooL/githubv4"
Expand All @@ -28,7 +28,7 @@ type createFieldOpts struct {

type createFieldConfig struct {
tp tableprinter.TablePrinter
client api.GQLClient
client *api.GraphQLClient
opts createFieldOpts
}

Expand Down
Loading

0 comments on commit da61dc5

Please sign in to comment.