Skip to content

Commit

Permalink
upgrade used gh client to v39
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikKahl committed Dec 2, 2021
1 parent f17216c commit 48503d3
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pkg/testmachinery/locations/location/gitlocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

argov1 "github.com/argoproj/argo/v2/pkg/apis/workflow/v1alpha1"
"github.com/go-logr/logr"
"github.com/google/go-github/v27/github"
"github.com/google/go-github/v39/github"

tmv1beta1 "github.com/gardener/test-infra/pkg/apis/testmachinery/v1beta1"
"github.com/gardener/test-infra/pkg/testmachinery"
Expand Down
4 changes: 2 additions & 2 deletions pkg/testrunner/result/status-uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"github.com/Masterminds/semver/v3"
"github.com/go-logr/logr"
"github.com/google/go-github/v27/github"
"github.com/google/go-github/v39/github"
"github.com/pkg/errors"
"sigs.k8s.io/controller-runtime/pkg/client"

Expand Down Expand Up @@ -313,7 +313,7 @@ func downloadReleaseAssetByName(log logr.Logger, component ComponentExtended, fi
if err != nil {
return errors.Wrapf(err, "failed to get github asset ID of %s in %s", filename, component.Name)
}
assetReader, redirectURL, err := component.GithubClient.Repositories.DownloadReleaseAsset(context.Background(), component.Owner, component.Name, remoteAssetID)
assetReader, redirectURL, err := component.GithubClient.Repositories.DownloadReleaseAsset(context.Background(), component.Owner, component.Name, remoteAssetID, nil)
if assetReader != nil {
defer assetReader.Close()
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/tm-bot/github/authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (c *client) isInRequestedTeam(ctx context.Context, event *GenericRequestEve

// use default team if there is no requested team
if c.defaultTeam != nil && len(pr.RequestedTeams) == 0 {
membership, _, err := c.client.Teams.GetTeamMembership(ctx, c.defaultTeam.GetID(), event.GetAuthorName())
membership, _, err := c.client.Teams.GetTeamMembershipByID(ctx, c.defaultTeam.Organization.GetID(), c.defaultTeam.GetID(), event.GetAuthorName())
if err != nil {
c.log.V(3).Info(err.Error(), "team", c.defaultTeam.GetName())
return false
Expand All @@ -90,7 +90,7 @@ func (c *client) isInRequestedTeam(ctx context.Context, event *GenericRequestEve
}

for _, team := range pr.RequestedTeams {
membership, _, err := c.client.Teams.GetTeamMembership(ctx, team.GetID(), event.GetAuthorName())
membership, _, err := c.client.Teams.GetTeamMembershipByID(ctx, team.Organization.GetID(), team.GetID(), event.GetAuthorName())
if err != nil {
c.log.V(3).Info(err.Error(), "team", team.GetName())
return false
Expand All @@ -108,7 +108,7 @@ func (c *client) isInDefaultTeam(ctx context.Context, event *GenericRequestEvent
c.log.Info("no default team defined", "repository", event.GetRepositoryName(), "owner", event.GetOwnerName())
return false
}
membership, _, err := c.client.Teams.GetTeamMembership(ctx, c.defaultTeam.GetID(), event.GetAuthorName())
membership, _, err := c.client.Teams.GetTeamMembershipByID(ctx, c.defaultTeam.Organization.GetID(), c.defaultTeam.GetID(), event.GetAuthorName())
if err != nil {
c.log.V(3).Info(err.Error(), "team", c.defaultTeam.GetName())
return false
Expand Down
2 changes: 1 addition & 1 deletion pkg/tm-bot/github/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

"github.com/Masterminds/semver/v3"
"github.com/go-logr/logr"
"github.com/google/go-github/v27/github"
"github.com/google/go-github/v39/github"
"github.com/pkg/errors"
"sigs.k8s.io/yaml"

Expand Down
2 changes: 1 addition & 1 deletion pkg/tm-bot/github/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/bradleyfalzon/ghinstallation/v2"
"github.com/go-logr/logr"
"github.com/google/go-github/v27/github"
"github.com/google/go-github/v39/github"
"sigs.k8s.io/yaml"

"github.com/gardener/test-infra/pkg/apis/config"
Expand Down
2 changes: 1 addition & 1 deletion pkg/tm-bot/github/mocks/client.go

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

2 changes: 1 addition & 1 deletion pkg/tm-bot/github/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/Masterminds/semver/v3"
"github.com/go-logr/logr"
"github.com/google/go-github/v27/github"
"github.com/google/go-github/v39/github"

"github.com/gardener/test-infra/pkg/apis/config"
"github.com/gardener/test-infra/pkg/tm-bot/github/ghval"
Expand Down
2 changes: 1 addition & 1 deletion pkg/tm-bot/hook/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"net/http"

"github.com/go-logr/logr"
"github.com/google/go-github/v27/github"
"github.com/google/go-github/v39/github"
"github.com/pkg/errors"

ghutils "github.com/gardener/test-infra/pkg/tm-bot/github"
Expand Down
2 changes: 1 addition & 1 deletion pkg/tm-bot/tests/tests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package tests_test

import (
"github.com/google/go-github/v27/github"
"github.com/google/go-github/v39/github"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

Expand Down
2 changes: 1 addition & 1 deletion pkg/tm-bot/ui/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"net/http"
"time"

"github.com/google/go-github/v27/github"
"github.com/google/go-github/v39/github"

github2 "github.com/gardener/test-infra/pkg/tm-bot/github"

Expand Down
2 changes: 1 addition & 1 deletion pkg/tm-bot/ui/pages/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/argoproj/argo/v2/pkg/apis/workflow/v1alpha1"
"github.com/go-logr/logr"
github2 "github.com/google/go-github/v27/github"
github2 "github.com/google/go-github/v39/github"
"github.com/gorilla/mux"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down
2 changes: 1 addition & 1 deletion pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"time"

"github.com/go-logr/logr"
"github.com/google/go-github/v27/github"
"github.com/google/go-github/v39/github"
"github.com/pkg/errors"
netv1beta1 "k8s.io/api/networking/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down

0 comments on commit 48503d3

Please sign in to comment.