Skip to content

Commit

Permalink
housekeeping: Update module github.com/google/go-github/v50 to v54 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored Sep 5, 2023
1 parent 62a07f3 commit 2c3e4ac
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 42 deletions.
14 changes: 7 additions & 7 deletions backend/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/gogo/status v1.1.1
github.com/golang-migrate/migrate/v4 v4.16.2
github.com/golang/protobuf v1.5.3
github.com/google/go-github/v50 v50.2.0
github.com/google/go-github/v54 v54.0.0
github.com/google/uuid v1.3.0
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2
Expand All @@ -48,8 +48,8 @@ require (
go.temporal.io/sdk v1.24.0
go.temporal.io/sdk/contrib/tally v0.2.0
go.uber.org/zap v1.25.0
golang.org/x/net v0.11.0
golang.org/x/oauth2 v0.8.0
golang.org/x/net v0.14.0
golang.org/x/oauth2 v0.11.0
golang.org/x/sync v0.2.0
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d
Expand Down Expand Up @@ -150,12 +150,12 @@ require (
go.temporal.io/api v1.21.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/term v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.1 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
27 changes: 14 additions & 13 deletions backend/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions backend/mock/service/githubmock/githubmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/golang/protobuf/ptypes/any"
githubv3 "github.com/google/go-github/v50/github"
githubv3 "github.com/google/go-github/v54/github"
"github.com/uber-go/tally/v4"
"go.uber.org/zap"

Expand Down Expand Up @@ -65,7 +65,7 @@ func (s svc) ListOrganizations(ctx context.Context, user string) ([]*githubv3.Or
}, nil
}

func (s svc) ListPullRequestsWithCommit(ctx context.Context, ref *github.RemoteRef, sha string, opts *githubv3.PullRequestListOptions) ([]*github.PullRequestInfo, error) {
func (s svc) ListPullRequestsWithCommit(ctx context.Context, ref *github.RemoteRef, sha string, opts *githubv3.ListOptions) ([]*github.PullRequestInfo, error) {
prNumber := 12345
return []*github.PullRequestInfo{
{
Expand Down
8 changes: 4 additions & 4 deletions backend/service/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
gittransport "github.com/go-git/go-git/v5/plumbing/transport/http"
"github.com/go-git/go-git/v5/storage/memory"
"github.com/golang/protobuf/ptypes/any"
githubv3 "github.com/google/go-github/v50/github"
githubv3 "github.com/google/go-github/v54/github"
"github.com/shurcooL/githubv4"
"github.com/uber-go/tally/v4"
"go.uber.org/zap"
Expand Down Expand Up @@ -108,7 +108,7 @@ type Client interface {
GetRepository(ctx context.Context, ref *RemoteRef) (*Repository, error)
GetOrganization(ctx context.Context, organization string) (*githubv3.Organization, error)
ListOrganizations(ctx context.Context, user string) ([]*githubv3.Organization, error)
ListPullRequestsWithCommit(ctx context.Context, ref *RemoteRef, sha string, opts *githubv3.PullRequestListOptions) ([]*PullRequestInfo, error)
ListPullRequestsWithCommit(ctx context.Context, ref *RemoteRef, sha string, opts *githubv3.ListOptions) ([]*PullRequestInfo, error)
GetOrgMembership(ctx context.Context, user, org string) (*githubv3.Membership, error)
GetUser(ctx context.Context, username string) (*githubv3.User, error)
}
Expand Down Expand Up @@ -267,7 +267,7 @@ func (s *svc) CreatePullRequest(ctx context.Context, ref *RemoteRef, base, title
}, nil
}

func (s *svc) ListPullRequestsWithCommit(ctx context.Context, ref *RemoteRef, sha string, opts *githubv3.PullRequestListOptions) ([]*PullRequestInfo, error) {
func (s *svc) ListPullRequestsWithCommit(ctx context.Context, ref *RemoteRef, sha string, opts *githubv3.ListOptions) ([]*PullRequestInfo, error) {
respPRs, _, err := s.rest.PullRequests.ListPullRequestsWithCommit(ctx, ref.RepoOwner, ref.RepoName, sha, opts)
if err != nil {
return nil, err
Expand Down Expand Up @@ -475,7 +475,7 @@ func (s *svc) GetFile(ctx context.Context, ref *RemoteRef, path string) (*File,
func (s *svc) CompareCommits(ctx context.Context, ref *RemoteRef, compareSHA string) (*githubv3.CommitsComparison, error) {
comp, _, err := s.rest.Repositories.CompareCommits(ctx, ref.RepoOwner, ref.RepoName, compareSHA, ref.Ref, nil)
if err != nil {
return nil, fmt.Errorf("Could not get comparison for %s and %s. %+v", ref.Ref, compareSHA, err)
return nil, fmt.Errorf("could not get comparison for %s and %s. %+v", ref.Ref, compareSHA, err)
}

return comp, nil
Expand Down
18 changes: 4 additions & 14 deletions backend/service/github/github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"time"

"github.com/dgrijalva/jwt-go"
githubv3 "github.com/google/go-github/v50/github"
githubv3 "github.com/google/go-github/v54/github"
"github.com/shurcooL/githubv4"
"github.com/stretchr/testify/assert"
"github.com/uber-go/tally/v4"
Expand Down Expand Up @@ -421,7 +421,7 @@ var compareCommitsTests = []struct {
{
name: "v3 error",
generalError: true,
errorText: "Could not get comparison",
errorText: "could not get comparison",
mockRepo: &mockRepositories{generalError: true},
},
{
Expand Down Expand Up @@ -786,7 +786,7 @@ func (m *mockPullRequests) Create(ctx context.Context, owner string, repo string
}

// Mock of ListPullRequestsWithCommit API
func (m *mockPullRequests) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *githubv3.PullRequestListOptions) ([]*githubv3.PullRequest, *githubv3.Response, error) {
func (m *mockPullRequests) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *githubv3.ListOptions) ([]*githubv3.PullRequest, *githubv3.Response, error) {
if m.generalError {
return nil, nil, errors.New(problem)
}
Expand All @@ -798,7 +798,6 @@ func (m *mockPullRequests) ListPullRequestsWithCommit(ctx context.Context, owner
return []*githubv3.PullRequest{
{
Number: intPtr(m.actualNumber),
State: strPtr(opts.State),
HTMLURL: strPtr(m.actualHTMLURL),
Head: &githubv3.PullRequestBranch{
Ref: strPtr(m.actualBranchName),
Expand All @@ -822,7 +821,6 @@ var listPullRequestsWithCommitTests = []struct {
repoName string
ref string
sha string
opts *githubv3.PullRequestListOptions
}{
{
name: "happy path",
Expand All @@ -831,10 +829,6 @@ var listPullRequestsWithCommitTests = []struct {
repoName: "my-repo",
ref: "my-branch",
sha: "asdf12345",
opts: &githubv3.PullRequestListOptions{
// Possible values for State: "open", "closed", "all". Default is "open", manually setting it to "all".
State: "all",
},
},
{
name: "v3 client error",
Expand All @@ -844,9 +838,6 @@ var listPullRequestsWithCommitTests = []struct {
repoName: "my-repo",
ref: "my-branch",
sha: "asdf12345",
opts: &githubv3.PullRequestListOptions{
State: "all",
},
},
}

Expand All @@ -867,8 +858,7 @@ func TestListPullRequestsWithCommit(t *testing.T) {
RepoName: tt.repoName,
Ref: tt.ref,
},
tt.sha,
tt.opts)
tt.sha, nil)

if tt.errorText != "" {
assert.Error(t, err)
Expand Down
4 changes: 2 additions & 2 deletions backend/service/github/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package github
import (
"context"

githubv3 "github.com/google/go-github/v50/github"
githubv3 "github.com/google/go-github/v54/github"
"github.com/shurcooL/githubv4"
)

Expand Down Expand Up @@ -34,7 +34,7 @@ type v3pullrequests interface {
// Create a new pull request on the specified repository.
Create(ctx context.Context, owner string, repo string, pull *githubv3.NewPullRequest) (*githubv3.PullRequest, *githubv3.Response, error)
// ListPullRequestsWithCommit returns pull requests associated with a commit SHA.
ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *githubv3.PullRequestListOptions) ([]*githubv3.PullRequest, *githubv3.Response, error)
ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *githubv3.ListOptions) ([]*githubv3.PullRequest, *githubv3.Response, error)
}

type v4client interface {
Expand Down

0 comments on commit 2c3e4ac

Please sign in to comment.