From 0e10f28918e44a33c535e5e7b72c9e102424ec6c Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:10:29 -0400 Subject: [PATCH] chore: use server API and compiler types (#609) --- cmd/vela-worker/exec.go | 2 +- cmd/vela-worker/run.go | 2 +- executor/engine.go | 2 +- executor/executor_test.go | 2 +- executor/linux/api.go | 9 +- executor/linux/build.go | 7 +- executor/linux/build_test.go | 2 +- executor/linux/linux.go | 11 ++- executor/linux/linux_test.go | 2 +- executor/linux/opts.go | 2 +- executor/linux/opts_test.go | 2 +- executor/linux/outputs.go | 2 +- executor/linux/outputs_test.go | 14 ++-- executor/linux/secret.go | 12 +-- executor/linux/secret_test.go | 91 +++++++++++---------- executor/linux/service.go | 8 +- executor/linux/service_test.go | 7 +- executor/linux/stage.go | 2 +- executor/linux/stage_test.go | 2 +- executor/linux/step.go | 10 +-- executor/linux/step_test.go | 7 +- executor/local/api.go | 9 +- executor/local/build_test.go | 2 +- executor/local/local.go | 2 +- executor/local/local_test.go | 2 +- executor/local/opts.go | 2 +- executor/local/opts_test.go | 2 +- executor/local/service.go | 8 +- executor/local/service_test.go | 6 +- executor/local/stage.go | 2 +- executor/local/stage_test.go | 2 +- executor/local/step.go | 8 +- executor/local/step_test.go | 6 +- executor/setup.go | 2 +- go.mod | 4 +- go.sum | 8 +- internal/message/stream.go | 2 +- internal/service/environment.go | 5 +- internal/service/environment_test.go | 9 +- internal/service/load.go | 7 +- internal/service/load_test.go | 9 +- internal/service/snapshot.go | 5 +- internal/service/snapshot_test.go | 7 +- internal/service/upload.go | 5 +- internal/service/upload_test.go | 7 +- internal/step/environment.go | 5 +- internal/step/environment_test.go | 9 +- internal/step/load.go | 7 +- internal/step/load_test.go | 9 +- internal/step/skip.go | 2 +- internal/step/skip_test.go | 2 +- internal/step/snapshot.go | 6 +- internal/step/snapshot_test.go | 10 +-- internal/step/upload.go | 5 +- internal/step/upload_test.go | 7 +- mock/worker/executor.go | 6 +- mock/worker/pipeline.go | 4 +- router/middleware/executor/executor_test.go | 2 +- runtime/docker/build.go | 2 +- runtime/docker/build_test.go | 2 +- runtime/docker/container.go | 2 +- runtime/docker/container_test.go | 2 +- runtime/docker/docker_test.go | 2 +- runtime/docker/image.go | 2 +- runtime/docker/image_test.go | 2 +- runtime/docker/network.go | 2 +- runtime/docker/network_test.go | 2 +- runtime/docker/volume.go | 2 +- runtime/docker/volume_test.go | 2 +- runtime/engine.go | 2 +- runtime/kubernetes/build.go | 2 +- runtime/kubernetes/build_test.go | 2 +- runtime/kubernetes/container.go | 2 +- runtime/kubernetes/container_test.go | 2 +- runtime/kubernetes/image.go | 2 +- runtime/kubernetes/image_test.go | 2 +- runtime/kubernetes/kubernetes_test.go | 2 +- runtime/kubernetes/network.go | 2 +- runtime/kubernetes/network_test.go | 2 +- runtime/kubernetes/volume.go | 2 +- runtime/kubernetes/volume_test.go | 2 +- 81 files changed, 217 insertions(+), 222 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 99a319ea..25b9e3e3 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -14,11 +14,11 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/queue/models" "github.com/go-vela/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/version" diff --git a/cmd/vela-worker/run.go b/cmd/vela-worker/run.go index a0ff3cef..d317fb56 100644 --- a/cmd/vela-worker/run.go +++ b/cmd/vela-worker/run.go @@ -13,9 +13,9 @@ import ( _ "github.com/joho/godotenv/autoload" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/queue" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" ) diff --git a/executor/engine.go b/executor/engine.go index d9cdcb50..9cac8586 100644 --- a/executor/engine.go +++ b/executor/engine.go @@ -7,7 +7,7 @@ import ( "sync" api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) // Engine represents the interface for Vela integrating diff --git a/executor/executor_test.go b/executor/executor_test.go index 48d8d778..7ac70f2b 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -13,9 +13,9 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/api/types/actions" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/executor/linux" "github.com/go-vela/worker/executor/local" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/api.go b/executor/linux/api.go index 0654000c..13c8c4b0 100644 --- a/executor/linux/api.go +++ b/executor/linux/api.go @@ -8,9 +8,8 @@ import ( "time" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/service" "github.com/go-vela/worker/internal/step" ) @@ -63,7 +62,7 @@ func (c *client) CancelBuild() (*api.Build, error) { s, err := service.Load(_service, &c.services) if err != nil { // create the library service object - s = new(library.Service) + s = new(api.Service) s.SetName(_service.Name) s.SetNumber(_service.Number) s.SetImage(_service.Image) @@ -104,7 +103,7 @@ func (c *client) CancelBuild() (*api.Build, error) { s, err := step.Load(_step, &c.steps) if err != nil { // create the library step object - s = new(library.Step) + s = new(api.Step) s.SetName(_step.Name) s.SetNumber(_step.Number) s.SetImage(_step.Image) @@ -146,7 +145,7 @@ func (c *client) CancelBuild() (*api.Build, error) { s, err := step.Load(_step, &c.steps) if err != nil { // create the library step object - s = new(library.Step) + s = new(api.Step) s.SetName(_step.Name) s.SetNumber(_step.Number) s.SetImage(_step.Image) diff --git a/executor/linux/build.go b/executor/linux/build.go index cc9f54f8..a594a15a 100644 --- a/executor/linux/build.go +++ b/executor/linux/build.go @@ -12,9 +12,10 @@ import ( "golang.org/x/sync/errgroup" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/build" context2 "github.com/go-vela/worker/internal/context" "github.com/go-vela/worker/internal/image" @@ -699,8 +700,8 @@ func (c *client) StreamBuild(ctx context.Context) error { func loadLazySecrets(c *client, _step *pipeline.Container) error { _log := new(library.Log) - lazySecrets := make(map[string]*library.Secret) - lazyNoSubSecrets := make(map[string]*library.Secret) + lazySecrets := make(map[string]*api.Secret) + lazyNoSubSecrets := make(map[string]*api.Secret) // this requires a small preface and brief description on // how normal secrets make it into a container: diff --git a/executor/linux/build_test.go b/executor/linux/build_test.go index 12fac9bf..4ee5696b 100644 --- a/executor/linux/build_test.go +++ b/executor/linux/build_test.go @@ -19,9 +19,9 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/compiler/native" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/linux.go b/executor/linux/linux.go index d2c1bfd2..70502d85 100644 --- a/executor/linux/linux.go +++ b/executor/linux/linux.go @@ -12,8 +12,7 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" ) @@ -25,8 +24,8 @@ type ( Logger *logrus.Entry Vela *vela.Client Runtime runtime.Engine - Secrets map[string]*library.Secret - NoSubSecrets map[string]*library.Secret + Secrets map[string]*api.Secret + NoSubSecrets map[string]*api.Secret Hostname string Version string OutputCtn *pipeline.Container @@ -117,10 +116,10 @@ func New(opts ...Opt) (*client, error) { } // instantiate map for non-plugin secrets - c.Secrets = make(map[string]*library.Secret) + c.Secrets = make(map[string]*api.Secret) // instantiate map for non-substituted secrets - c.NoSubSecrets = make(map[string]*library.Secret) + c.NoSubSecrets = make(map[string]*api.Secret) // instantiate all client services c.secret = &secretSvc{client: c} diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 4f7f7cfa..45fcc05f 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -13,9 +13,9 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/runtime/docker" ) diff --git a/executor/linux/opts.go b/executor/linux/opts.go index 686485ba..5c394bae 100644 --- a/executor/linux/opts.go +++ b/executor/linux/opts.go @@ -10,7 +10,7 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" ) diff --git a/executor/linux/opts_test.go b/executor/linux/opts_test.go index ade2dd21..707e0e21 100644 --- a/executor/linux/opts_test.go +++ b/executor/linux/opts_test.go @@ -13,9 +13,9 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" "github.com/go-vela/worker/runtime/kubernetes" diff --git a/executor/linux/outputs.go b/executor/linux/outputs.go index 8a6e7cea..79764b93 100644 --- a/executor/linux/outputs.go +++ b/executor/linux/outputs.go @@ -11,7 +11,7 @@ import ( envparse "github.com/hashicorp/go-envparse" "github.com/sirupsen/logrus" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) // outputSvc handles communication with the outputs container during the build. diff --git a/executor/linux/outputs_test.go b/executor/linux/outputs_test.go index e75477c6..c555515d 100644 --- a/executor/linux/outputs_test.go +++ b/executor/linux/outputs_test.go @@ -13,11 +13,11 @@ import ( "github.com/urfave/cli/v2" "github.com/go-vela/sdk-go/vela" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/compiler/native" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" @@ -143,7 +143,7 @@ func TestLinux_Outputs_delete(t *testing.T) { t.Errorf("unable to create docker runtime engine: %v", err) } - _step := new(library.Step) + _step := new(api.Step) _step.SetName("clone") _step.SetNumber(2) _step.SetStatus(constants.StatusPending) @@ -154,7 +154,7 @@ func TestLinux_Outputs_delete(t *testing.T) { failure bool runtime runtime.Engine container *pipeline.Container - step *library.Step + step *api.Step steps *pipeline.Build }{ { @@ -170,7 +170,7 @@ func TestLinux_Outputs_delete(t *testing.T) { Number: 1, Pull: "always", }, - step: new(library.Step), + step: new(api.Step), steps: _dockerSteps, }, { @@ -202,7 +202,7 @@ func TestLinux_Outputs_delete(t *testing.T) { Number: 2, Pull: "always", }, - step: new(library.Step), + step: new(api.Step), steps: _dockerSteps, }, { @@ -218,7 +218,7 @@ func TestLinux_Outputs_delete(t *testing.T) { Number: 2, Pull: "always", }, - step: new(library.Step), + step: new(api.Step), steps: _dockerSteps, }, { diff --git a/executor/linux/secret.go b/executor/linux/secret.go index ed343298..7577ae0d 100644 --- a/executor/linux/secret.go +++ b/executor/linux/secret.go @@ -13,9 +13,9 @@ import ( "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/step" ) @@ -190,8 +190,8 @@ func (s *secretSvc) exec(ctx context.Context, p *pipeline.SecretSlice) error { } // pull defines a function that pulls the secrets from the server for a given pipeline. -func (s *secretSvc) pull(secret *pipeline.Secret) (*library.Secret, error) { - _secret := new(library.Secret) +func (s *secretSvc) pull(secret *pipeline.Secret) (*api.Secret, error) { + _secret := new(api.Secret) switch secret.Type { // handle repo secrets @@ -336,7 +336,7 @@ func (s *secretSvc) stream(ctx context.Context, ctn *pipeline.Container) error { // TODO: Evaluate pulling this into a "bool" types function for injecting // // helper function to check secret whitelist before setting value. -func injectSecrets(ctn *pipeline.Container, m map[string]*library.Secret) error { +func injectSecrets(ctn *pipeline.Container, m map[string]*api.Secret) error { // inject secrets for step for _, _secret := range ctn.Secrets { logrus.Tracef("looking up secret %s from pipeline secrets", _secret.Source) @@ -358,7 +358,7 @@ func injectSecrets(ctn *pipeline.Container, m map[string]*library.Secret) error // escapeNewlineSecrets is a helper function to double-escape escaped newlines, // double-escaped newlines are resolved to newlines during env substitution. -func escapeNewlineSecrets(m map[string]*library.Secret) { +func escapeNewlineSecrets(m map[string]*api.Secret) { for i, secret := range m { // only double-escape secrets that have been manually escaped if !strings.Contains(secret.GetValue(), "\\\\n") { diff --git a/executor/linux/secret_test.go b/executor/linux/secret_test.go index 870815d8..f9a60d0a 100644 --- a/executor/linux/secret_test.go +++ b/executor/linux/secret_test.go @@ -14,12 +14,13 @@ import ( "github.com/urfave/cli/v2" "github.com/go-vela/sdk-go/vela" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/api/types/actions" "github.com/go-vela/server/compiler/native" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/go-vela/types/library/actions" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" @@ -170,7 +171,7 @@ func TestLinux_Secret_delete(t *testing.T) { t.Errorf("unable to create kubernetes runtime engine: %v", err) } - _step := new(library.Step) + _step := new(api.Step) _step.SetName("clone") _step.SetNumber(2) _step.SetStatus(constants.StatusPending) @@ -181,7 +182,7 @@ func TestLinux_Secret_delete(t *testing.T) { failure bool runtime runtime.Engine container *pipeline.Container - step *library.Step + step *api.Step steps *pipeline.Build }{ { @@ -197,7 +198,7 @@ func TestLinux_Secret_delete(t *testing.T) { Number: 1, Pull: "always", }, - step: new(library.Step), + step: new(api.Step), steps: _dockerSteps, }, { @@ -213,7 +214,7 @@ func TestLinux_Secret_delete(t *testing.T) { Number: 1, Pull: "always", }, - step: new(library.Step), + step: new(api.Step), steps: _kubernetesSteps, }, { @@ -261,7 +262,7 @@ func TestLinux_Secret_delete(t *testing.T) { Number: 2, Pull: "always", }, - step: new(library.Step), + step: new(api.Step), steps: _dockerSteps, }, //{ @@ -277,7 +278,7 @@ func TestLinux_Secret_delete(t *testing.T) { // Number: 2, // Pull: "always", // }, - // step: new(library.Step), + // step: new(api.Step), // steps: _kubernetesSteps, //}, { @@ -293,7 +294,7 @@ func TestLinux_Secret_delete(t *testing.T) { Number: 2, Pull: "always", }, - step: new(library.Step), + step: new(api.Step), steps: _dockerSteps, }, //{ @@ -309,7 +310,7 @@ func TestLinux_Secret_delete(t *testing.T) { // Number: 2, // Pull: "always", // }, - // step: new(library.Step), + // step: new(api.Step), // steps: _kubernetesSteps, //}, } @@ -927,7 +928,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { tests := []struct { name string step *pipeline.Container - msec map[string]*library.Secret + msec map[string]*api.Secret want *pipeline.Container }{ // Tests for secrets with image ACLs @@ -938,7 +939,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{""}}}, + msec: map[string]*api.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{""}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -951,12 +952,12 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, Images: &[]string{"alpine"}, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Push: &actions.Push{ Branch: &tBool, }, @@ -975,12 +976,12 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, Images: &[]string{"alpine:latest"}, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Push: &actions.Push{ Branch: &tBool, }, @@ -999,7 +1000,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: make(map[string]string), Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"centos"}}}, + msec: map[string]*api.Secret{"FOO": {Name: &v, Value: &v, Images: &[]string{"centos"}}}, want: &pipeline.Container{ Image: "alpine:latest", Environment: make(map[string]string), @@ -1014,12 +1015,12 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, Images: &[]string{"alpine:latest"}, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Push: &actions.Push{ Branch: &tBool, }, @@ -1038,11 +1039,11 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Deployment: &actions.Deploy{ Created: &tBool, }, @@ -1061,12 +1062,12 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "pull_request", "VELA_BUILD_EVENT_ACTION": "opened"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, Images: &[]string{"alpine:latest"}, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ PullRequest: &actions.Pull{ Opened: &tBool, }, @@ -1085,11 +1086,11 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "pull_request"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Deployment: &actions.Deploy{ Created: &tBool, }, @@ -1108,12 +1109,12 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "tag"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, Images: &[]string{"alpine:latest"}, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Push: &actions.Push{ Tag: &tBool, }, @@ -1132,11 +1133,11 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "tag"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Deployment: &actions.Deploy{ Created: &tBool, }, @@ -1155,12 +1156,12 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "deployment", "VELA_BUILD_EVENT_ACTION": "created"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, Images: &[]string{"alpine:latest"}, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Deployment: &actions.Deploy{ Created: &tBool, }, @@ -1179,11 +1180,11 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "deployment"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Push: &actions.Push{ Tag: &tBool, }, @@ -1204,11 +1205,11 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Push: &actions.Push{ Branch: &tBool, }, @@ -1228,11 +1229,11 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ PullRequest: &actions.Pull{ Opened: &tBool, Synchronize: &tBool, @@ -1254,12 +1255,12 @@ func TestLinux_Secret_injectSecret(t *testing.T) { Environment: map[string]string{"VELA_BUILD_EVENT": "push"}, Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}}, }, - msec: map[string]*library.Secret{ + msec: map[string]*api.Secret{ "FOO": { Name: &v, Value: &v, Images: &[]string{"alpine:latest"}, - AllowEvents: &library.Events{ + AllowEvents: &api.Events{ Push: &actions.Push{ Branch: &tBool, }, @@ -1301,18 +1302,18 @@ func TestLinux_Secret_escapeNewlineSecrets(t *testing.T) { // setup types tests := []struct { name string - secretMap map[string]*library.Secret - want map[string]*library.Secret + secretMap map[string]*api.Secret + want map[string]*api.Secret }{ { name: "not escaped", - secretMap: map[string]*library.Secret{"FOO": {Name: &n, Value: &v}}, - want: map[string]*library.Secret{"FOO": {Name: &n, Value: &w}}, + secretMap: map[string]*api.Secret{"FOO": {Name: &n, Value: &v}}, + want: map[string]*api.Secret{"FOO": {Name: &n, Value: &w}}, }, { name: "already escaped", - secretMap: map[string]*library.Secret{"FOO": {Name: &n, Value: &vEscaped}}, - want: map[string]*library.Secret{"FOO": {Name: &n, Value: &w}}, + secretMap: map[string]*api.Secret{"FOO": {Name: &n, Value: &vEscaped}}, + want: map[string]*api.Secret{"FOO": {Name: &n, Value: &w}}, }, } diff --git a/executor/linux/service.go b/executor/linux/service.go index 96704c62..a4e4621c 100644 --- a/executor/linux/service.go +++ b/executor/linux/service.go @@ -10,9 +10,9 @@ import ( "io" "time" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/service" @@ -76,7 +76,7 @@ func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error logger := c.Logger.WithField("service", ctn.Name) // create the library service object - _service := new(library.Service) + _service := new(api.Service) _service.SetName(ctn.Name) _service.SetNumber(ctn.Number) _service.SetImage(ctn.Image) @@ -333,7 +333,7 @@ func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) er // create the service from the container // // https://pkg.go.dev/github.com/go-vela/types/library#ServiceFromContainerEnvironment - _service = library.ServiceFromContainerEnvironment(ctn) + _service = api.ServiceFromContainerEnvironment(ctn) } // defer an upload of the service diff --git a/executor/linux/service_test.go b/executor/linux/service_test.go index 9ed98a0e..e8940d06 100644 --- a/executor/linux/service_test.go +++ b/executor/linux/service_test.go @@ -10,9 +10,10 @@ import ( "github.com/gin-gonic/gin" "github.com/go-vela/sdk-go/vela" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" @@ -437,7 +438,7 @@ func TestLinux_ExecService(t *testing.T) { } if !test.container.Empty() { - _engine.services.Store(test.container.ID, new(library.Service)) + _engine.services.Store(test.container.ID, new(api.Service)) _engine.serviceLogs.Store(test.container.ID, new(library.Log)) } @@ -580,7 +581,7 @@ func TestLinux_StreamService(t *testing.T) { } if !test.container.Empty() { - _engine.services.Store(test.container.ID, new(library.Service)) + _engine.services.Store(test.container.ID, new(api.Service)) _engine.serviceLogs.Store(test.container.ID, new(library.Log)) } diff --git a/executor/linux/stage.go b/executor/linux/stage.go index 5ccf3ce2..823cfe4a 100644 --- a/executor/linux/stage.go +++ b/executor/linux/stage.go @@ -7,8 +7,8 @@ import ( "fmt" "sync" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/step" ) diff --git a/executor/linux/stage_test.go b/executor/linux/stage_test.go index 1a14d3db..e6a09134 100644 --- a/executor/linux/stage_test.go +++ b/executor/linux/stage_test.go @@ -15,8 +15,8 @@ import ( "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/compiler/native" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" diff --git a/executor/linux/step.go b/executor/linux/step.go index 88186dbc..38dd6e0f 100644 --- a/executor/linux/step.go +++ b/executor/linux/step.go @@ -12,9 +12,9 @@ import ( "time" "github.com/go-vela/sdk-go/vela" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/step" @@ -41,7 +41,7 @@ func (c *client) CreateStep(ctx context.Context, ctn *pipeline.Container) error // create a library step object to facilitate injecting environment as early as possible // (PlanStep is too late to inject environment vars for the kubernetes runtime). - _step := library.StepFromBuildContainer(c.build.ToLibrary(), ctn) + _step := api.StepFromBuildContainer(c.build, ctn) // update the step container environment // @@ -90,7 +90,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { logger := c.Logger.WithField("step", ctn.Name) // create the library step object - _step := library.StepFromBuildContainer(c.build.ToLibrary(), ctn) + _step := api.StepFromBuildContainer(c.build, ctn) _step.SetStatus(constants.StatusRunning) _step.SetStarted(time.Now().UTC().Unix()) @@ -410,7 +410,7 @@ func (c *client) DestroyStep(ctx context.Context, ctn *pipeline.Container) error // create the step from the container // // https://pkg.go.dev/github.com/go-vela/types/library#StepFromContainerEnvironment - _step = library.StepFromContainerEnvironment(ctn) + _step = api.StepFromContainerEnvironment(ctn) } // defer an upload of the step diff --git a/executor/linux/step_test.go b/executor/linux/step_test.go index 2435afb9..93042236 100644 --- a/executor/linux/step_test.go +++ b/executor/linux/step_test.go @@ -12,9 +12,10 @@ import ( "github.com/gin-gonic/gin" "github.com/go-vela/sdk-go/vela" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" @@ -503,7 +504,7 @@ func TestLinux_ExecStep(t *testing.T) { } if !test.container.Empty() { - _engine.steps.Store(test.container.ID, new(library.Step)) + _engine.steps.Store(test.container.ID, new(api.Step)) _engine.stepLogs.Store(test.container.ID, new(library.Log)) } @@ -680,7 +681,7 @@ func TestLinux_StreamStep(t *testing.T) { } if !test.container.Empty() { - _engine.steps.Store(test.container.ID, new(library.Step)) + _engine.steps.Store(test.container.ID, new(api.Step)) _engine.stepLogs.Store(test.container.ID, new(library.Log)) } diff --git a/executor/local/api.go b/executor/local/api.go index b95743ee..ee48a56d 100644 --- a/executor/local/api.go +++ b/executor/local/api.go @@ -8,9 +8,8 @@ import ( "time" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/service" "github.com/go-vela/worker/internal/step" ) @@ -63,7 +62,7 @@ func (c *client) CancelBuild() (*api.Build, error) { s, err := service.Load(_service, &c.services) if err != nil { // create the library service object - s = new(library.Service) + s = new(api.Service) s.SetName(_service.Name) s.SetNumber(_service.Number) s.SetImage(_service.Image) @@ -104,7 +103,7 @@ func (c *client) CancelBuild() (*api.Build, error) { s, err := step.Load(_step, &c.steps) if err != nil { // create the library step object - s = new(library.Step) + s = new(api.Step) s.SetName(_step.Name) s.SetNumber(_step.Number) s.SetImage(_step.Image) @@ -146,7 +145,7 @@ func (c *client) CancelBuild() (*api.Build, error) { s, err := step.Load(_step, &c.steps) if err != nil { // create the library step object - s = new(library.Step) + s = new(api.Step) s.SetName(_step.Name) s.SetNumber(_step.Number) s.SetImage(_step.Image) diff --git a/executor/local/build_test.go b/executor/local/build_test.go index 6c9bc909..7d87325e 100644 --- a/executor/local/build_test.go +++ b/executor/local/build_test.go @@ -11,7 +11,7 @@ import ( "github.com/urfave/cli/v2" "github.com/go-vela/server/compiler/native" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" ) diff --git a/executor/local/local.go b/executor/local/local.go index 64bab8c5..e5a6eb03 100644 --- a/executor/local/local.go +++ b/executor/local/local.go @@ -9,7 +9,7 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" ) diff --git a/executor/local/local_test.go b/executor/local/local_test.go index 25c50c4c..26c7c9cc 100644 --- a/executor/local/local_test.go +++ b/executor/local/local_test.go @@ -10,8 +10,8 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/runtime/docker" ) diff --git a/executor/local/opts.go b/executor/local/opts.go index 60d40096..245cd8c7 100644 --- a/executor/local/opts.go +++ b/executor/local/opts.go @@ -8,7 +8,7 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime" ) diff --git a/executor/local/opts_test.go b/executor/local/opts_test.go index c063c4fb..89b70d07 100644 --- a/executor/local/opts_test.go +++ b/executor/local/opts_test.go @@ -11,8 +11,8 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/runtime" "github.com/go-vela/worker/runtime/docker" ) diff --git a/executor/local/service.go b/executor/local/service.go index a222f7e0..1f5f51ab 100644 --- a/executor/local/service.go +++ b/executor/local/service.go @@ -8,9 +8,9 @@ import ( "fmt" "time" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/service" ) @@ -48,7 +48,7 @@ func (c *client) CreateService(ctx context.Context, ctn *pipeline.Container) err // PlanService prepares the service for execution. func (c *client) PlanService(ctx context.Context, ctn *pipeline.Container) error { // update the engine service object - _service := new(library.Service) + _service := new(api.Service) _service.SetName(ctn.Name) _service.SetNumber(ctn.Number) _service.SetImage(ctn.Image) @@ -137,7 +137,7 @@ func (c *client) DestroyService(ctx context.Context, ctn *pipeline.Container) er // create the service from the container // // https://pkg.go.dev/github.com/go-vela/types/library#ServiceFromContainerEnvironment - _service = library.ServiceFromContainerEnvironment(ctn) + _service = api.ServiceFromContainerEnvironment(ctn) } // defer an upload of the service diff --git a/executor/local/service_test.go b/executor/local/service_test.go index 40e8e319..1ab811b3 100644 --- a/executor/local/service_test.go +++ b/executor/local/service_test.go @@ -6,8 +6,8 @@ import ( "context" "testing" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" ) @@ -228,7 +228,7 @@ func TestLocal_ExecService(t *testing.T) { } if !test.container.Empty() { - _engine.services.Store(test.container.ID, new(library.Service)) + _engine.services.Store(test.container.ID, new(api.Service)) } err = _engine.ExecService(context.Background(), test.container) diff --git a/executor/local/stage.go b/executor/local/stage.go index 7a4edab1..611c385d 100644 --- a/executor/local/stage.go +++ b/executor/local/stage.go @@ -9,7 +9,7 @@ import ( "github.com/sirupsen/logrus" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/internal/step" ) diff --git a/executor/local/stage_test.go b/executor/local/stage_test.go index e2d4f6eb..09d4f5df 100644 --- a/executor/local/stage_test.go +++ b/executor/local/stage_test.go @@ -12,7 +12,7 @@ import ( "github.com/urfave/cli/v2" "github.com/go-vela/server/compiler/native" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" ) diff --git a/executor/local/step.go b/executor/local/step.go index 23ffb2ef..2ee95b5b 100644 --- a/executor/local/step.go +++ b/executor/local/step.go @@ -8,9 +8,9 @@ import ( "fmt" "time" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/internal/step" ) @@ -50,7 +50,7 @@ func (c *client) PlanStep(ctx context.Context, ctn *pipeline.Container) error { } // create the library step object - _step := library.StepFromBuildContainer(c.build.ToLibrary(), ctn) + _step := api.StepFromBuildContainer(c.build, ctn) _step.SetStatus(constants.StatusRunning) _step.SetStarted(time.Now().UTC().Unix()) @@ -171,7 +171,7 @@ func (c *client) DestroyStep(ctx context.Context, ctn *pipeline.Container) error // create the step from the container // // https://pkg.go.dev/github.com/go-vela/types/library#StepFromContainerEnvironment - _step = library.StepFromContainerEnvironment(ctn) + _step = api.StepFromContainerEnvironment(ctn) } // defer an upload of the step diff --git a/executor/local/step_test.go b/executor/local/step_test.go index 6c215df5..5916b174 100644 --- a/executor/local/step_test.go +++ b/executor/local/step_test.go @@ -6,8 +6,8 @@ import ( "context" "testing" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/internal/message" "github.com/go-vela/worker/runtime/docker" ) @@ -258,7 +258,7 @@ func TestLocal_ExecStep(t *testing.T) { } if !test.container.Empty() { - _engine.steps.Store(test.container.ID, new(library.Step)) + _engine.steps.Store(test.container.ID, new(api.Step)) } err = _engine.ExecStep(context.Background(), test.container) diff --git a/executor/setup.go b/executor/setup.go index 745097e7..2edbb2a0 100644 --- a/executor/setup.go +++ b/executor/setup.go @@ -11,8 +11,8 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/executor/linux" "github.com/go-vela/worker/executor/local" "github.com/go-vela/worker/runtime" diff --git a/go.mod b/go.mod index 0eb84b53..55f10ddb 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,8 @@ require ( github.com/docker/docker v27.3.1+incompatible github.com/docker/go-units v0.5.0 github.com/gin-gonic/gin v1.10.0 - github.com/go-vela/sdk-go v0.25.1 - github.com/go-vela/server v0.25.1 + github.com/go-vela/sdk-go v0.25.2-0.20241018192247-0d47b4597aaf + github.com/go-vela/server v0.25.1-0.20241018194931-72b59eb80018 github.com/go-vela/types v0.25.1 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/google/go-cmp v0.6.0 diff --git a/go.sum b/go.sum index 72b7eb81..290af08c 100644 --- a/go.sum +++ b/go.sum @@ -109,10 +109,10 @@ 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/sdk-go v0.25.2-0.20241018192247-0d47b4597aaf h1:TH5ygvwQKBtOa9QAT76Jl8is/fwBz+NjDSlir8aXYSs= +github.com/go-vela/sdk-go v0.25.2-0.20241018192247-0d47b4597aaf/go.mod h1:g9/Ic60AgLYuML1Wf/NTxewqNSGN8K+9tIX38ZPWDQo= +github.com/go-vela/server v0.25.1-0.20241018194931-72b59eb80018 h1:UpJSFzf4qKAHnuPcmCfsCl9Go0hbzUBKInFSEkO2Rlw= +github.com/go-vela/server v0.25.1-0.20241018194931-72b59eb80018/go.mod h1:/DmGHNzsjsBOStLzlGDIDGCmNztUgCdvHiuWmyafFs8= 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/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= diff --git a/internal/message/stream.go b/internal/message/stream.go index 1683e4bf..a03e2516 100644 --- a/internal/message/stream.go +++ b/internal/message/stream.go @@ -5,7 +5,7 @@ package message import ( "context" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) // StreamFunc is either StreamService or StreamStep in executor.Engine. diff --git a/internal/service/environment.go b/internal/service/environment.go index 4b7d92a5..4368e471 100644 --- a/internal/service/environment.go +++ b/internal/service/environment.go @@ -6,14 +6,13 @@ import ( "fmt" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) // Environment attempts to update the environment variables // for the container based off the library resources. -func Environment(c *pipeline.Container, b *api.Build, s *library.Service, version string) error { +func Environment(c *pipeline.Container, b *api.Build, s *api.Service, version string) error { // check if container or container environment are empty if c == nil || c.Environment == nil { return fmt.Errorf("empty container provided for environment") diff --git a/internal/service/environment_test.go b/internal/service/environment_test.go index d5581ae3..886d9e3d 100644 --- a/internal/service/environment_test.go +++ b/internal/service/environment_test.go @@ -6,9 +6,8 @@ import ( "testing" api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - "github.com/go-vela/types/raw" + "github.com/go-vela/server/compiler/types/pipeline" + "github.com/go-vela/server/compiler/types/raw" ) func TestService_Environment(t *testing.T) { @@ -70,7 +69,7 @@ func TestService_Environment(t *testing.T) { Pull: "not_present", } - s := new(library.Service) + s := new(api.Service) s.SetID(1) s.SetBuildID(1) s.SetRepoID(1) @@ -92,7 +91,7 @@ func TestService_Environment(t *testing.T) { failure bool build *api.Build container *pipeline.Container - service *library.Service + service *api.Service }{ { name: "success", diff --git a/internal/service/load.go b/internal/service/load.go index 7de02caa..85a8bf3c 100644 --- a/internal/service/load.go +++ b/internal/service/load.go @@ -6,13 +6,14 @@ import ( "fmt" "sync" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) // Load attempts to capture the library service // representing the container from the map. -func Load(c *pipeline.Container, m *sync.Map) (*library.Service, error) { +func Load(c *pipeline.Container, m *sync.Map) (*api.Service, error) { // check if the container provided is empty if c == nil { return nil, fmt.Errorf("empty container provided") @@ -25,7 +26,7 @@ func Load(c *pipeline.Container, m *sync.Map) (*library.Service, error) { } // cast the value from the service key to the expected type - s, ok := result.(*library.Service) + s, ok := result.(*api.Service) if !ok { return nil, fmt.Errorf("unable to cast value for service %s", c.ID) } diff --git a/internal/service/load_test.go b/internal/service/load_test.go index 2a1fb2d1..9856eb77 100644 --- a/internal/service/load_test.go +++ b/internal/service/load_test.go @@ -7,8 +7,9 @@ import ( "sync" "testing" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) func TestService_Load(t *testing.T) { @@ -25,7 +26,7 @@ func TestService_Load(t *testing.T) { } goodMap := new(sync.Map) - goodMap.Store(c.ID, new(library.Service)) + goodMap.Store(c.ID, new(api.Service)) badMap := new(sync.Map) badMap.Store(c.ID, c) @@ -36,13 +37,13 @@ func TestService_Load(t *testing.T) { failure bool container *pipeline.Container _map *sync.Map - want *library.Service + want *api.Service }{ { name: "good map", failure: false, container: c, - want: new(library.Service), + want: new(api.Service), _map: goodMap, }, { diff --git a/internal/service/snapshot.go b/internal/service/snapshot.go index f1e04232..53effcd6 100644 --- a/internal/service/snapshot.go +++ b/internal/service/snapshot.go @@ -10,14 +10,13 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) // Snapshot creates a moment in time record of the // service and attempts to upload it to the server. -func Snapshot(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.Entry, s *library.Service) { +func Snapshot(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.Entry, s *api.Service) { // check if the build is not in a canceled status if !strings.EqualFold(s.GetStatus(), constants.StatusCanceled) { // check if the container is running in headless mode diff --git a/internal/service/snapshot_test.go b/internal/service/snapshot_test.go index f3f03eca..bee7c4ab 100644 --- a/internal/service/snapshot_test.go +++ b/internal/service/snapshot_test.go @@ -10,9 +10,8 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) func TestService_Snapshot(t *testing.T) { @@ -84,7 +83,7 @@ func TestService_Snapshot(t *testing.T) { Pull: "not_present", } - _service := &library.Service{ + _service := &api.Service{ ID: vela.Int64(1), BuildID: vela.Int64(1), RepoID: vela.Int64(1), @@ -115,7 +114,7 @@ func TestService_Snapshot(t *testing.T) { build *api.Build client *vela.Client container *pipeline.Container - service *library.Service + service *api.Service }{ { name: "running service", diff --git a/internal/service/upload.go b/internal/service/upload.go index 45fe5b22..e29defc8 100644 --- a/internal/service/upload.go +++ b/internal/service/upload.go @@ -9,14 +9,13 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) // Upload tracks the final state of the service // and attempts to upload it to the server. -func Upload(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.Entry, s *library.Service) { +func Upload(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.Entry, s *api.Service) { // handle the service based off the status provided switch s.GetStatus() { // service is in a canceled state diff --git a/internal/service/upload_test.go b/internal/service/upload_test.go index 313c9f8d..abedb205 100644 --- a/internal/service/upload_test.go +++ b/internal/service/upload_test.go @@ -10,9 +10,8 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) func TestService_Upload(t *testing.T) { @@ -82,7 +81,7 @@ func TestService_Upload(t *testing.T) { Pull: "always", } - _service := &library.Service{ + _service := &api.Service{ ID: vela.Int64(1), BuildID: vela.Int64(1), RepoID: vela.Int64(1), @@ -122,7 +121,7 @@ func TestService_Upload(t *testing.T) { build *api.Build client *vela.Client container *pipeline.Container - service *library.Service + service *api.Service }{ { name: "running service", diff --git a/internal/step/environment.go b/internal/step/environment.go index 7c996276..d395936b 100644 --- a/internal/step/environment.go +++ b/internal/step/environment.go @@ -6,14 +6,13 @@ import ( "fmt" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) // Environment attempts to update the environment variables // for the container based off the library resources. -func Environment(c *pipeline.Container, b *api.Build, s *library.Step, version, reqToken string) error { +func Environment(c *pipeline.Container, b *api.Build, s *api.Step, version, reqToken string) error { // check if container or container environment are empty if c == nil || c.Environment == nil { return fmt.Errorf("empty container provided for environment") diff --git a/internal/step/environment_test.go b/internal/step/environment_test.go index 993c4bb8..75dfc4f0 100644 --- a/internal/step/environment_test.go +++ b/internal/step/environment_test.go @@ -6,9 +6,8 @@ import ( "testing" api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" - "github.com/go-vela/types/raw" + "github.com/go-vela/server/compiler/types/pipeline" + "github.com/go-vela/server/compiler/types/raw" ) func TestStep_Environment(t *testing.T) { @@ -69,7 +68,7 @@ func TestStep_Environment(t *testing.T) { Pull: "always", } - s := new(library.Step) + s := new(api.Step) s.SetID(1) s.SetBuildID(1) s.SetRepoID(1) @@ -91,7 +90,7 @@ func TestStep_Environment(t *testing.T) { failure bool build *api.Build container *pipeline.Container - step *library.Step + step *api.Step }{ { name: "success", diff --git a/internal/step/load.go b/internal/step/load.go index 46b02904..d543a6e8 100644 --- a/internal/step/load.go +++ b/internal/step/load.go @@ -6,13 +6,14 @@ import ( "fmt" "sync" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) // Load attempts to capture the library step // representing the container from the map. -func Load(c *pipeline.Container, m *sync.Map) (*library.Step, error) { +func Load(c *pipeline.Container, m *sync.Map) (*api.Step, error) { // check if the container provided is empty if c == nil { return nil, fmt.Errorf("empty container provided") @@ -25,7 +26,7 @@ func Load(c *pipeline.Container, m *sync.Map) (*library.Step, error) { } // cast the value from the step key to the expected type - s, ok := result.(*library.Step) + s, ok := result.(*api.Step) if !ok { return nil, fmt.Errorf("unable to cast value for step %s", c.ID) } diff --git a/internal/step/load_test.go b/internal/step/load_test.go index 2358a934..b20b7ff7 100644 --- a/internal/step/load_test.go +++ b/internal/step/load_test.go @@ -7,8 +7,9 @@ import ( "sync" "testing" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) func TestStep_Load(t *testing.T) { @@ -24,7 +25,7 @@ func TestStep_Load(t *testing.T) { } goodMap := new(sync.Map) - goodMap.Store(c.ID, new(library.Step)) + goodMap.Store(c.ID, new(api.Step)) badMap := new(sync.Map) badMap.Store(c.ID, c) @@ -35,13 +36,13 @@ func TestStep_Load(t *testing.T) { failure bool container *pipeline.Container _map *sync.Map - want *library.Step + want *api.Step }{ { name: "good map", failure: false, container: c, - want: new(library.Step), + want: new(api.Step), _map: goodMap, }, { diff --git a/internal/step/skip.go b/internal/step/skip.go index 3d122e70..641f2916 100644 --- a/internal/step/skip.go +++ b/internal/step/skip.go @@ -6,8 +6,8 @@ import ( "strings" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" ) // Skip creates the ruledata from the build and repository diff --git a/internal/step/skip_test.go b/internal/step/skip_test.go index e4677d7d..f422c057 100644 --- a/internal/step/skip_test.go +++ b/internal/step/skip_test.go @@ -7,7 +7,7 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestStep_Skip(t *testing.T) { diff --git a/internal/step/snapshot.go b/internal/step/snapshot.go index b47bf0ce..0f271077 100644 --- a/internal/step/snapshot.go +++ b/internal/step/snapshot.go @@ -10,14 +10,14 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) // Snapshot creates a moment in time record of the // step and attempts to upload it to the server. -func Snapshot(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.Entry, s *library.Step) { +func Snapshot(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.Entry, s *api.Step) { // check if the build is not in a canceled status or error status logrus.Debugf("Snapshot s: %s %s", s.GetName(), s.GetStatus()) @@ -68,7 +68,7 @@ func Snapshot(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.E // SnapshotInit creates a moment in time record of the // init step and attempts to upload it to the server. -func SnapshotInit(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.Entry, s *library.Step, lg *library.Log) { +func SnapshotInit(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.Entry, s *api.Step, lg *library.Log) { // check if the build is not in a canceled status if !strings.EqualFold(s.GetStatus(), constants.StatusCanceled) { // check if the container has an unsuccessful exit code diff --git a/internal/step/snapshot_test.go b/internal/step/snapshot_test.go index da112d16..1d546157 100644 --- a/internal/step/snapshot_test.go +++ b/internal/step/snapshot_test.go @@ -10,9 +10,9 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) func TestStep_Snapshot(t *testing.T) { @@ -82,7 +82,7 @@ func TestStep_Snapshot(t *testing.T) { Pull: "always", } - _step := &library.Step{ + _step := &api.Step{ ID: vela.Int64(1), BuildID: vela.Int64(1), RepoID: vela.Int64(1), @@ -113,7 +113,7 @@ func TestStep_Snapshot(t *testing.T) { build *api.Build client *vela.Client container *pipeline.Container - step *library.Step + step *api.Step }{ { name: "running step", @@ -206,7 +206,7 @@ func TestStep_SnapshotInit(t *testing.T) { Pull: "always", } - _step := &library.Step{ + _step := &api.Step{ ID: vela.Int64(1), BuildID: vela.Int64(1), RepoID: vela.Int64(1), @@ -238,7 +238,7 @@ func TestStep_SnapshotInit(t *testing.T) { client *vela.Client container *pipeline.Container log *library.Log - step *library.Step + step *api.Step }{ { name: "running step", diff --git a/internal/step/upload.go b/internal/step/upload.go index 836f2bbf..13fc77d0 100644 --- a/internal/step/upload.go +++ b/internal/step/upload.go @@ -9,14 +9,13 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) // Upload tracks the final state of the step // and attempts to upload it to the server. -func Upload(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.Entry, s *library.Step) { +func Upload(ctn *pipeline.Container, b *api.Build, c *vela.Client, l *logrus.Entry, s *api.Step) { // handle the step based off the status provided switch s.GetStatus() { // step is in a canceled state diff --git a/internal/step/upload_test.go b/internal/step/upload_test.go index 85977b8d..026c10b4 100644 --- a/internal/step/upload_test.go +++ b/internal/step/upload_test.go @@ -10,9 +10,8 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/library" - "github.com/go-vela/types/pipeline" ) func TestStep_Upload(t *testing.T) { @@ -82,7 +81,7 @@ func TestStep_Upload(t *testing.T) { Pull: "always", } - _step := &library.Step{ + _step := &api.Step{ ID: vela.Int64(1), BuildID: vela.Int64(1), RepoID: vela.Int64(1), @@ -122,7 +121,7 @@ func TestStep_Upload(t *testing.T) { build *api.Build client *vela.Client container *pipeline.Container - step *library.Step + step *api.Step }{ { name: "running step", diff --git a/mock/worker/executor.go b/mock/worker/executor.go index 0b5326fb..44744c2d 100644 --- a/mock/worker/executor.go +++ b/mock/worker/executor.go @@ -10,8 +10,8 @@ import ( "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types" - "github.com/go-vela/types/library" ) const ( @@ -35,7 +35,7 @@ const ( func getExecutors(c *gin.Context) { data := []byte(ExecutorsResp) - var body []library.Executor + var body []api.Executor _ = json.Unmarshal(data, &body) c.JSON(http.StatusOK, body) @@ -55,7 +55,7 @@ func getExecutor(c *gin.Context) { data := []byte(ExecutorResp) - var body library.Executor + var body api.Executor _ = json.Unmarshal(data, &body) c.JSON(http.StatusOK, body) diff --git a/mock/worker/pipeline.go b/mock/worker/pipeline.go index d87b49b9..5f13c9e2 100644 --- a/mock/worker/pipeline.go +++ b/mock/worker/pipeline.go @@ -10,8 +10,8 @@ import ( "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types" - "github.com/go-vela/types/library" ) const ( @@ -51,7 +51,7 @@ func getPipeline(c *gin.Context) { data := []byte(PipelineResp) - var body library.Pipeline + var body api.Pipeline _ = json.Unmarshal(data, &body) c.JSON(http.StatusOK, body) diff --git a/router/middleware/executor/executor_test.go b/router/middleware/executor/executor_test.go index 612a54b5..78913ee6 100644 --- a/router/middleware/executor/executor_test.go +++ b/router/middleware/executor/executor_test.go @@ -12,8 +12,8 @@ import ( "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime/docker" ) diff --git a/runtime/docker/build.go b/runtime/docker/build.go index e49e4217..dfe3571d 100644 --- a/runtime/docker/build.go +++ b/runtime/docker/build.go @@ -5,7 +5,7 @@ package docker import ( "context" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) // InspectBuild displays details about the pod for the init step. diff --git a/runtime/docker/build_test.go b/runtime/docker/build_test.go index cc556cec..4efd0c4f 100644 --- a/runtime/docker/build_test.go +++ b/runtime/docker/build_test.go @@ -6,7 +6,7 @@ import ( "context" "testing" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestDocker_InspectBuild(t *testing.T) { diff --git a/runtime/docker/container.go b/runtime/docker/container.go index 0beec9e0..07a6c1f9 100644 --- a/runtime/docker/container.go +++ b/runtime/docker/container.go @@ -14,8 +14,8 @@ import ( docker "github.com/docker/docker/client" "github.com/docker/docker/pkg/stdcopy" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" ) diff --git a/runtime/docker/container_test.go b/runtime/docker/container_test.go index 82e35cda..bd840c0e 100644 --- a/runtime/docker/container_test.go +++ b/runtime/docker/container_test.go @@ -6,7 +6,7 @@ import ( "context" "testing" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestDocker_InspectContainer(t *testing.T) { diff --git a/runtime/docker/docker_test.go b/runtime/docker/docker_test.go index c91b9d54..ad603199 100644 --- a/runtime/docker/docker_test.go +++ b/runtime/docker/docker_test.go @@ -7,7 +7,7 @@ import ( "gotest.tools/v3/env" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestDocker_New(t *testing.T) { diff --git a/runtime/docker/image.go b/runtime/docker/image.go index 4d4f3ede..c3b62ef8 100644 --- a/runtime/docker/image.go +++ b/runtime/docker/image.go @@ -12,8 +12,8 @@ import ( dockerImageTypes "github.com/docker/docker/api/types/image" "github.com/sirupsen/logrus" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" ) diff --git a/runtime/docker/image_test.go b/runtime/docker/image_test.go index 5cd2a0ce..5f48a6f1 100644 --- a/runtime/docker/image_test.go +++ b/runtime/docker/image_test.go @@ -6,7 +6,7 @@ import ( "context" "testing" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestDocker_InspectImage(t *testing.T) { diff --git a/runtime/docker/network.go b/runtime/docker/network.go index 1d45bc63..a5061244 100644 --- a/runtime/docker/network.go +++ b/runtime/docker/network.go @@ -10,7 +10,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) // CreateNetwork creates the pipeline network. diff --git a/runtime/docker/network_test.go b/runtime/docker/network_test.go index 152dbcd3..cd869884 100644 --- a/runtime/docker/network_test.go +++ b/runtime/docker/network_test.go @@ -6,7 +6,7 @@ import ( "context" "testing" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestDocker_CreateNetwork(t *testing.T) { diff --git a/runtime/docker/volume.go b/runtime/docker/volume.go index dee10f5c..5c846a2c 100644 --- a/runtime/docker/volume.go +++ b/runtime/docker/volume.go @@ -13,8 +13,8 @@ import ( "github.com/docker/go-units" "github.com/sirupsen/logrus" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" vol "github.com/go-vela/worker/internal/volume" ) diff --git a/runtime/docker/volume_test.go b/runtime/docker/volume_test.go index 6cb802c9..b341d6e2 100644 --- a/runtime/docker/volume_test.go +++ b/runtime/docker/volume_test.go @@ -6,7 +6,7 @@ import ( "context" "testing" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestDocker_CreateVolume(t *testing.T) { diff --git a/runtime/engine.go b/runtime/engine.go index 97ed9c49..e842a9c0 100644 --- a/runtime/engine.go +++ b/runtime/engine.go @@ -6,7 +6,7 @@ import ( "context" "io" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) // Engine represents the interface for Vela integrating diff --git a/runtime/kubernetes/build.go b/runtime/kubernetes/build.go index eb145f7f..c1fb23b9 100644 --- a/runtime/kubernetes/build.go +++ b/runtime/kubernetes/build.go @@ -14,7 +14,7 @@ import ( // So, just use the same library for all kubernetes-related YAML. "sigs.k8s.io/yaml" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" ) diff --git a/runtime/kubernetes/build_test.go b/runtime/kubernetes/build_test.go index 851bbe27..70cd3cb0 100644 --- a/runtime/kubernetes/build_test.go +++ b/runtime/kubernetes/build_test.go @@ -10,7 +10,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" ) diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 36e9ff9d..076d2641 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -15,8 +15,8 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" "github.com/go-vela/worker/internal/image" ) diff --git a/runtime/kubernetes/container_test.go b/runtime/kubernetes/container_test.go index d7dc2116..f2de3b16 100644 --- a/runtime/kubernetes/container_test.go +++ b/runtime/kubernetes/container_test.go @@ -10,7 +10,7 @@ import ( "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/worker/internal/image" velav1alpha1 "github.com/go-vela/worker/runtime/kubernetes/apis/vela/v1alpha1" ) diff --git a/runtime/kubernetes/image.go b/runtime/kubernetes/image.go index 68ceb0e1..9824bc10 100644 --- a/runtime/kubernetes/image.go +++ b/runtime/kubernetes/image.go @@ -8,8 +8,8 @@ import ( "fmt" "strings" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" ) const ( diff --git a/runtime/kubernetes/image_test.go b/runtime/kubernetes/image_test.go index 6841dea9..3f2faeb3 100644 --- a/runtime/kubernetes/image_test.go +++ b/runtime/kubernetes/image_test.go @@ -6,7 +6,7 @@ import ( "context" "testing" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestKubernetes_InspectImage(t *testing.T) { diff --git a/runtime/kubernetes/kubernetes_test.go b/runtime/kubernetes/kubernetes_test.go index 2804b615..b2c53705 100644 --- a/runtime/kubernetes/kubernetes_test.go +++ b/runtime/kubernetes/kubernetes_test.go @@ -8,7 +8,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestKubernetes_New(t *testing.T) { diff --git a/runtime/kubernetes/network.go b/runtime/kubernetes/network.go index 83f1395b..d06c273a 100644 --- a/runtime/kubernetes/network.go +++ b/runtime/kubernetes/network.go @@ -9,7 +9,7 @@ import ( v1 "k8s.io/api/core/v1" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) // CreateNetwork creates the pipeline network. diff --git a/runtime/kubernetes/network_test.go b/runtime/kubernetes/network_test.go index dc6199d2..61a3e05e 100644 --- a/runtime/kubernetes/network_test.go +++ b/runtime/kubernetes/network_test.go @@ -6,7 +6,7 @@ import ( "context" "testing" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestKubernetes_CreateNetwork(t *testing.T) { diff --git a/runtime/kubernetes/volume.go b/runtime/kubernetes/volume.go index 1f91731b..c3a0581d 100644 --- a/runtime/kubernetes/volume.go +++ b/runtime/kubernetes/volume.go @@ -10,8 +10,8 @@ import ( v1 "k8s.io/api/core/v1" + "github.com/go-vela/server/compiler/types/pipeline" "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" vol "github.com/go-vela/worker/internal/volume" ) diff --git a/runtime/kubernetes/volume_test.go b/runtime/kubernetes/volume_test.go index ae5ca329..f72135c0 100644 --- a/runtime/kubernetes/volume_test.go +++ b/runtime/kubernetes/volume_test.go @@ -8,7 +8,7 @@ import ( v1 "k8s.io/api/core/v1" - "github.com/go-vela/types/pipeline" + "github.com/go-vela/server/compiler/types/pipeline" ) func TestKubernetes_CreateVolume(t *testing.T) {