From 55c73d46bd265556936d0947df6e3f6bc64f5f6e Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:50:46 -0400 Subject: [PATCH] refactor: remove types dependency (#583) * refactor: remove types dependency * gci --- action/deployment/add.go | 6 ++---- action/deployment/add_test.go | 2 +- action/deployment/deployment.go | 2 +- action/deployment/table.go | 8 ++++---- action/deployment/table_test.go | 15 +++++++-------- action/hook/table.go | 8 ++++---- action/hook/table_test.go | 16 +++++++--------- action/pipeline/exec.go | 2 +- action/pipeline/stage.go | 4 ++-- action/pipeline/stage_test.go | 2 +- action/pipeline/step.go | 4 ++-- action/pipeline/step_test.go | 2 +- action/pipeline/table.go | 8 ++++---- action/pipeline/table_test.go | 15 +++++++-------- action/pipeline/validate.go | 6 +++--- action/repo/validate.go | 2 +- action/secret/add.go | 8 ++++---- action/secret/file.go | 4 ++-- action/secret/get.go | 2 +- action/secret/remove.go | 2 +- action/secret/table.go | 10 +++++----- action/secret/table_test.go | 14 +++++++------- action/secret/update.go | 10 ++++------ action/secret/validate.go | 6 +++--- action/secret/view.go | 12 ++++++------ action/service/table.go | 8 ++++---- action/service/table_test.go | 14 +++++++------- action/step/table.go | 8 ++++---- action/step/table_test.go | 14 +++++++------- action/worker/update.go | 2 -- command/deployment/add.go | 2 +- command/deployment/add_test.go | 2 +- command/pipeline/exec.go | 2 +- command/pipeline/validate.go | 2 +- command/repo/add.go | 2 +- command/repo/update.go | 2 +- command/secret/add.go | 2 +- command/secret/get.go | 2 +- command/secret/remove.go | 2 +- command/secret/update.go | 2 +- command/secret/view.go | 2 +- go.mod | 7 +++---- go.sum | 14 ++++++-------- version/version.go | 2 +- 44 files changed, 124 insertions(+), 137 deletions(-) diff --git a/action/deployment/add.go b/action/deployment/add.go index 4fb3ed64..827472b9 100644 --- a/action/deployment/add.go +++ b/action/deployment/add.go @@ -7,7 +7,7 @@ import ( "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) // Add creates a deployment based off the provided configuration. @@ -15,9 +15,7 @@ func (c *Config) Add(client *vela.Client) error { logrus.Debug("executing add for deployment configuration") // create the deployment object - // - // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Deployment - d := &library.Deployment{ + d := &api.Deployment{ Ref: &c.Ref, Task: &c.Task, Target: &c.Target, diff --git a/action/deployment/add_test.go b/action/deployment/add_test.go index 26c42041..23ed9216 100644 --- a/action/deployment/add_test.go +++ b/action/deployment/add_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/compiler/types/raw" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/raw" ) func TestDeployment_Config_Add(t *testing.T) { diff --git a/action/deployment/deployment.go b/action/deployment/deployment.go index 1a05eff2..16586f1d 100644 --- a/action/deployment/deployment.go +++ b/action/deployment/deployment.go @@ -4,7 +4,7 @@ package deployment import ( "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/raw" + "github.com/go-vela/server/compiler/types/raw" ) // Config represents the configuration necessary diff --git a/action/deployment/table.go b/action/deployment/table.go index c8eb9649..a4581db6 100644 --- a/action/deployment/table.go +++ b/action/deployment/table.go @@ -9,13 +9,13 @@ import ( "github.com/sirupsen/logrus" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) // table is a helper function to output the // provided deployments in a table format with // a specific set of fields displayed. -func table(deployments *[]library.Deployment) error { +func table(deployments *[]api.Deployment) error { logrus.Debug("creating table for list of deployments") // create a new table @@ -59,7 +59,7 @@ func table(deployments *[]library.Deployment) error { // wideTable is a helper function to output the // provided deployments in a wide table format with // a specific set of fields displayed. -func wideTable(deployments *[]library.Deployment) error { +func wideTable(deployments *[]api.Deployment) error { logrus.Debug("creating wide table for list of deployments") // create new wide table @@ -103,7 +103,7 @@ func wideTable(deployments *[]library.Deployment) error { // reverse is a helper function to sort the deployments // based off the deployment number and then flip the // order they get displayed in. -func reverse(d []library.Deployment) []library.Deployment { +func reverse(d []api.Deployment) []api.Deployment { // sort the list of deployments based off the deployment id sort.SliceStable(d, func(i, j int) bool { return d[i].GetID() < d[j].GetID() diff --git a/action/deployment/table_test.go b/action/deployment/table_test.go index 715cc805..b43d34d2 100644 --- a/action/deployment/table_test.go +++ b/action/deployment/table_test.go @@ -5,7 +5,7 @@ package deployment import ( "testing" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) func TestDeployment_table(t *testing.T) { @@ -19,11 +19,11 @@ func TestDeployment_table(t *testing.T) { // setup tests tests := []struct { failure bool - steps *[]library.Deployment + steps *[]api.Deployment }{ { failure: false, - steps: &[]library.Deployment{ + steps: &[]api.Deployment{ *d1, *d2, }, @@ -59,11 +59,11 @@ func TestDeployment_wideTable(t *testing.T) { // setup tests tests := []struct { failure bool - steps *[]library.Deployment + steps *[]api.Deployment }{ { failure: false, - steps: &[]library.Deployment{ + steps: &[]api.Deployment{ *d1, *d2, }, @@ -90,11 +90,10 @@ func TestDeployment_wideTable(t *testing.T) { // testDeployment is a test helper function to create a Deployment // type with all fields set to a fake value. -func testDeployment() *library.Deployment { - d := new(library.Deployment) +func testDeployment() *api.Deployment { + d := new(api.Deployment) d.SetID(1) - d.SetRepoID(1) d.SetURL("https://api.github.com/repos/github/octocat/deployments/1") d.SetCreatedBy("octocat") d.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") diff --git a/action/hook/table.go b/action/hook/table.go index 24a9f81d..140ed0b5 100644 --- a/action/hook/table.go +++ b/action/hook/table.go @@ -11,13 +11,13 @@ import ( "github.com/sirupsen/logrus" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) // table is a helper function to output the // provided hooks in a table format with // a specific set of fields displayed. -func table(hooks *[]library.Hook) error { +func table(hooks *[]api.Hook) error { logrus.Debug("creating table for list of hooks") // create a new table @@ -66,7 +66,7 @@ func table(hooks *[]library.Hook) error { // wideTable is a helper function to output the // provided hooks in a wide table format with // a specific set of fields displayed. -func wideTable(hooks *[]library.Hook) error { +func wideTable(hooks *[]api.Hook) error { logrus.Debug("creating wide table for list of hooks") // create new wide table @@ -115,7 +115,7 @@ func wideTable(hooks *[]library.Hook) error { // reverse is a helper function to sort the hooks // based off the hook number and then flip the // order they get displayed in. -func reverse(h []library.Hook) []library.Hook { +func reverse(h []api.Hook) []api.Hook { // sort the list of hooks based off the hook number sort.SliceStable(h, func(i, j int) bool { return h[i].GetNumber() < h[j].GetNumber() diff --git a/action/hook/table_test.go b/action/hook/table_test.go index 635e4f45..6b8007ae 100644 --- a/action/hook/table_test.go +++ b/action/hook/table_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) func TestHook_table(t *testing.T) { @@ -20,11 +20,11 @@ func TestHook_table(t *testing.T) { // setup tests tests := []struct { failure bool - steps *[]library.Hook + steps *[]api.Hook }{ { failure: false, - steps: &[]library.Hook{ + steps: &[]api.Hook{ *h1, *h2, }, @@ -60,11 +60,11 @@ func TestHook_wideTable(t *testing.T) { // setup tests tests := []struct { failure bool - steps *[]library.Hook + steps *[]api.Hook }{ { failure: false, - steps: &[]library.Hook{ + steps: &[]api.Hook{ *h1, *h2, }, @@ -91,12 +91,10 @@ func TestHook_wideTable(t *testing.T) { // testHook is a test helper function to create a Hook // type with all fields set to a fake value. -func testHook() *library.Hook { - h := new(library.Hook) +func testHook() *api.Hook { + h := new(api.Hook) h.SetID(1) - h.SetRepoID(1) - h.SetBuildID(1) h.SetNumber(1) h.SetSourceID("c8da1302-07d6-11ea-882f-4893bca275b8") h.SetCreated(time.Now().UTC().Unix()) diff --git a/action/pipeline/exec.go b/action/pipeline/exec.go index 3385d6cd..ae91d641 100644 --- a/action/pipeline/exec.go +++ b/action/pipeline/exec.go @@ -16,7 +16,7 @@ import ( "github.com/go-vela/cli/version" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/compiler" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" ) diff --git a/action/pipeline/stage.go b/action/pipeline/stage.go index 84341d1a..5d3ddbcb 100644 --- a/action/pipeline/stage.go +++ b/action/pipeline/stage.go @@ -5,7 +5,7 @@ package pipeline import ( "github.com/sirupsen/logrus" - "github.com/go-vela/types/yaml" + "github.com/go-vela/server/compiler/types/yaml" ) func stages(pipelineType string) *yaml.Build { @@ -38,7 +38,7 @@ func stages(pipelineType string) *yaml.Build { // return a stages pipeline based off the type // - // https://pkg.go.dev/github.com/go-vela/types/yaml?tab=doc#Build + // https://pkg.go.dev/github.com/go-vela/server/compiler/types/yaml?tab=doc#Build return &yaml.Build{ Version: "1", Stages: yaml.StageSlice{ diff --git a/action/pipeline/stage_test.go b/action/pipeline/stage_test.go index 96f34896..1815e056 100644 --- a/action/pipeline/stage_test.go +++ b/action/pipeline/stage_test.go @@ -6,7 +6,7 @@ import ( "reflect" "testing" - "github.com/go-vela/types/yaml" + "github.com/go-vela/server/compiler/types/yaml" ) func TestPipeline_stages(t *testing.T) { diff --git a/action/pipeline/step.go b/action/pipeline/step.go index ffaa3079..3cbe2148 100644 --- a/action/pipeline/step.go +++ b/action/pipeline/step.go @@ -5,7 +5,7 @@ package pipeline import ( "github.com/sirupsen/logrus" - "github.com/go-vela/types/yaml" + "github.com/go-vela/server/compiler/types/yaml" ) func steps(pipelineType string) *yaml.Build { @@ -38,7 +38,7 @@ func steps(pipelineType string) *yaml.Build { // return a steps pipeline based off the type // - // https://pkg.go.dev/github.com/go-vela/types/yaml?tab=doc#Build + // https://pkg.go.dev/github.com/go-vela/server/compiler/types/yaml?tab=doc#Build return &yaml.Build{ Version: "1", Steps: yaml.StepSlice{ diff --git a/action/pipeline/step_test.go b/action/pipeline/step_test.go index 933ee502..e06cdba6 100644 --- a/action/pipeline/step_test.go +++ b/action/pipeline/step_test.go @@ -6,7 +6,7 @@ import ( "reflect" "testing" - "github.com/go-vela/types/yaml" + "github.com/go-vela/server/compiler/types/yaml" ) func TestPipeline_steps(t *testing.T) { diff --git a/action/pipeline/table.go b/action/pipeline/table.go index 9d0dec41..df332137 100644 --- a/action/pipeline/table.go +++ b/action/pipeline/table.go @@ -9,13 +9,13 @@ import ( "github.com/sirupsen/logrus" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) // table is a helper function to output the // provided pipelines in a table format with // a specific set of fields displayed. -func table(pipelines *[]library.Pipeline) error { +func table(pipelines *[]api.Pipeline) error { logrus.Debug("creating table for list of pipelines") // create a new table @@ -59,7 +59,7 @@ func table(pipelines *[]library.Pipeline) error { // wideTable is a helper function to output the // provided pipelines in a wide table format with // a specific set of fields displayed. -func wideTable(pipelines *[]library.Pipeline) error { +func wideTable(pipelines *[]api.Pipeline) error { logrus.Debug("creating wide table for list of pipelines") // create new wide table @@ -103,7 +103,7 @@ func wideTable(pipelines *[]library.Pipeline) error { // reverse is a helper function to sort the pipelines // based off the pipeline number and then flip the // order they get displayed in. -func reverse(p []library.Pipeline) []library.Pipeline { +func reverse(p []api.Pipeline) []api.Pipeline { // sort the list of pipelines based off the pipeline id sort.SliceStable(p, func(i, j int) bool { return p[i].GetID() < p[j].GetID() diff --git a/action/pipeline/table_test.go b/action/pipeline/table_test.go index 5d7334f1..0906b784 100644 --- a/action/pipeline/table_test.go +++ b/action/pipeline/table_test.go @@ -5,7 +5,7 @@ package pipeline import ( "testing" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) func TestPipeline_table(t *testing.T) { @@ -20,12 +20,12 @@ func TestPipeline_table(t *testing.T) { tests := []struct { name string failure bool - pipelines *[]library.Pipeline + pipelines *[]api.Pipeline }{ { name: "success", failure: false, - pipelines: &[]library.Pipeline{ + pipelines: &[]api.Pipeline{ *p1, *p2, }, @@ -64,12 +64,12 @@ func TestPipeline_wideTable(t *testing.T) { tests := []struct { name string failure bool - pipelines *[]library.Pipeline + pipelines *[]api.Pipeline }{ { name: "success", failure: false, - pipelines: &[]library.Pipeline{ + pipelines: &[]api.Pipeline{ *p1, *p2, }, @@ -98,11 +98,10 @@ func TestPipeline_wideTable(t *testing.T) { // testPipeline is a test helper function to create a Pipeline // type with all fields set to a fake value. -func testPipeline() *library.Pipeline { - p := new(library.Pipeline) +func testPipeline() *api.Pipeline { + p := new(api.Pipeline) p.SetID(1) - p.SetRepoID(1) p.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163") p.SetFlavor("large") p.SetPlatform("docker") diff --git a/action/pipeline/validate.go b/action/pipeline/validate.go index 433e5c1f..8cc75548 100644 --- a/action/pipeline/validate.go +++ b/action/pipeline/validate.go @@ -15,9 +15,9 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/compiler" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" - "github.com/go-vela/types/yaml" + "github.com/go-vela/server/compiler/types/pipeline" + "github.com/go-vela/server/compiler/types/yaml" + "github.com/go-vela/server/constants" ) // Validate verifies the configuration provided. diff --git a/action/repo/validate.go b/action/repo/validate.go index 00988547..715e4453 100644 --- a/action/repo/validate.go +++ b/action/repo/validate.go @@ -7,7 +7,7 @@ import ( "github.com/sirupsen/logrus" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // Validate verifies the configuration provided. diff --git a/action/secret/add.go b/action/secret/add.go index f2057376..e04389ed 100644 --- a/action/secret/add.go +++ b/action/secret/add.go @@ -14,8 +14,8 @@ import ( "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/constants" ) // Add creates a secret based on the provided configuration. @@ -46,7 +46,7 @@ func (c *Config) Add(client *vela.Client) error { // create the secret object // // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Secret - s := &library.Secret{ + s := &api.Secret{ Type: &c.Type, Org: &c.Org, Repo: &c.Repo, @@ -60,7 +60,7 @@ func (c *Config) Add(client *vela.Client) error { // populate events if provided if len(c.AllowEvents) > 0 { - evs, err := library.NewEventsFromSlice(c.AllowEvents) + evs, err := api.NewEventsFromSlice(c.AllowEvents) if err != nil { return err } diff --git a/action/secret/file.go b/action/secret/file.go index f3618bbd..494048fa 100644 --- a/action/secret/file.go +++ b/action/secret/file.go @@ -2,7 +2,7 @@ package secret -import "github.com/go-vela/types/library" +import api "github.com/go-vela/server/api/types" // ConfigFile represents the secret configuration necessary // to perform secret related requests from a file with Vela. @@ -11,5 +11,5 @@ type ConfigFile struct { Version string `yaml:"version,omitempty"` Engine string `yaml:"engine,omitempty"` } `yaml:"metadata,omitempty"` - Secrets []*library.Secret `yaml:"secrets,omitempty"` + Secrets []*api.Secret `yaml:"secrets,omitempty"` } diff --git a/action/secret/get.go b/action/secret/get.go index 75b9e9c7..1bb928c4 100644 --- a/action/secret/get.go +++ b/action/secret/get.go @@ -9,7 +9,7 @@ import ( "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // Get captures a list of secrets based on the provided configuration. diff --git a/action/secret/remove.go b/action/secret/remove.go index 9317b9c0..4f25d420 100644 --- a/action/secret/remove.go +++ b/action/secret/remove.go @@ -9,7 +9,7 @@ import ( "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // Remove deletes a secret based on the provided configuration. diff --git a/action/secret/table.go b/action/secret/table.go index 0e481e5a..6b23a3c0 100644 --- a/action/secret/table.go +++ b/action/secret/table.go @@ -10,14 +10,14 @@ import ( "github.com/sirupsen/logrus" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/constants" ) // table is a helper function to output the // provided secrets in a table format with // a specific set of fields displayed. -func table(secrets *[]library.Secret) error { +func table(secrets *[]api.Secret) error { logrus.Debug("creating table for list of secrets") // create a new table @@ -66,7 +66,7 @@ func table(secrets *[]library.Secret) error { // wideTable is a helper function to output the // provided secrets in a wide table format with // a specific set of fields displayed. -func wideTable(secrets *[]library.Secret) error { +func wideTable(secrets *[]api.Secret) error { logrus.Debug("creating wide table for list of secrets") // create new wide table @@ -120,7 +120,7 @@ func wideTable(secrets *[]library.Secret) error { // key is a helper function to calculate the full // path to a secret in the storage backend. -func key(s *library.Secret) string { +func key(s *api.Secret) string { switch s.GetType() { case constants.SecretShared: return fmt.Sprintf("%s/%s/%s", s.GetOrg(), s.GetTeam(), s.GetName()) diff --git a/action/secret/table_test.go b/action/secret/table_test.go index 6499b23d..56932967 100644 --- a/action/secret/table_test.go +++ b/action/secret/table_test.go @@ -5,7 +5,7 @@ package secret import ( "testing" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) func TestSecret_table(t *testing.T) { @@ -25,11 +25,11 @@ func TestSecret_table(t *testing.T) { // setup tests tests := []struct { failure bool - secrets *[]library.Secret + secrets *[]api.Secret }{ { failure: false, - secrets: &[]library.Secret{ + secrets: &[]api.Secret{ *s1, *s2, *s3, @@ -74,11 +74,11 @@ func TestSecret_wideTable(t *testing.T) { // setup tests tests := []struct { failure bool - secrets *[]library.Secret + secrets *[]api.Secret }{ { failure: false, - secrets: &[]library.Secret{ + secrets: &[]api.Secret{ *s1, *s2, *s3, @@ -106,8 +106,8 @@ func TestSecret_wideTable(t *testing.T) { // testSecret is a test helper function to create a Secret // type with all fields set to a fake value. -func testSecret() *library.Secret { - s := new(library.Secret) +func testSecret() *api.Secret { + s := new(api.Secret) s.SetID(1) s.SetOrg("github") diff --git a/action/secret/update.go b/action/secret/update.go index 6cfcc8a7..6c14c9ff 100644 --- a/action/secret/update.go +++ b/action/secret/update.go @@ -14,8 +14,8 @@ import ( "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/constants" ) // Update modifies a secret based on the provided configuration. @@ -44,9 +44,7 @@ func (c *Config) Update(client *vela.Client) error { } // create the secret object - // - // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Secret - s := &library.Secret{ + s := &api.Secret{ Type: &c.Type, Org: &c.Org, Repo: &c.Repo, @@ -60,7 +58,7 @@ func (c *Config) Update(client *vela.Client) error { // populate events if provided if len(c.AllowEvents) > 0 { - evs, err := library.NewEventsFromSlice(c.AllowEvents) + evs, err := api.NewEventsFromSlice(c.AllowEvents) if err != nil { return err } diff --git a/action/secret/validate.go b/action/secret/validate.go index 79dda5c5..420dc916 100644 --- a/action/secret/validate.go +++ b/action/secret/validate.go @@ -8,8 +8,8 @@ import ( "github.com/sirupsen/logrus" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/constants" ) // Validate verifies the configuration provided. @@ -83,7 +83,7 @@ func (c *Config) Validate() error { // check if secret action is add or update if c.Action == "add" || c.Action == "update" { - _, err := library.NewEventsFromSlice(c.AllowEvents) + _, err := api.NewEventsFromSlice(c.AllowEvents) if err != nil { return err } diff --git a/action/secret/view.go b/action/secret/view.go index 24cfbece..a2d7276f 100644 --- a/action/secret/view.go +++ b/action/secret/view.go @@ -12,9 +12,9 @@ import ( "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - pyaml "github.com/go-vela/types/yaml" + api "github.com/go-vela/server/api/types" + pyaml "github.com/go-vela/server/compiler/types/yaml" + "github.com/go-vela/server/constants" ) // View inspects a secret based on the provided configuration. @@ -76,7 +76,7 @@ func (c *Config) View(client *vela.Client) error { // outputDefault is a helper function to output the // provided secrets with a copy pipeline secret and // library details formatted with yaml. -func outputDefault(engine string, s *library.Secret) error { +func outputDefault(engine string, s *api.Secret) error { // create yaml secret secret := &pyaml.Secret{ Name: s.GetName(), @@ -92,9 +92,9 @@ func outputDefault(engine string, s *library.Secret) error { []*pyaml.Secret{secret}, } - // anonymous struct for library secret + // anonymous struct for API secret _s := struct { - Details *library.Secret `yaml:"details"` + Details *api.Secret `yaml:"details"` }{ s, } diff --git a/action/service/table.go b/action/service/table.go index 2e33935f..94028f21 100644 --- a/action/service/table.go +++ b/action/service/table.go @@ -11,13 +11,13 @@ import ( "github.com/sirupsen/logrus" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) // table is a helper function to output the // provided services in a table format with // a specific set of fields displayed. -func table(services *[]library.Service) error { +func table(services *[]api.Service) error { logrus.Debug("creating table for list of services") // create a new table @@ -61,7 +61,7 @@ func table(services *[]library.Service) error { // wideTable is a helper function to output the // provided services in a wide table format with // a specific set of fields displayed. -func wideTable(services *[]library.Service) error { +func wideTable(services *[]api.Service) error { logrus.Debug("creating wide table for list of services") // create new wide table @@ -115,7 +115,7 @@ func wideTable(services *[]library.Service) error { // reverse is a helper function to sort the services // based off the service number and then flip the // order they get displayed in. -func reverse(s []library.Service) []library.Service { +func reverse(s []api.Service) []api.Service { // sort the list of services based off the service number sort.SliceStable(s, func(i, j int) bool { return s[i].GetNumber() < s[j].GetNumber() diff --git a/action/service/table_test.go b/action/service/table_test.go index 29ebf43b..93d43025 100644 --- a/action/service/table_test.go +++ b/action/service/table_test.go @@ -5,7 +5,7 @@ package service import ( "testing" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) func TestService_table(t *testing.T) { @@ -22,11 +22,11 @@ func TestService_table(t *testing.T) { // setup tests tests := []struct { failure bool - steps *[]library.Service + steps *[]api.Service }{ { failure: false, - steps: &[]library.Service{ + steps: &[]api.Service{ *s1, *s2, }, @@ -65,11 +65,11 @@ func TestService_wideTable(t *testing.T) { // setup tests tests := []struct { failure bool - steps *[]library.Service + steps *[]api.Service }{ { failure: false, - steps: &[]library.Service{ + steps: &[]api.Service{ *s1, *s2, }, @@ -96,8 +96,8 @@ func TestService_wideTable(t *testing.T) { // testService is a test helper function to create a Service // type with all fields set to a fake value. -func testService() *library.Service { - s := new(library.Service) +func testService() *api.Service { + s := new(api.Service) s.SetID(1) s.SetBuildID(1) diff --git a/action/step/table.go b/action/step/table.go index 0412d201..e84386c5 100644 --- a/action/step/table.go +++ b/action/step/table.go @@ -11,13 +11,13 @@ import ( "github.com/sirupsen/logrus" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) // table is a helper function to output the // provided steps in a table format with // a specific set of fields displayed. -func table(steps *[]library.Step) error { +func table(steps *[]api.Step) error { logrus.Debug("creating table for list of steps") // create a new table @@ -61,7 +61,7 @@ func table(steps *[]library.Step) error { // wideTable is a helper function to output the // provided steps in a wide table format with // a specific set of fields displayed. -func wideTable(steps *[]library.Step) error { +func wideTable(steps *[]api.Step) error { logrus.Debug("creating wide table for list of steps") // create new wide table @@ -115,7 +115,7 @@ func wideTable(steps *[]library.Step) error { // reverse is a helper function to sort the steps // based off the step number and then flip the // order they get displayed in. -func reverse(s []library.Step) []library.Step { +func reverse(s []api.Step) []api.Step { // sort the list of steps based off the step number sort.SliceStable(s, func(i, j int) bool { return s[i].GetNumber() < s[j].GetNumber() diff --git a/action/step/table_test.go b/action/step/table_test.go index 882929ac..04a69829 100644 --- a/action/step/table_test.go +++ b/action/step/table_test.go @@ -5,7 +5,7 @@ package step import ( "testing" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) func TestStep_table(t *testing.T) { @@ -22,11 +22,11 @@ func TestStep_table(t *testing.T) { // setup tests tests := []struct { failure bool - steps *[]library.Step + steps *[]api.Step }{ { failure: false, - steps: &[]library.Step{ + steps: &[]api.Step{ *s1, *s2, }, @@ -65,11 +65,11 @@ func TestStep_wideTable(t *testing.T) { // setup tests tests := []struct { failure bool - steps *[]library.Step + steps *[]api.Step }{ { failure: false, - steps: &[]library.Step{ + steps: &[]api.Step{ *s1, *s2, }, @@ -96,8 +96,8 @@ func TestStep_wideTable(t *testing.T) { // testStep is a test helper function to create a Step // type with all fields set to a fake value. -func testStep() *library.Step { - s := new(library.Step) +func testStep() *api.Step { + s := new(api.Step) s.SetID(1) s.SetBuildID(1) diff --git a/action/worker/update.go b/action/worker/update.go index 9aa42192..ff72af0b 100644 --- a/action/worker/update.go +++ b/action/worker/update.go @@ -15,8 +15,6 @@ func (c *Config) Update(client *vela.Client) error { logrus.Debug("executing update for worker configuration") // create the worker object - // - // https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Worker w := &api.Worker{ Hostname: vela.String(c.Hostname), Address: vela.String(c.Address), diff --git a/command/deployment/add.go b/command/deployment/add.go index e6d69c7a..277c373d 100644 --- a/command/deployment/add.go +++ b/command/deployment/add.go @@ -15,7 +15,7 @@ import ( "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/raw" + "github.com/go-vela/server/compiler/types/raw" ) // CommandAdd defines the command for creating a deployment. diff --git a/command/deployment/add_test.go b/command/deployment/add_test.go index 6579c6d7..1b5afd4f 100644 --- a/command/deployment/add_test.go +++ b/command/deployment/add_test.go @@ -11,8 +11,8 @@ import ( "github.com/urfave/cli/v2" "github.com/go-vela/cli/test" + "github.com/go-vela/server/compiler/types/raw" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/raw" ) func TestDeployment_Add(t *testing.T) { diff --git a/command/pipeline/exec.go b/command/pipeline/exec.go index 47d044cf..8eeb0513 100644 --- a/command/pipeline/exec.go +++ b/command/pipeline/exec.go @@ -16,7 +16,7 @@ import ( "github.com/go-vela/cli/action/pipeline" "github.com/go-vela/cli/internal" "github.com/go-vela/server/compiler/native" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // CommandExec defines the command for executing a pipeline. diff --git a/command/pipeline/validate.go b/command/pipeline/validate.go index bb8b01e1..82d36c55 100644 --- a/command/pipeline/validate.go +++ b/command/pipeline/validate.go @@ -14,7 +14,7 @@ import ( "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" "github.com/go-vela/server/compiler/native" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // CommandValidate defines the command for verifying a pipeline. diff --git a/command/repo/add.go b/command/repo/add.go index 99bb3b91..23b810f5 100644 --- a/command/repo/add.go +++ b/command/repo/add.go @@ -13,7 +13,7 @@ import ( "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // CommandAdd defines the command for creating a repository. diff --git a/command/repo/update.go b/command/repo/update.go index fe56a77d..da0fcbfe 100644 --- a/command/repo/update.go +++ b/command/repo/update.go @@ -13,7 +13,7 @@ import ( "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // CommandUpdate defines the command for modifying a repository. diff --git a/command/secret/add.go b/command/secret/add.go index bf0ed931..dcd797f3 100644 --- a/command/secret/add.go +++ b/command/secret/add.go @@ -13,7 +13,7 @@ import ( "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // CommandAdd defines the command for creating a secret. diff --git a/command/secret/get.go b/command/secret/get.go index c4ec13f2..cc3e3e84 100644 --- a/command/secret/get.go +++ b/command/secret/get.go @@ -12,7 +12,7 @@ import ( "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // CommandGet defines the command for inspecting a secret. diff --git a/command/secret/remove.go b/command/secret/remove.go index b2ca0aef..d26cd33d 100644 --- a/command/secret/remove.go +++ b/command/secret/remove.go @@ -13,7 +13,7 @@ import ( "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // CommandRemove defines the command for inspecting a secret. diff --git a/command/secret/update.go b/command/secret/update.go index b3d27a0c..08e43cb8 100644 --- a/command/secret/update.go +++ b/command/secret/update.go @@ -13,7 +13,7 @@ import ( "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // CommandUpdate defines the command for updating a secret. diff --git a/command/secret/view.go b/command/secret/view.go index d73f8b84..e984eb7b 100644 --- a/command/secret/view.go +++ b/command/secret/view.go @@ -13,7 +13,7 @@ import ( "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/constants" + "github.com/go-vela/server/constants" ) // CommandView defines the command for inspecting a secret. diff --git a/go.mod b/go.mod index e9470cb5..45cf1206 100644 --- a/go.mod +++ b/go.mod @@ -12,10 +12,9 @@ require ( github.com/dustin/go-humanize v1.0.1 github.com/gin-gonic/gin v1.10.0 github.com/go-git/go-git/v5 v5.12.0 - github.com/go-vela/sdk-go v0.25.1 - github.com/go-vela/server v0.25.1 - github.com/go-vela/types v0.25.1 - github.com/go-vela/worker v0.25.1 + github.com/go-vela/sdk-go v0.25.2-0.20241022142543-b9de2ce2abea + github.com/go-vela/server v0.25.1-0.20241022141112-a2b0d9146d65 + github.com/go-vela/worker v0.25.2-0.20241022143822-3db6801bfd10 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/gosuri/uitable v0.0.4 github.com/joho/godotenv v1.5.1 diff --git a/go.sum b/go.sum index 1b2816b0..976e6380 100644 --- a/go.sum +++ b/go.sum @@ -139,14 +139,12 @@ github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27 github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-vela/sdk-go v0.25.1 h1:aEWH88BjLmV5s3mWPbi7OeGY5u8IQ9xQNF8CWH3e5HU= -github.com/go-vela/sdk-go v0.25.1/go.mod h1:98yxwcqGQidNke/QsbG8WeYJG56AImc9o9dcKiXBQ5k= -github.com/go-vela/server v0.25.1 h1:KM3g5ZD3N6SnttnkfOyJjS2utbL6baKx0mGSJLCEf0c= -github.com/go-vela/server v0.25.1/go.mod h1:QZ9troVMUpDCAdUxxAquHqahkeSwp9Lmx6a47ao0gGs= -github.com/go-vela/types v0.25.1 h1:DCPHv1+ouqldjfsjfcVTcm/Yyd0OwazIfxYyR+GwpMo= -github.com/go-vela/types v0.25.1/go.mod h1:5+MHUI9ZSY2Uz1cTJa64FWUv8jKzzUUq96UQTokGJzs= -github.com/go-vela/worker v0.25.1 h1:vpD82MEZUBgloNiXUa0KtZzxz9+V5+vOusiFdQbE6lM= -github.com/go-vela/worker v0.25.1/go.mod h1:tZ4AEUc4kf5umXFZ3/9piQhqe4E8QkmxjrhoJ2/9rt8= +github.com/go-vela/sdk-go v0.25.2-0.20241022142543-b9de2ce2abea h1:tdUe3vW8HCMutfmttFt3UE0hH8qHSz4PgQYs4Q2eBX0= +github.com/go-vela/sdk-go v0.25.2-0.20241022142543-b9de2ce2abea/go.mod h1:4Q8UW6fLzke4SVU1dJBViZMOSfMiIKMGZ42lPrzk5WA= +github.com/go-vela/server v0.25.1-0.20241022141112-a2b0d9146d65 h1:BepNezNRDLfookgMn81U9WB0/aMBxkqot9w8nLPWNhU= +github.com/go-vela/server v0.25.1-0.20241022141112-a2b0d9146d65/go.mod h1:hdVkyyxnRtk+Vjs7nCnKEkwWmd9yVQUV5Akpt7BY6wg= +github.com/go-vela/worker v0.25.2-0.20241022143822-3db6801bfd10 h1:U7zOrALRZjGIPBb1P3xPnavE+RjeSOVx7knSBNQIIDU= +github.com/go-vela/worker v0.25.2-0.20241022143822-3db6801bfd10/go.mod h1:d8KFUSlIpl29i0tPUq1bxfERDL1//v1EZgYOYXpmfPY= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= diff --git a/version/version.go b/version/version.go index f363d79b..f0709fe4 100644 --- a/version/version.go +++ b/version/version.go @@ -9,7 +9,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/sirupsen/logrus" - "github.com/go-vela/types/version" + "github.com/go-vela/server/version" ) var (