diff --git a/action/build/table.go b/action/build/table.go index 1ba2ce4e..f263bc67 100644 --- a/action/build/table.go +++ b/action/build/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 builds in a table format with // a specific set of fields displayed. -func table(builds *[]library.Build) error { +func table(builds *[]api.Build) error { logrus.Debug("creating table for list of builds") // create a new table @@ -61,7 +61,7 @@ func table(builds *[]library.Build) error { // wideTable is a helper function to output the // provided builds in a wide table format with // a specific set of fields displayed. -func wideTable(builds *[]library.Build) error { +func wideTable(builds *[]api.Build) error { logrus.Debug("creating wide table for list of builds") // create new wide table @@ -115,7 +115,7 @@ func wideTable(builds *[]library.Build) error { // reverse is a helper function to sort the builds // based off the build number and then flip the // order they get displayed in. -func reverse(b []library.Build) []library.Build { +func reverse(b []api.Build) []api.Build { // sort the list of builds based off the build number sort.SliceStable(b, func(i, j int) bool { return b[i].GetNumber() < b[j].GetNumber() diff --git a/action/build/table_test.go b/action/build/table_test.go index 9736ef55..ea36bd42 100644 --- a/action/build/table_test.go +++ b/action/build/table_test.go @@ -5,7 +5,7 @@ package build import ( "testing" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) func TestBuild_table(t *testing.T) { @@ -23,11 +23,11 @@ func TestBuild_table(t *testing.T) { // setup tests tests := []struct { failure bool - builds *[]library.Build + builds *[]api.Build }{ { failure: false, - builds: &[]library.Build{ + builds: &[]api.Build{ *b1, *b2, }, @@ -67,11 +67,11 @@ func TestBuild_wideTable(t *testing.T) { // setup tests tests := []struct { failure bool - builds *[]library.Build + builds *[]api.Build }{ { failure: false, - builds: &[]library.Build{ + builds: &[]api.Build{ *b1, *b2, }, @@ -98,11 +98,14 @@ func TestBuild_wideTable(t *testing.T) { // testBuild is a test helper function to create a Build // type with all fields set to a fake value. -func testBuild() *library.Build { - b := new(library.Build) +func testBuild() *api.Build { + r := new(api.Repo) + r.SetID(1) + + b := new(api.Build) b.SetID(1) - b.SetRepoID(1) + b.SetRepo(r) b.SetNumber(1) b.SetParent(1) b.SetEvent("push") diff --git a/action/pipeline/exec.go b/action/pipeline/exec.go index 4c15e6c9..3ac09a11 100644 --- a/action/pipeline/exec.go +++ b/action/pipeline/exec.go @@ -16,12 +16,13 @@ import ( 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/library" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" ) // Exec executes a pipeline based off the provided configuration. +// +//nolint:funlen // ignore function length func (c *Config) Exec(client compiler.Engine) error { logrus.Debug("executing exec for pipeline configuration") @@ -52,7 +53,7 @@ func (c *Config) Exec(client compiler.Engine) error { } // create build object for use in pipeline - b := new(library.Build) + b := new(api.Build) b.SetBranch(c.Branch) b.SetDeploy(c.Target) b.SetEvent(c.Event) @@ -70,6 +71,8 @@ func (c *Config) Exec(client compiler.Engine) error { r.SetFullName(fmt.Sprintf("%s/%s", c.Org, c.Repo)) r.SetPipelineType(c.PipelineType) + b.SetRepo(r) + logrus.Tracef("compiling pipeline %s", path) // compile into a pipeline @@ -116,7 +119,6 @@ func (c *Config) Exec(client compiler.Engine) error { Runtime: _runtime, Pipeline: _pipeline.Sanitize(constants.DriverDocker), Build: b, - Repo: r, Version: version.New().Semantic(), }) if err != nil { diff --git a/go.mod b/go.mod index df4a4279..5b784d4f 100644 --- a/go.mod +++ b/go.mod @@ -10,10 +10,10 @@ require ( github.com/dustin/go-humanize v1.0.1 github.com/gin-gonic/gin v1.9.1 github.com/go-git/go-git/v5 v5.11.0 - github.com/go-vela/sdk-go v0.23.3-0.20240411165353-c3fdc7210625 - github.com/go-vela/server v0.23.4-0.20240411145541-132447406cf7 + github.com/go-vela/sdk-go v0.23.3-0.20240424150003-64f8eb0ebcc0 + github.com/go-vela/server v0.23.4-0.20240424144436-b55aa2bb3684 github.com/go-vela/types v0.23.4-0.20240405205548-f24f795ac0b7 - github.com/go-vela/worker v0.23.3-0.20240411184512-e8783c7459ef + github.com/go-vela/worker v0.23.3-0.20240424172515-3d4399807a4b 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 3502e79e..63f962b5 100644 --- a/go.sum +++ b/go.sum @@ -123,14 +123,14 @@ github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/go-vela/sdk-go v0.23.3-0.20240411165353-c3fdc7210625 h1:mVdVHlhXeSMNDOCLK8RFTfuw3m+kLsevdIK21/xRfu4= -github.com/go-vela/sdk-go v0.23.3-0.20240411165353-c3fdc7210625/go.mod h1:qByLq0AvL9yFLfn3xhtSiXTXSHkZVZyr7C91NHU8XnQ= -github.com/go-vela/server v0.23.4-0.20240411145541-132447406cf7 h1:G8h44XJ3+gaxiWBV2uAZ82abMXhWRkrNq9sNo2cOaZU= -github.com/go-vela/server v0.23.4-0.20240411145541-132447406cf7/go.mod h1:QV9JFv+LdpAgkRJhHE92dh4vVdh0kNv8OJnyOLt++84= +github.com/go-vela/sdk-go v0.23.3-0.20240424150003-64f8eb0ebcc0 h1:AYltea00KRHeIqVW0A1BDNH10Kb6Djfl69rCtztAqM0= +github.com/go-vela/sdk-go v0.23.3-0.20240424150003-64f8eb0ebcc0/go.mod h1:WB3MAFpnwvuvSGJLrGGbt6VO8aS1URiWa5kqjngO8mU= +github.com/go-vela/server v0.23.4-0.20240424144436-b55aa2bb3684 h1:O0gfupNx7aYPCCrXwVuisrbbqbVkvrRqRBAkSg1bIww= +github.com/go-vela/server v0.23.4-0.20240424144436-b55aa2bb3684/go.mod h1:QV9JFv+LdpAgkRJhHE92dh4vVdh0kNv8OJnyOLt++84= github.com/go-vela/types v0.23.4-0.20240405205548-f24f795ac0b7 h1:3mN7ej69dMH3Vis3G/tPLzLL0Rfp8nR5qd0gpj5ejRM= github.com/go-vela/types v0.23.4-0.20240405205548-f24f795ac0b7/go.mod h1:mEF9dLkk00rUXf/t39n2WvXZgJbxnPEEWy+DHqIlRUo= -github.com/go-vela/worker v0.23.3-0.20240411184512-e8783c7459ef h1:QWW3U95F2EiAOrRRR5s6csr82aYJc5PUf9E7xVHctQc= -github.com/go-vela/worker v0.23.3-0.20240411184512-e8783c7459ef/go.mod h1:UumZqTx7DfGR66SW10Wl24n/4dQ0UBUeTy89JOPEeVg= +github.com/go-vela/worker v0.23.3-0.20240424172515-3d4399807a4b h1:BAfnoo7pqj7girJPYloKybqehjf3uKT3p9n/aMWMQTU= +github.com/go-vela/worker v0.23.3-0.20240424172515-3d4399807a4b/go.mod h1:e8iHziW2wNTDhF5LC1LGAW8N2doD0G8Q3aS2tC5Iwl4= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=