Skip to content

Commit

Permalink
Updating dependencies
Browse files Browse the repository at this point in the history
updating the following deps:
- github.com/google/go-github
- code.gitea.io/sdk/gitea
- github.com/xanzy/go-gitlab
- github.com/go-logr/logr
- gitea e2e test version to v1.21.1

Signed-off-by: Soule BA <[email protected]>
  • Loading branch information
souleb committed Dec 12, 2023
1 parent eca42bf commit 334d0a0
Show file tree
Hide file tree
Showing 35 changed files with 104 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Run vet
run: make tidy fmt vet
- name: Check if working tree is dirty
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-gitea.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Start Provider instances
run: make start-provider-instances-gitea GITEA_VERSION=1.19.3@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a
run: make start-provider-instances-gitea GITEA_VERSION=1.21.1@sha256:63165c64759c98e55f0afdb5fc3be64cbb27180d3474e951fa027228e6955029
- name: Run tests [gitea]
run: |
export GITEA_TOKEN=$(cat /tmp/gitea-token)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Run tests
run: |
[ -n "${{ secrets.GITPROVIDER_BOT_TOKEN }}" ] && export GITHUB_TOKEN=${{ secrets.GITPROVIDER_BOT_TOKEN }} || echo "using default GITHUB_TOKEN"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-gitlab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Start Provider instances
run: make start-provider-instances-gitlab
- name: Run tests [gitlab]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-stash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Run tests
run: |
[ -n "${{ secrets.STASH_TOKEN }}" ] && export STASH_TOKEN=${{ secrets.STASH_TOKEN }} || echo "using default STASH_TOKEN"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Download release notes utility
env:
GH_REL_URL: https://github.com/buchanae/github-release-notes/releases/download/0.2.0/github-release-notes-linux-amd64-0.2.0.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion gitea/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func NewClient(token string, optFns ...gitprovider.ClientOption) (gitprovider.Cl

gt, err := gitea.NewClient(baseURL, gitea.SetHTTPClient(httpClient), gitea.SetToken(token))
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to create Gitea client: %w", err)
}
// By default, turn destructive actions off. But allow overrides.
destructiveActions := false
Expand Down
3 changes: 3 additions & 0 deletions gitea/client_repository_pullrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ func (c *PullRequestClient) Merge(ctx context.Context, number int, mergeMethod g
}

if !done {
if resp.StatusCode != 200 {
return fmt.Errorf("merge failed: %s", resp.Status)
}
return fmt.Errorf("merge failed")
}

Expand Down
10 changes: 7 additions & 3 deletions gitea/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ import (
)

func Test_DomainVariations(t *testing.T) {

giteaBaseUrl = "http://try.gitea.io"
giteaBaseUrl := "http://try.gitea.io"
if giteaBaseUrlVar := os.Getenv("GITEA_BASE_URL"); giteaBaseUrlVar != "" {
giteaBaseUrl = giteaBaseUrlVar
}

token := ""
if giteaToken := os.Getenv("GITEA_TOKEN"); giteaToken != "" {
token = giteaToken
}

u, err := url.Parse(giteaBaseUrl)
if err != nil {
t.Fatalf("failed parsing base URL %q: %s", giteaBaseUrl, err)
Expand All @@ -58,7 +62,7 @@ func Test_DomainVariations(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c1, err := NewClient("token", tt.opts)
c1, err := NewClient(token, tt.opts)
if err != nil {
if tt.expectedErrPattern == "" {
t.Fatalf("unexpected error: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion gitea/integration_repositories_org_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ var _ = Describe("Gitea Provider", func() {
Expect(err).ToNot(HaveOccurred())
Expect(len(keys)).To(Equal(0))

rsaGen := testutils.NewRSAGenerator(2154)
rsaGen := testutils.NewRSAGenerator(3071)
keyPair1, err := rsaGen.Generate()
Expect(err).ToNot(HaveOccurred())
pubKey := keyPair1.PublicKey
Expand Down
16 changes: 13 additions & 3 deletions gitea/integration_repositories_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,14 @@ var _ = Describe("Gitea Provider", func() {
Expect(len(prs)).To(Equal(1))
Expect(prs[0].Get().WebURL).To(Equal(pr.Get().WebURL))

err = userRepo.PullRequests().Merge(ctx, pr.Get().Number, gitprovider.MergeMethodSquash, "squash merged")
Expect(err).ToNot(HaveOccurred())
Eventually(func() bool {
var err error
err = userRepo.PullRequests().Merge(ctx, pr.Get().Number, gitprovider.MergeMethodSquash, "squash merged")
if err == nil && len(commits) == 0 {
err = errors.New("pull request not merged")
}
return retryOp.IsRetryable(err, fmt.Sprintf("merge pull request, repository: %s", userRepo.Repository().GetRepository()))
}, retryOp.Timeout(), retryOp.Interval()).Should(BeTrue())

getPR, err := userRepo.PullRequests().Get(ctx, pr.Get().Number)
Expect(err).ToNot(HaveOccurred())
Expand All @@ -281,8 +287,12 @@ var _ = Describe("Gitea Provider", func() {
},
}

_, err = userRepo.Commits().Create(ctx, branchName, "added second config file", files)
err = userRepo.Branches().Create(ctx, branchName2, defaultBranch)
Expect(err).ToNot(HaveOccurred())

commit, err = userRepo.Commits().Create(ctx, branchName2, "added second config file", files)
Expect(err).ToNot(HaveOccurred())
Expect(commit.Get().Sha).ToNot(BeEmpty())

pr, err = userRepo.PullRequests().Create(ctx, "Added second config file", branchName, defaultBranch, "added second config file")
Expect(err).ToNot(HaveOccurred())
Expand Down
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/v55/github"
"github.com/google/go-github/v57/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
2 changes: 1 addition & 1 deletion 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/v55/github"
"github.com/google/go-github/v57/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
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/v55/github"
"github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/github"

"github.com/fluxcd/go-git-providers/gitprovider"
)
Expand Down
2 changes: 1 addition & 1 deletion github/client_repository_branch.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/v55/github"
"github.com/google/go-github/v57/github"
)

// BranchClient implements the gitprovider.BranchClient interface.
Expand Down
4 changes: 2 additions & 2 deletions 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/v55/github"
"github.com/google/go-github/v57/github"
)

var githubNewFileMode = "100644"
Expand Down Expand Up @@ -106,7 +106,7 @@ func (c *CommitClient) Create(ctx context.Context, branch string, message string
SHA: &latestCommitSHA,
},
},
})
}, nil)
if err != nil {
return nil, err
}
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/v55/github"
"github.com/google/go-github/v57/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 @@ -22,7 +22,7 @@ import (
"io"

"github.com/fluxcd/go-git-providers/gitprovider"
"github.com/google/go-github/v55/github"
"github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/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/v55/github"
gogithub "github.com/google/go-github/v57/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/v55/github"
gogithub "github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/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/v55/github"
"github.com/google/go-github/v57/github"
)

func Test_validateAPIObject(t *testing.T) {
Expand Down
33 changes: 15 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,29 @@ module github.com/fluxcd/go-git-providers
go 1.20

require (
code.gitea.io/sdk/gitea v0.16.0
code.gitea.io/sdk/gitea v0.17.0
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371
github.com/go-git/go-billy/v5 v5.5.0
github.com/go-git/go-git/v5 v5.9.0
github.com/go-logr/logr v1.2.4
github.com/go-logr/zapr v1.2.3
github.com/google/go-cmp v0.5.9
github.com/google/go-github/v55 v55.0.0
github.com/go-logr/logr v1.3.0
github.com/go-logr/zapr v1.3.0
github.com/google/go-cmp v0.6.0
github.com/google/go-github/v57 v57.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.4
github.com/ktrysmt/go-bitbucket v0.9.68
github.com/hashicorp/go-retryablehttp v0.7.5
github.com/ktrysmt/go-bitbucket v0.9.73
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.28.0
github.com/xanzy/go-gitlab v0.93.1
github.com/onsi/gomega v1.30.0
github.com/xanzy/go-gitlab v0.95.1
go.uber.org/zap v1.26.0
golang.org/x/crypto v0.14.0
golang.org/x/oauth2 v0.13.0
golang.org/x/time v0.3.0
golang.org/x/crypto v0.16.0
golang.org/x/oauth2 v0.15.0
golang.org/x/time v0.5.0
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
)

// Fix CVE-2022-28948
replace gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.1

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
Expand All @@ -55,9 +52,9 @@ require (
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
Expand Down
Loading

0 comments on commit 334d0a0

Please sign in to comment.