Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from thepwagner/action-update-go/main/internal
Browse files Browse the repository at this point in the history
Dependency Updates
  • Loading branch information
Pete Wagner authored Oct 7, 2020
2 parents 26b7415 + 81d98e0 commit a053c02
Show file tree
Hide file tree
Showing 18 changed files with 281 additions and 172 deletions.
2 changes: 1 addition & 1 deletion dockerurl/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/thepwagner/action-update/updater"
)

func (u *Updater) Check(ctx context.Context, dependency updater.Dependency) (*updater.Update, error) {
func (u *Updater) Check(ctx context.Context, dependency updater.Dependency, filter func(string) bool) (*updater.Update, error) {
if strings.HasPrefix(dependency.Path, "github.com/") {
return u.checkGitHubRelease(ctx, dependency)
}
Expand Down
8 changes: 4 additions & 4 deletions dockerurl/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestUpdater_Check(t *testing.T) {
rc := &mockRepoClient{}
rc.On("ListReleases", ctx, depOwner, depRepoName, mock.Anything).Return(tc.releases, nil, nil)

u := updatertest.CheckInFixture(t, "simple", updaterFactory(dockerurl.WithRepoClient(rc)), dep)
u := updatertest.CheckInFixture(t, "simple", updaterFactory(dockerurl.WithRepoClient(rc)), dep, nil)
if tc.update == nil {
assert.Nil(t, u)
} else {
Expand All @@ -78,7 +78,7 @@ func TestUpdater_Check(t *testing.T) {

func TestUpdater_Check_Unknown(t *testing.T) {
u := dockerurl.NewUpdater("")
_, err := u.Check(context.Background(), updater.Dependency{Path: "foo.com/bar"})
_, err := u.Check(context.Background(), updater.Dependency{Path: "foo.com/bar"}, nil)
assert.Error(t, err)
}

Expand All @@ -89,7 +89,7 @@ func TestUpdater_Check_Error(t *testing.T) {
rc.On("ListReleases", ctx, depOwner, depRepoName, mock.Anything).Return(nil, nil, listErr)
u := dockerurl.NewUpdater("", dockerurl.WithRepoClient(rc))

_, err := u.Check(ctx, dep)
_, err := u.Check(ctx, dep, nil)
assert.Equal(t, listErr, errors.Unwrap(err))
rc.AssertExpectations(t)
}
Expand Down Expand Up @@ -138,7 +138,7 @@ func TestUpdater_CheckLive(t *testing.T) {

for _, tc := range cases {
t.Run(tc.dep.Path, func(t *testing.T) {
u := updatertest.CheckInFixture(t, "simple", updaterFactory(), tc.dep)
u := updatertest.CheckInFixture(t, "simple", updaterFactory(), tc.dep, nil)
if tc.next == nil {
assert.Nil(t, u)
} else if assert.NotNil(t, u, "no update") {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require (
github.com/moby/buildkit v0.7.2
github.com/sirupsen/logrus v1.7.0
github.com/stretchr/testify v1.6.1
github.com/thepwagner/action-update v0.0.1
github.com/thepwagner/action-update-docker v0.0.1
github.com/thepwagner/action-update v0.0.2
github.com/thepwagner/action-update-docker v0.0.2
)

replace (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/thepwagner/action-update v0.0.1 h1:1DU8swMUGsKpvPD8E6hfiNzdznXeldISjLgLnLTe+zM=
github.com/thepwagner/action-update v0.0.1/go.mod h1:sbBBJVBFI/s+1owXsHLixR210s0S++sJ1CKrhtz0iDw=
github.com/thepwagner/action-update-docker v0.0.1 h1:Z2ot7Qghw41a3AX1im8yzARUeUvSeeJ5+vNj43E5500=
github.com/thepwagner/action-update-docker v0.0.1/go.mod h1:PuGKdOlrH52ORxT9MyS7bGV4zlwReL3vo/73137kn+g=
github.com/thepwagner/action-update v0.0.2 h1:v+LhIuMchWfIYJJbJ/7a8muJ8zFw0DffZVJab4H1C/U=
github.com/thepwagner/action-update v0.0.2/go.mod h1:sbBBJVBFI/s+1owXsHLixR210s0S++sJ1CKrhtz0iDw=
github.com/thepwagner/action-update-docker v0.0.2 h1:XeyTYwBixHH+jCkZENEcWCTNvA5d7PeE6+V6xL+X4Rw=
github.com/thepwagner/action-update-docker v0.0.2/go.mod h1:4es+9+DLgVeb/LWkbyAywAY2QTN5JQy6pYJtE/hOPR4=
github.com/tonistiigi/fsutil v0.0.0-20200326231323-c2c7d7b0e144/go.mod h1:0G1sLZ/0ttFf09xvh7GR4AEECnjifHRNJN/sYbLianU=
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk=
github.com/uber/jaeger-client-go v0.0.0-20180103221425-e02c85f9069e/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
Expand Down

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

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

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

6 changes: 3 additions & 3 deletions vendor/github.com/thepwagner/action-update/repo/commit.go

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

6 changes: 3 additions & 3 deletions vendor/github.com/thepwagner/action-update/repo/git.go

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

10 changes: 5 additions & 5 deletions vendor/github.com/thepwagner/action-update/repo/github.go

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

22 changes: 11 additions & 11 deletions vendor/github.com/thepwagner/action-update/repo/pullrequest.go

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

38 changes: 0 additions & 38 deletions vendor/github.com/thepwagner/action-update/updater/batch.go

This file was deleted.

Loading

0 comments on commit a053c02

Please sign in to comment.