From c4dae4d8147bae645d8cb85247d9d4c8e4f7a6bc Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Wed, 16 Mar 2022 12:28:03 -0700 Subject: [PATCH 1/5] update go-common version. --- go.mod | 2 +- go.sum | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 go.sum diff --git a/go.mod b/go.mod index 12648a9..0f1d725 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/golang/mock v1.4.4 github.com/k0kubun/pp v3.0.1+incompatible // indirect github.com/mitchellh/mapstructure v1.3.3 // indirect - github.com/packagrio/go-common v0.0.2 + github.com/packagrio/go-common v0.0.5 github.com/seborama/govcr v4.5.0+incompatible // indirect github.com/spf13/viper v1.7.1 github.com/stretchr/testify v1.7.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..27dca62 --- /dev/null +++ b/go.sum @@ -0,0 +1,15 @@ +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/analogj/go-bitbucket v0.4.0/go.mod h1:MxqZJ1LIpr+9NqE3KloUc6eZYdSbfi0WP5aKc8Q5mDE= +github.com/analogj/go-util v0.0.0-20200905200945-3b93d31215ae/go.mod h1:lJQVqFKMV5/oDGYR2bra2OljcF3CvolAoyDRyOA4k4E= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/packagrio/go-common v0.0.5 h1:kKXwg+Vm6rewn06X2Z4GcZrvfdglUcni68tUimquaG4= +github.com/packagrio/go-common v0.0.5/go.mod h1:FP3yg500eI/khJdj+AjnbhlHdpsbbyT85hquoxe/N28= +github.com/seborama/govcr v4.5.0+incompatible/go.mod h1:EgcISudCCYDLzbiAImJ8i7kk4+wTA44Kp+j4S0LhASI= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +gopkg.in/libgit2/git2go.v25 v25.1.0/go.mod h1:9J2SB7jVeRmLUFiUp5yqk2qAToco2ocSLkY/VOoxhkM= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From b662f142b67d7128c9bebf3993edd9c45e5cd8c6 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Wed, 16 Mar 2022 13:07:57 -0700 Subject: [PATCH 2/5] fixes for scm Init. --- pkg/engine/engine_golang_test.go | 9 +++++---- pkg/engine/engine_node_test.go | 3 ++- pkg/engine/engine_python_test.go | 6 ++---- pkg/engine/engine_ruby_test.go | 4 +++- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pkg/engine/engine_golang_test.go b/pkg/engine/engine_golang_test.go index 73a243b..e654105 100644 --- a/pkg/engine/engine_golang_test.go +++ b/pkg/engine/engine_golang_test.go @@ -7,16 +7,17 @@ import ( "github.com/golang/mock/gomock" "github.com/packagrio/go-common/pipeline" "github.com/packagrio/go-common/scm" + "github.com/packagrio/go-common/scm/mock" "github.com/packagrio/releasr/pkg/config" + "github.com/packagrio/releasr/pkg/config/mock" "github.com/packagrio/releasr/pkg/engine" releasrUtils "github.com/packagrio/releasr/pkg/utils" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "io/ioutil" - "path" - "github.com/packagrio/go-common/scm/mock" - "github.com/packagrio/releasr/pkg/config/mock" "os" + "path" + "net/http" "testing" ) @@ -28,7 +29,7 @@ func TestEngineGolang_Create(t *testing.T) { testConfig.Set(config.PACKAGR_SCM, "github") testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "golang") pipelineData := new(pipeline.Data) - githubScm, err := scm.Create("github", pipelineData, testConfig, nil) + githubScm, err := scm.Create("github", pipelineData, testConfig, http.Client{}) require.NoError(t, err) //test diff --git a/pkg/engine/engine_node_test.go b/pkg/engine/engine_node_test.go index 52e93cc..94acbca 100644 --- a/pkg/engine/engine_node_test.go +++ b/pkg/engine/engine_node_test.go @@ -18,6 +18,7 @@ import ( mock_scm "github.com/packagrio/go-common/scm/mock" "github.com/packagrio/releasr/pkg/config/mock" "os" + "net/http" "testing" ) @@ -29,7 +30,7 @@ func TestEngineNode_Create(t *testing.T) { testConfig.Set(config.PACKAGR_SCM, "github") testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "node") pipelineData := new(pipeline.Data) - githubScm, err := scm.Create("github", pipelineData, testConfig, nil) + githubScm, err := scm.Create("github", pipelineData, testConfig, http.Client{}) require.NoError(t, err) //test diff --git a/pkg/engine/engine_python_test.go b/pkg/engine/engine_python_test.go index 1844175..2418d9a 100644 --- a/pkg/engine/engine_python_test.go +++ b/pkg/engine/engine_python_test.go @@ -13,10 +13,8 @@ import ( "github.com/stretchr/testify/suite" "io/ioutil" "os" + "net/http" - //"path/filepath" - "github.com/packagrio/go-common/scm/mock" - "github.com/packagrio/releasr/pkg/config/mock" "testing" ) @@ -28,7 +26,7 @@ func TestEnginePython_Create(t *testing.T) { testConfig.Set(config.PACKAGR_SCM, "github") testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "python") pipelineData := new(pipeline.Data) - githubScm, err := scm.Create("github", pipelineData, testConfig, nil) + githubScm, err := scm.Create("github", pipelineData, testConfig, http.Client{}) require.NoError(t, err) //test diff --git a/pkg/engine/engine_ruby_test.go b/pkg/engine/engine_ruby_test.go index 96e64fd..5c21ece 100644 --- a/pkg/engine/engine_ruby_test.go +++ b/pkg/engine/engine_ruby_test.go @@ -15,6 +15,8 @@ import ( "github.com/packagrio/go-common/scm/mock" "github.com/packagrio/releasr/pkg/config/mock" "testing" + "net/http" + ) func TestEngineRuby_Create(t *testing.T) { @@ -25,7 +27,7 @@ func TestEngineRuby_Create(t *testing.T) { testConfig.Set(config.PACKAGR_SCM, "github") testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "ruby") pipelineData := new(pipeline.Data) - githubScm, err := scm.Create("github", pipelineData, testConfig, nil) + githubScm, err := scm.Create("github", pipelineData, testConfig, http.Client{}) require.NoError(t, err) //test From 0a2f80e9c7a1341158c4624247977ee6cefe70fd Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Wed, 16 Mar 2022 13:14:32 -0700 Subject: [PATCH 3/5] fixes for scm Init. --- pkg/engine/engine_golang_test.go | 4 ++-- pkg/engine/engine_node_test.go | 2 +- pkg/engine/engine_python_test.go | 2 ++ pkg/engine/engine_ruby_test.go | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/engine/engine_golang_test.go b/pkg/engine/engine_golang_test.go index e654105..e9dea5b 100644 --- a/pkg/engine/engine_golang_test.go +++ b/pkg/engine/engine_golang_test.go @@ -7,11 +7,11 @@ import ( "github.com/golang/mock/gomock" "github.com/packagrio/go-common/pipeline" "github.com/packagrio/go-common/scm" - "github.com/packagrio/go-common/scm/mock" "github.com/packagrio/releasr/pkg/config" - "github.com/packagrio/releasr/pkg/config/mock" "github.com/packagrio/releasr/pkg/engine" releasrUtils "github.com/packagrio/releasr/pkg/utils" + mock_scm "github.com/packagrio/go-common/scm/mock" + mock_config "github.com/packagrio/go-common/config/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "io/ioutil" diff --git a/pkg/engine/engine_node_test.go b/pkg/engine/engine_node_test.go index 94acbca..b082458 100644 --- a/pkg/engine/engine_node_test.go +++ b/pkg/engine/engine_node_test.go @@ -16,7 +16,7 @@ import ( "path" //"path/filepath" mock_scm "github.com/packagrio/go-common/scm/mock" - "github.com/packagrio/releasr/pkg/config/mock" + mock_config "github.com/packagrio/go-common/config/mock" "os" "net/http" "testing" diff --git a/pkg/engine/engine_python_test.go b/pkg/engine/engine_python_test.go index 2418d9a..701e0cb 100644 --- a/pkg/engine/engine_python_test.go +++ b/pkg/engine/engine_python_test.go @@ -11,6 +11,8 @@ import ( releasrUtils "github.com/packagrio/releasr/pkg/utils" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + mock_scm "github.com/packagrio/go-common/scm/mock" + mock_config "github.com/packagrio/go-common/config/mock" "io/ioutil" "os" "net/http" diff --git a/pkg/engine/engine_ruby_test.go b/pkg/engine/engine_ruby_test.go index 5c21ece..4ec29e0 100644 --- a/pkg/engine/engine_ruby_test.go +++ b/pkg/engine/engine_ruby_test.go @@ -12,8 +12,8 @@ import ( "github.com/stretchr/testify/suite" //"path/filepath" - "github.com/packagrio/go-common/scm/mock" - "github.com/packagrio/releasr/pkg/config/mock" + mock_scm "github.com/packagrio/go-common/scm/mock" + mock_config "github.com/packagrio/go-common/config/mock" "testing" "net/http" From e3ea8cb2a0abad32ad72bced1768870a4e301945 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Wed, 16 Mar 2022 13:19:53 -0700 Subject: [PATCH 4/5] fixes for scm Init. --- pkg/engine/engine_golang_test.go | 2 +- pkg/engine/engine_node_test.go | 2 +- pkg/engine/engine_python_test.go | 2 +- pkg/engine/engine_ruby_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/engine/engine_golang_test.go b/pkg/engine/engine_golang_test.go index e9dea5b..cb5a2b1 100644 --- a/pkg/engine/engine_golang_test.go +++ b/pkg/engine/engine_golang_test.go @@ -11,7 +11,7 @@ import ( "github.com/packagrio/releasr/pkg/engine" releasrUtils "github.com/packagrio/releasr/pkg/utils" mock_scm "github.com/packagrio/go-common/scm/mock" - mock_config "github.com/packagrio/go-common/config/mock" + mock_config "github.com/packagrio/releasr/pkg/config/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "io/ioutil" diff --git a/pkg/engine/engine_node_test.go b/pkg/engine/engine_node_test.go index b082458..c9f06a7 100644 --- a/pkg/engine/engine_node_test.go +++ b/pkg/engine/engine_node_test.go @@ -16,7 +16,7 @@ import ( "path" //"path/filepath" mock_scm "github.com/packagrio/go-common/scm/mock" - mock_config "github.com/packagrio/go-common/config/mock" + mock_config "github.com/packagrio/releasr/pkg/config/mock" "os" "net/http" "testing" diff --git a/pkg/engine/engine_python_test.go b/pkg/engine/engine_python_test.go index 701e0cb..b458701 100644 --- a/pkg/engine/engine_python_test.go +++ b/pkg/engine/engine_python_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" mock_scm "github.com/packagrio/go-common/scm/mock" - mock_config "github.com/packagrio/go-common/config/mock" + mock_config "github.com/packagrio/releasr/pkg/config/mock" "io/ioutil" "os" "net/http" diff --git a/pkg/engine/engine_ruby_test.go b/pkg/engine/engine_ruby_test.go index 4ec29e0..e8d87ae 100644 --- a/pkg/engine/engine_ruby_test.go +++ b/pkg/engine/engine_ruby_test.go @@ -13,7 +13,7 @@ import ( //"path/filepath" mock_scm "github.com/packagrio/go-common/scm/mock" - mock_config "github.com/packagrio/go-common/config/mock" + mock_config "github.com/packagrio/releasr/pkg/config/mock" "testing" "net/http" From fac1109f29dc92d3465a27f7a118caa49233cae5 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Wed, 16 Mar 2022 13:24:59 -0700 Subject: [PATCH 5/5] fixes for scm Init. --- pkg/engine/engine_golang_test.go | 2 +- pkg/engine/engine_node_test.go | 2 +- pkg/engine/engine_python_test.go | 2 +- pkg/engine/engine_ruby_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/engine/engine_golang_test.go b/pkg/engine/engine_golang_test.go index cb5a2b1..0b22a5c 100644 --- a/pkg/engine/engine_golang_test.go +++ b/pkg/engine/engine_golang_test.go @@ -29,7 +29,7 @@ func TestEngineGolang_Create(t *testing.T) { testConfig.Set(config.PACKAGR_SCM, "github") testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "golang") pipelineData := new(pipeline.Data) - githubScm, err := scm.Create("github", pipelineData, testConfig, http.Client{}) + githubScm, err := scm.Create("github", pipelineData, testConfig, &http.Client{}) require.NoError(t, err) //test diff --git a/pkg/engine/engine_node_test.go b/pkg/engine/engine_node_test.go index c9f06a7..e36ed8d 100644 --- a/pkg/engine/engine_node_test.go +++ b/pkg/engine/engine_node_test.go @@ -30,7 +30,7 @@ func TestEngineNode_Create(t *testing.T) { testConfig.Set(config.PACKAGR_SCM, "github") testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "node") pipelineData := new(pipeline.Data) - githubScm, err := scm.Create("github", pipelineData, testConfig, http.Client{}) + githubScm, err := scm.Create("github", pipelineData, testConfig, &http.Client{}) require.NoError(t, err) //test diff --git a/pkg/engine/engine_python_test.go b/pkg/engine/engine_python_test.go index b458701..13e9159 100644 --- a/pkg/engine/engine_python_test.go +++ b/pkg/engine/engine_python_test.go @@ -28,7 +28,7 @@ func TestEnginePython_Create(t *testing.T) { testConfig.Set(config.PACKAGR_SCM, "github") testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "python") pipelineData := new(pipeline.Data) - githubScm, err := scm.Create("github", pipelineData, testConfig, http.Client{}) + githubScm, err := scm.Create("github", pipelineData, testConfig, &http.Client{}) require.NoError(t, err) //test diff --git a/pkg/engine/engine_ruby_test.go b/pkg/engine/engine_ruby_test.go index e8d87ae..c4208d9 100644 --- a/pkg/engine/engine_ruby_test.go +++ b/pkg/engine/engine_ruby_test.go @@ -27,7 +27,7 @@ func TestEngineRuby_Create(t *testing.T) { testConfig.Set(config.PACKAGR_SCM, "github") testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "ruby") pipelineData := new(pipeline.Data) - githubScm, err := scm.Create("github", pipelineData, testConfig, http.Client{}) + githubScm, err := scm.Create("github", pipelineData, testConfig, &http.Client{}) require.NoError(t, err) //test