Skip to content

Commit

Permalink
build: update Go version and dependencies (#26)
Browse files Browse the repository at this point in the history
This commit updates the Go version requirements for the project to
`1.21.x` and `1.22.x` as well as updates various dependencies to their
latest compatible versions

Dependency changes:

- Update `go.mod` to use Go 1.21 and set the toolchain to go 1.22.1
- Update `github.com/google/go-github` to v61.0.0
- Update `github.com/go-git/go-git` to v5.11.0
- Update other dependencies to their latest versions
- Regenerate mocks to use new go-git imports

Signed-off-by: Amine Hilaly <[email protected]>

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
a-hilaly authored Apr 8, 2024
1 parent 326c0ea commit 4baa07c
Show file tree
Hide file tree
Showing 12 changed files with 298 additions and 380 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jobs:
strategy:
matrix:
go-version:
- "1.13.x"
- "1.14.x"
- "1.15.x"
- "1.16.x"
- "1.21.x"
- "1.22.x"
os:
- ubuntu-latest
- macos-latest
Expand Down
52 changes: 43 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,51 @@
module github.com/aws-controllers-k8s/dev-tools

go 1.14
go 1.21

toolchain go1.22.1

require (
github.com/ghodss/yaml v1.0.0
github.com/google/go-github/v35 v35.2.0
github.com/go-git/go-billy/v5 v5.5.0
github.com/go-git/go-git/v5 v5.11.0
github.com/google/go-github/v61 v61.0.0
github.com/mitchellh/go-homedir v1.1.0
github.com/olekukonko/tablewriter v0.0.5
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v1.1.3
github.com/stretchr/testify v1.5.1
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
gopkg.in/src-d/go-billy.v4 v4.3.2
gopkg.in/src-d/go-git.v4 v4.13.1
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.8.4
golang.org/x/crypto v0.22.0
golang.org/x/oauth2 v0.19.0
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emirpasic/gods v1.18.1 // 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/google/go-querystring v1.1.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/tools v0.13.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
464 changes: 141 additions & 323 deletions go.sum

Large diffs are not rendered by default.

41 changes: 33 additions & 8 deletions mocks/open_cloner.go

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

77 changes: 60 additions & 17 deletions mocks/repository_service.go

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

8 changes: 4 additions & 4 deletions pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ package git
import (
"context"

"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/transport"
githttp "github.com/go-git/go-git/v5/plumbing/transport/http"
gitssh "github.com/go-git/go-git/v5/plumbing/transport/ssh"
"golang.org/x/crypto/ssh"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
githttp "gopkg.in/src-d/go-git.v4/plumbing/transport/http"
gitssh "gopkg.in/src-d/go-git.v4/plumbing/transport/ssh"
)

var _ OpenCloner = &Git{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/github/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"errors"
"time"

"github.com/google/go-github/v35/github"
"github.com/google/go-github/v61/github"
"golang.org/x/oauth2"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/repository/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"strings"
"time"

git "github.com/go-git/go-git/v5"
gitconfig "github.com/go-git/go-git/v5/config"
"github.com/go-git/go-git/v5/plumbing/transport"
"github.com/sirupsen/logrus"
git "gopkg.in/src-d/go-git.v4"
gitconfig "gopkg.in/src-d/go-git.v4/config"
"gopkg.in/src-d/go-git.v4/plumbing/transport"

"github.com/aws-controllers-k8s/dev-tools/pkg/config"
ackdevgit "github.com/aws-controllers-k8s/dev-tools/pkg/git"
Expand Down
8 changes: 4 additions & 4 deletions pkg/repository/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
"fmt"
"testing"

gogithub "github.com/google/go-github/v35/github"
"github.com/go-git/go-git/v5"
gitconfig "github.com/go-git/go-git/v5/config"
"github.com/go-git/go-git/v5/plumbing/transport"
gogithub "github.com/google/go-github/v61/github"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/src-d/go-git.v4"
gitconfig "gopkg.in/src-d/go-git.v4/config"
"gopkg.in/src-d/go-git.v4/plumbing/transport"

"github.com/aws-controllers-k8s/dev-tools/pkg/config"
ackdevgit "github.com/aws-controllers-k8s/dev-tools/pkg/git"
Expand Down
2 changes: 1 addition & 1 deletion pkg/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package repository
import (
"fmt"

"gopkg.in/src-d/go-git.v4"
"github.com/go-git/go-git/v5"
)

// NewRepository returns a pointer to a new repository.
Expand Down
8 changes: 4 additions & 4 deletions pkg/testutil/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
package testutil

import (
"gopkg.in/src-d/go-billy.v4/memfs"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"gopkg.in/src-d/go-git.v4/storage/memory"
"github.com/go-git/go-billy/v5/memfs"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/go-git/go-git/v5/storage/memory"
)

// NewInMemoryGitRepository returns a in-memory git repository containing one commit.
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package util
import (
"fmt"

git "gopkg.in/src-d/go-git.v4"
gitconfig "gopkg.in/src-d/go-git.v4/config"
git "github.com/go-git/go-git/v5"
gitconfig "github.com/go-git/go-git/v5/config"
)

// GetRepositoryRemotes returns a map containing the remote names and the URLs they
Expand Down

0 comments on commit 4baa07c

Please sign in to comment.