Skip to content

Commit

Permalink
Merge pull request #286 from fluxcd/update-go-github-63
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
stefanprodan authored Aug 28, 2024
2 parents f5f96d7 + d1a091a commit f087250
Show file tree
Hide file tree
Showing 23 changed files with 103 additions and 1,536 deletions.
2 changes: 1 addition & 1 deletion github/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package github
import (
"fmt"

"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
4 changes: 2 additions & 2 deletions github/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"strings"

"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down Expand Up @@ -111,7 +111,7 @@ func (c *Client) HasTokenPermission(ctx context.Context, permission gitprovider.
}

// The X-OAuth-Scopes header is returned for any API calls, using Meta here to keep things simple.
_, res, err := c.c.Client().APIMeta(ctx)
_, res, err := c.c.Client().Meta.Get(ctx)
if err != nil {
return false, err
}
Expand Down
2 changes: 1 addition & 1 deletion github/client_organization_teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package github
import (
"context"

"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
2 changes: 1 addition & 1 deletion github/client_repositories_org.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"errors"

"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
3 changes: 2 additions & 1 deletion github/client_repository_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package github
import (
"context"

"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v61/github"
)

// BranchClient implements the gitprovider.BranchClient interface.
Expand Down
2 changes: 1 addition & 1 deletion github/client_repository_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"
)

var githubNewFileMode = "100644"
Expand Down
2 changes: 1 addition & 1 deletion github/client_repository_deploykey.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"errors"

"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
2 changes: 1 addition & 1 deletion github/client_repository_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"io"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"
)

// FileClient implements the gitprovider.FileClient interface.
Expand Down
2 changes: 1 addition & 1 deletion github/client_repository_pullrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"
)

// PullRequestClient implements the gitprovider.PullRequestClient interface.
Expand Down
2 changes: 1 addition & 1 deletion github/example_organization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/fluxcd/go-git-providers/github"
"github.com/fluxcd/go-git-providers/gitprovider"
gogithub "github.com/google/go-github/v61/github"
gogithub "github.com/google/go-github/v64/github"
)

// checkErr is used for examples in this repository.
Expand Down
2 changes: 1 addition & 1 deletion github/example_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/fluxcd/go-git-providers/github"
"github.com/fluxcd/go-git-providers/gitprovider"
gogithub "github.com/google/go-github/v61/github"
gogithub "github.com/google/go-github/v64/github"
)

func ExampleOrgRepositoriesClient_Get() {
Expand Down
2 changes: 1 addition & 1 deletion github/githubclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"
)

// githubClientImpl is a wrapper around *github.Client, which implements higher-level methods,
Expand Down
2 changes: 1 addition & 1 deletion github/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"testing"
"time"

"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"
"github.com/gregjones/httpcache"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down
2 changes: 1 addition & 1 deletion github/resource_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package github

import (
"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
2 changes: 1 addition & 1 deletion github/resource_deploykey.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"fmt"
"reflect"

"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
Expand Down
2 changes: 1 addition & 1 deletion github/resource_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package github

import (
"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
Expand Down
2 changes: 1 addition & 1 deletion github/resource_pullrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package github

import (
"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"
)

func newPullRequest(ctx *clientContext, apiObj *github.PullRequest) *pullrequest {
Expand Down
2 changes: 1 addition & 1 deletion github/resource_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"errors"
"reflect"

"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
Expand Down
2 changes: 1 addition & 1 deletion github/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"net/http"

"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
Expand Down
2 changes: 1 addition & 1 deletion github/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
"github.com/google/go-github/v61/github"
"github.com/google/go-github/v64/github"
)

func Test_validateAPIObject(t *testing.T) {
Expand Down
8 changes: 7 additions & 1 deletion gitlab/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"net/http"
"strings"

"github.com/xanzy/go-gitlab"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/fluxcd/go-git-providers/validation"
"github.com/xanzy/go-gitlab"
)

const (
Expand Down Expand Up @@ -226,6 +227,11 @@ func handleHTTPError(err error) error {
if err == nil {
return nil
}

if errors.Is(err, gitlab.ErrNotFound) {
return validation.NewMultiError(err, gitprovider.ErrNotFound)
}

glErrorResponse := &gitlab.ErrorResponse{}
if errors.As(err, &glErrorResponse) {
httpErr := gitprovider.HTTPError{
Expand Down
42 changes: 21 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,61 @@ module github.com/fluxcd/go-git-providers

go 1.22

// Includes fix: https://github.com/google/go-github/pull/3249
replace github.com/google/go-github/v64 => github.com/google/go-github/v64 v64.0.1-0.20240826145430-da7d01467641

require (
code.gitea.io/sdk/gitea v0.17.1
code.gitea.io/sdk/gitea v0.19.0
github.com/ProtonMail/go-crypto v1.0.0
github.com/go-git/go-billy/v5 v5.5.0
github.com/go-git/go-git/v5 v5.12.0
github.com/go-logr/logr v1.4.1
github.com/go-logr/logr v1.4.2
github.com/go-logr/zapr v1.3.0
github.com/google/go-cmp v0.6.0
github.com/google/go-github/v61 v61.0.0
github.com/google/go-github/v64 v64.0.0
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-retryablehttp v0.7.5
github.com/ktrysmt/go-bitbucket v0.9.77
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/ktrysmt/go-bitbucket v0.9.80
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.32.0
github.com/xanzy/go-gitlab v0.101.0
github.com/xanzy/go-gitlab v0.107.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.21.0
golang.org/x/oauth2 v0.18.0
golang.org/x/crypto v0.26.0
golang.org/x/oauth2 v0.20.0
golang.org/x/time v0.5.0
k8s.io/utils v0.0.0-20240310230437-4693a0247e57
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/cloudflare/circl v1.3.9 // indirect
github.com/cyphar/filepath-securejoin v0.3.1 // indirect
github.com/davidmz/go-pageant v1.0.2 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-fed/httpsig v1.1.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/skeema/knownhosts v1.2.2 // indirect
github.com/skeema/knownhosts v1.3.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.19.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.33.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit f087250

Please sign in to comment.