Skip to content

Commit 55c73d4

Browse files
authored
refactor: remove types dependency (#583)
* refactor: remove types dependency * gci
1 parent e8b493d commit 55c73d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+124
-137
lines changed

action/deployment/add.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@ import (
77

88
"github.com/go-vela/cli/internal/output"
99
"github.com/go-vela/sdk-go/vela"
10-
"github.com/go-vela/types/library"
10+
api "github.com/go-vela/server/api/types"
1111
)
1212

1313
// Add creates a deployment based off the provided configuration.
1414
func (c *Config) Add(client *vela.Client) error {
1515
logrus.Debug("executing add for deployment configuration")
1616

1717
// create the deployment object
18-
//
19-
// https://pkg.go.dev/github.com/go-vela/types/library?tab=doc#Deployment
20-
d := &library.Deployment{
18+
d := &api.Deployment{
2119
Ref: &c.Ref,
2220
Task: &c.Task,
2321
Target: &c.Target,

action/deployment/add_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"testing"
88

99
"github.com/go-vela/sdk-go/vela"
10+
"github.com/go-vela/server/compiler/types/raw"
1011
"github.com/go-vela/server/mock/server"
11-
"github.com/go-vela/types/raw"
1212
)
1313

1414
func TestDeployment_Config_Add(t *testing.T) {

action/deployment/deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package deployment
44

55
import (
66
"github.com/go-vela/cli/internal/output"
7-
"github.com/go-vela/types/raw"
7+
"github.com/go-vela/server/compiler/types/raw"
88
)
99

1010
// Config represents the configuration necessary

action/deployment/table.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import (
99
"github.com/sirupsen/logrus"
1010

1111
"github.com/go-vela/cli/internal/output"
12-
"github.com/go-vela/types/library"
12+
api "github.com/go-vela/server/api/types"
1313
)
1414

1515
// table is a helper function to output the
1616
// provided deployments in a table format with
1717
// a specific set of fields displayed.
18-
func table(deployments *[]library.Deployment) error {
18+
func table(deployments *[]api.Deployment) error {
1919
logrus.Debug("creating table for list of deployments")
2020

2121
// create a new table
@@ -59,7 +59,7 @@ func table(deployments *[]library.Deployment) error {
5959
// wideTable is a helper function to output the
6060
// provided deployments in a wide table format with
6161
// a specific set of fields displayed.
62-
func wideTable(deployments *[]library.Deployment) error {
62+
func wideTable(deployments *[]api.Deployment) error {
6363
logrus.Debug("creating wide table for list of deployments")
6464

6565
// create new wide table
@@ -103,7 +103,7 @@ func wideTable(deployments *[]library.Deployment) error {
103103
// reverse is a helper function to sort the deployments
104104
// based off the deployment number and then flip the
105105
// order they get displayed in.
106-
func reverse(d []library.Deployment) []library.Deployment {
106+
func reverse(d []api.Deployment) []api.Deployment {
107107
// sort the list of deployments based off the deployment id
108108
sort.SliceStable(d, func(i, j int) bool {
109109
return d[i].GetID() < d[j].GetID()

action/deployment/table_test.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package deployment
55
import (
66
"testing"
77

8-
"github.com/go-vela/types/library"
8+
api "github.com/go-vela/server/api/types"
99
)
1010

1111
func TestDeployment_table(t *testing.T) {
@@ -19,11 +19,11 @@ func TestDeployment_table(t *testing.T) {
1919
// setup tests
2020
tests := []struct {
2121
failure bool
22-
steps *[]library.Deployment
22+
steps *[]api.Deployment
2323
}{
2424
{
2525
failure: false,
26-
steps: &[]library.Deployment{
26+
steps: &[]api.Deployment{
2727
*d1,
2828
*d2,
2929
},
@@ -59,11 +59,11 @@ func TestDeployment_wideTable(t *testing.T) {
5959
// setup tests
6060
tests := []struct {
6161
failure bool
62-
steps *[]library.Deployment
62+
steps *[]api.Deployment
6363
}{
6464
{
6565
failure: false,
66-
steps: &[]library.Deployment{
66+
steps: &[]api.Deployment{
6767
*d1,
6868
*d2,
6969
},
@@ -90,11 +90,10 @@ func TestDeployment_wideTable(t *testing.T) {
9090

9191
// testDeployment is a test helper function to create a Deployment
9292
// type with all fields set to a fake value.
93-
func testDeployment() *library.Deployment {
94-
d := new(library.Deployment)
93+
func testDeployment() *api.Deployment {
94+
d := new(api.Deployment)
9595

9696
d.SetID(1)
97-
d.SetRepoID(1)
9897
d.SetURL("https://api.github.com/repos/github/octocat/deployments/1")
9998
d.SetCreatedBy("octocat")
10099
d.SetCommit("48afb5bdc41ad69bf22588491333f7cf71135163")

action/hook/table.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import (
1111
"github.com/sirupsen/logrus"
1212

1313
"github.com/go-vela/cli/internal/output"
14-
"github.com/go-vela/types/library"
14+
api "github.com/go-vela/server/api/types"
1515
)
1616

1717
// table is a helper function to output the
1818
// provided hooks in a table format with
1919
// a specific set of fields displayed.
20-
func table(hooks *[]library.Hook) error {
20+
func table(hooks *[]api.Hook) error {
2121
logrus.Debug("creating table for list of hooks")
2222

2323
// create a new table
@@ -66,7 +66,7 @@ func table(hooks *[]library.Hook) error {
6666
// wideTable is a helper function to output the
6767
// provided hooks in a wide table format with
6868
// a specific set of fields displayed.
69-
func wideTable(hooks *[]library.Hook) error {
69+
func wideTable(hooks *[]api.Hook) error {
7070
logrus.Debug("creating wide table for list of hooks")
7171

7272
// create new wide table
@@ -115,7 +115,7 @@ func wideTable(hooks *[]library.Hook) error {
115115
// reverse is a helper function to sort the hooks
116116
// based off the hook number and then flip the
117117
// order they get displayed in.
118-
func reverse(h []library.Hook) []library.Hook {
118+
func reverse(h []api.Hook) []api.Hook {
119119
// sort the list of hooks based off the hook number
120120
sort.SliceStable(h, func(i, j int) bool {
121121
return h[i].GetNumber() < h[j].GetNumber()

action/hook/table_test.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"testing"
77
"time"
88

9-
"github.com/go-vela/types/library"
9+
api "github.com/go-vela/server/api/types"
1010
)
1111

1212
func TestHook_table(t *testing.T) {
@@ -20,11 +20,11 @@ func TestHook_table(t *testing.T) {
2020
// setup tests
2121
tests := []struct {
2222
failure bool
23-
steps *[]library.Hook
23+
steps *[]api.Hook
2424
}{
2525
{
2626
failure: false,
27-
steps: &[]library.Hook{
27+
steps: &[]api.Hook{
2828
*h1,
2929
*h2,
3030
},
@@ -60,11 +60,11 @@ func TestHook_wideTable(t *testing.T) {
6060
// setup tests
6161
tests := []struct {
6262
failure bool
63-
steps *[]library.Hook
63+
steps *[]api.Hook
6464
}{
6565
{
6666
failure: false,
67-
steps: &[]library.Hook{
67+
steps: &[]api.Hook{
6868
*h1,
6969
*h2,
7070
},
@@ -91,12 +91,10 @@ func TestHook_wideTable(t *testing.T) {
9191

9292
// testHook is a test helper function to create a Hook
9393
// type with all fields set to a fake value.
94-
func testHook() *library.Hook {
95-
h := new(library.Hook)
94+
func testHook() *api.Hook {
95+
h := new(api.Hook)
9696

9797
h.SetID(1)
98-
h.SetRepoID(1)
99-
h.SetBuildID(1)
10098
h.SetNumber(1)
10199
h.SetSourceID("c8da1302-07d6-11ea-882f-4893bca275b8")
102100
h.SetCreated(time.Now().UTC().Unix())

action/pipeline/exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/go-vela/cli/version"
1717
api "github.com/go-vela/server/api/types"
1818
"github.com/go-vela/server/compiler"
19-
"github.com/go-vela/types/constants"
19+
"github.com/go-vela/server/constants"
2020
"github.com/go-vela/worker/executor"
2121
"github.com/go-vela/worker/runtime"
2222
)

action/pipeline/stage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package pipeline
55
import (
66
"github.com/sirupsen/logrus"
77

8-
"github.com/go-vela/types/yaml"
8+
"github.com/go-vela/server/compiler/types/yaml"
99
)
1010

1111
func stages(pipelineType string) *yaml.Build {
@@ -38,7 +38,7 @@ func stages(pipelineType string) *yaml.Build {
3838

3939
// return a stages pipeline based off the type
4040
//
41-
// https://pkg.go.dev/github.com/go-vela/types/yaml?tab=doc#Build
41+
// https://pkg.go.dev/github.com/go-vela/server/compiler/types/yaml?tab=doc#Build
4242
return &yaml.Build{
4343
Version: "1",
4444
Stages: yaml.StageSlice{

action/pipeline/stage_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"reflect"
77
"testing"
88

9-
"github.com/go-vela/types/yaml"
9+
"github.com/go-vela/server/compiler/types/yaml"
1010
)
1111

1212
func TestPipeline_stages(t *testing.T) {

0 commit comments

Comments
 (0)