From 6ee08d16e582c30ff991600eaff93123afe14d7c Mon Sep 17 00:00:00 2001 From: ecrupper Date: Fri, 18 Oct 2024 13:43:41 -0500 Subject: [PATCH] chore: bump server to use API types for step, service, and secret --- go.mod | 2 +- go.sum | 4 ++-- vela/admin.go | 12 ++++++------ vela/admin_test.go | 14 +++++++------- vela/repo_test.go | 30 ------------------------------ vela/secret.go | 18 +++++++++--------- vela/secret_test.go | 39 ++++++++++++++++++++------------------- vela/service.go | 18 +++++++++--------- vela/service_test.go | 24 ++++++++++++------------ vela/step.go | 18 +++++++++--------- vela/step_test.go | 24 ++++++++++++------------ 11 files changed, 87 insertions(+), 116 deletions(-) diff --git a/go.mod b/go.mod index 344a7fb..162197c 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 github.com/coreos/go-semver v0.3.1 github.com/gin-gonic/gin v1.10.0 - github.com/go-vela/server v0.25.1-0.20241011184259-67a8e47f475e + github.com/go-vela/server v0.25.1-0.20241018183530-cb37db9087c5 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 3cd3c3d..02abb50 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,8 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= -github.com/go-vela/server v0.25.1-0.20241011184259-67a8e47f475e h1:3wUbrVnaMvZSbl8zrU5iHzkYh1xU5fo/QQD/ILcOe5g= -github.com/go-vela/server v0.25.1-0.20241011184259-67a8e47f475e/go.mod h1:/DmGHNzsjsBOStLzlGDIDGCmNztUgCdvHiuWmyafFs8= +github.com/go-vela/server v0.25.1-0.20241018183530-cb37db9087c5 h1:rj2IBy+Gy16ePQTsQYmpCfBsJyYaQFPiqmDv8EZMXE8= +github.com/go-vela/server v0.25.1-0.20241018183530-cb37db9087c5/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/vela/admin.go b/vela/admin.go index e003782..70ecb01 100644 --- a/vela/admin.go +++ b/vela/admin.go @@ -190,12 +190,12 @@ func (svc *AdminRepoService) Update(r *api.Repo) (*api.Repo, *Response, error) { } // Update modifies a secret with the provided details. -func (svc *AdminSecretService) Update(s *library.Secret) (*library.Secret, *Response, error) { +func (svc *AdminSecretService) Update(s *api.Secret) (*api.Secret, *Response, error) { // set the API endpoint path we send the request to u := "/api/v1/admin/secret" // library Secret type we want to return - v := new(library.Secret) + v := new(api.Secret) // send request using client resp, err := svc.client.Call("PUT", u, s, v) @@ -204,12 +204,12 @@ func (svc *AdminSecretService) Update(s *library.Secret) (*library.Secret, *Resp } // Update modifies a service with the provided details. -func (svc *AdminSvcService) Update(s *library.Service) (*library.Service, *Response, error) { +func (svc *AdminSvcService) Update(s *api.Service) (*api.Service, *Response, error) { // set the API endpoint path we send the request to u := "/api/v1/admin/service" // library Service type we want to return - v := new(library.Service) + v := new(api.Service) // send request using client resp, err := svc.client.Call("PUT", u, s, v) @@ -218,12 +218,12 @@ func (svc *AdminSvcService) Update(s *library.Service) (*library.Service, *Respo } // Update modifies a step with the provided details. -func (svc *AdminStepService) Update(s *library.Step) (*library.Step, *Response, error) { +func (svc *AdminStepService) Update(s *api.Step) (*api.Step, *Response, error) { // set the API endpoint path we send the request to u := "/api/v1/admin/step" // library Step type we want to return - v := new(library.Step) + v := new(api.Step) // send request using client resp, err := svc.client.Call("PUT", u, s, v) diff --git a/vela/admin_test.go b/vela/admin_test.go index 919834c..14a8ac4 100644 --- a/vela/admin_test.go +++ b/vela/admin_test.go @@ -254,13 +254,13 @@ func TestAdmin_Secret_Update_200(t *testing.T) { data := []byte(server.SecretResp) - var want library.Secret + var want api.Secret _ = json.Unmarshal(data, &want) - req := library.Secret{ + req := api.Secret{ Name: String("foo"), Value: String("bar"), - AllowEvents: testLibraryEvents(), + AllowEvents: testEvents(), } // run test @@ -288,10 +288,10 @@ func TestAdmin_Service_Update_200(t *testing.T) { data := []byte(server.ServiceResp) - var want library.Service + var want api.Service _ = json.Unmarshal(data, &want) - req := library.Service{ + req := api.Service{ Number: Int(1), Status: String("finished"), Started: Int64(1563475419), @@ -323,10 +323,10 @@ func TestAdmin_Step_Update_200(t *testing.T) { data := []byte(server.StepResp) - var want library.Step + var want api.Step _ = json.Unmarshal(data, &want) - req := library.Step{ + req := api.Step{ Number: Int(1), Status: String("finished"), Started: Int64(1563475419), diff --git a/vela/repo_test.go b/vela/repo_test.go index b5164f2..fad83db 100644 --- a/vela/repo_test.go +++ b/vela/repo_test.go @@ -15,8 +15,6 @@ import ( api "github.com/go-vela/server/api/types" "github.com/go-vela/server/api/types/actions" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/library" - libraryActions "github.com/go-vela/types/library/actions" ) func TestRepo_Get_200(t *testing.T) { @@ -481,31 +479,3 @@ func testEvents() *api.Events { }, } } - -// TODO: remove this once library.Secret is converted to api.Secret. -func testLibraryEvents() *library.Events { - return &library.Events{ - Push: &libraryActions.Push{ - Branch: Bool(true), - Tag: Bool(true), - DeleteBranch: Bool(true), - DeleteTag: Bool(true), - }, - PullRequest: &libraryActions.Pull{ - Opened: Bool(true), - Edited: Bool(true), - Synchronize: Bool(true), - Reopened: Bool(true), - }, - Deployment: &libraryActions.Deploy{ - Created: Bool(true), - }, - Comment: &libraryActions.Comment{ - Created: Bool(true), - Edited: Bool(true), - }, - Schedule: &libraryActions.Schedule{ - Run: Bool(true), - }, - } -} diff --git a/vela/secret.go b/vela/secret.go index 69fa834..77d8f4f 100644 --- a/vela/secret.go +++ b/vela/secret.go @@ -5,7 +5,7 @@ package vela import ( "fmt" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) // SecretService handles retrieving secrets from @@ -13,12 +13,12 @@ import ( type SecretService service // Get returns the provided secret. -func (svc *SecretService) Get(engine, sType, org, name, secret string) (*library.Secret, *Response, error) { +func (svc *SecretService) Get(engine, sType, org, name, secret string) (*api.Secret, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/secrets/%s/%s/%s/%s/%s", engine, sType, org, name, secret) // library Secret type we want to return - v := new(library.Secret) + v := new(api.Secret) // send request using client resp, err := svc.client.Call("GET", u, nil, v) @@ -27,7 +27,7 @@ func (svc *SecretService) Get(engine, sType, org, name, secret string) (*library } // GetAll returns a list of all secrets. -func (svc *SecretService) GetAll(engine, sType, org, name string, opt *ListOptions) (*[]library.Secret, *Response, error) { +func (svc *SecretService) GetAll(engine, sType, org, name string, opt *ListOptions) (*[]api.Secret, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/secrets/%s/%s/%s/%s", engine, sType, org, name) @@ -38,7 +38,7 @@ func (svc *SecretService) GetAll(engine, sType, org, name string, opt *ListOptio } // slice library Secret type we want to return - v := new([]library.Secret) + v := new([]api.Secret) // send request using client resp, err := svc.client.Call("GET", u, nil, v) @@ -47,12 +47,12 @@ func (svc *SecretService) GetAll(engine, sType, org, name string, opt *ListOptio } // Add constructs a secret with the provided details. -func (svc *SecretService) Add(engine, sType, org, name string, s *library.Secret) (*library.Secret, *Response, error) { +func (svc *SecretService) Add(engine, sType, org, name string, s *api.Secret) (*api.Secret, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/secrets/%s/%s/%s/%s", engine, sType, org, name) // library Secret type we want to return - v := new(library.Secret) + v := new(api.Secret) // send request using client resp, err := svc.client.Call("POST", u, s, v) @@ -61,12 +61,12 @@ func (svc *SecretService) Add(engine, sType, org, name string, s *library.Secret } // Update modifies a secret with the provided details. -func (svc *SecretService) Update(engine, sType, org, name string, s *library.Secret) (*library.Secret, *Response, error) { +func (svc *SecretService) Update(engine, sType, org, name string, s *api.Secret) (*api.Secret, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/secrets/%s/%s/%s/%s/%s", engine, sType, org, name, s.GetName()) // library Secret type we want to return - v := new(library.Secret) + v := new(api.Secret) // send request using client resp, err := svc.client.Call("PUT", u, s, v) diff --git a/vela/secret_test.go b/vela/secret_test.go index 977cdcc..42aeef5 100644 --- a/vela/secret_test.go +++ b/vela/secret_test.go @@ -11,9 +11,10 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/google/go-cmp/cmp" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/library" ) func TestSecret_Get_200(t *testing.T) { @@ -25,7 +26,7 @@ func TestSecret_Get_200(t *testing.T) { data := []byte(server.SecretResp) - var want library.Secret + var want api.Secret _ = json.Unmarshal(data, &want) // run test @@ -39,8 +40,8 @@ func TestSecret_Get_200(t *testing.T) { t.Errorf("Secret returned %v, want %v", resp.StatusCode, http.StatusOK) } - if !reflect.DeepEqual(got, &want) { - t.Errorf("Secret get is %v, want %v", got, want) + if diff := cmp.Diff(&want, got); diff != "" { + t.Errorf("Secret get mismatch (-want +got):\n%s", diff) } } @@ -51,7 +52,7 @@ func TestSecret_Get_404(t *testing.T) { s := httptest.NewServer(server.FakeHandler()) c, _ := NewClient(s.URL, "", nil) - want := library.Secret{} + want := api.Secret{} // run test got, resp, err := c.Secret.Get("native", "repo", "github", "not-found", "not-found") @@ -78,7 +79,7 @@ func TestSecret_GetAll_200(t *testing.T) { data := []byte(server.SecretsResp) - var want []library.Secret + var want []api.Secret _ = json.Unmarshal(data, &want) // run test @@ -106,16 +107,16 @@ func TestSecret_Add_201(t *testing.T) { data := []byte(server.SecretResp) - var want library.Secret + var want api.Secret _ = json.Unmarshal(data, &want) - req := library.Secret{ + req := api.Secret{ Org: String("github"), Repo: String("octocat"), Name: String("foo"), Value: String("bar"), Images: &[]string{"foo", "bar"}, - AllowEvents: testLibraryEvents(), + AllowEvents: testEvents(), } // run test @@ -143,13 +144,13 @@ func TestSecret_Update_200(t *testing.T) { data := []byte(server.SecretResp) - var want library.Secret + var want api.Secret _ = json.Unmarshal(data, &want) - req := library.Secret{ + req := api.Secret{ Name: String("foo"), Value: String("bar"), - AllowEvents: testLibraryEvents(), + AllowEvents: testEvents(), } // run test @@ -175,12 +176,12 @@ func TestSecret_Update_404(t *testing.T) { s := httptest.NewServer(server.FakeHandler()) c, _ := NewClient(s.URL, "", nil) - want := library.Secret{} + want := api.Secret{} - req := library.Secret{ + req := api.Secret{ Name: String("foo"), Value: String("bar"), - AllowEvents: testLibraryEvents(), + AllowEvents: testEvents(), } // run test @@ -276,11 +277,11 @@ func ExampleSecretService_Add() { // Set new token in existing client c.Authentication.SetPersonalAccessTokenAuth("token") - req := library.Secret{ + req := api.Secret{ Name: String("foo"), Value: String("bar"), Images: &[]string{"foo", "bar"}, - AllowEvents: testLibraryEvents(), + AllowEvents: testEvents(), } // Create the secret in the server @@ -299,10 +300,10 @@ func ExampleSecretService_Update() { // Set new token in existing client c.Authentication.SetPersonalAccessTokenAuth("token") - req := library.Secret{ + req := api.Secret{ Name: String("foo"), Value: String("bar"), - AllowEvents: testLibraryEvents(), + AllowEvents: testEvents(), } // Update the secret in the server diff --git a/vela/service.go b/vela/service.go index 7e29819..fc57ed6 100644 --- a/vela/service.go +++ b/vela/service.go @@ -6,7 +6,7 @@ package vela import ( "fmt" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) // SvcService handles retrieving services for builds @@ -14,12 +14,12 @@ import ( type SvcService service // Get returns the provided service. -func (svc *SvcService) Get(org, repo string, build, service int) (*library.Service, *Response, error) { +func (svc *SvcService) Get(org, repo string, build, service int) (*api.Service, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/repos/%s/%s/builds/%d/services/%d", org, repo, build, service) // library Service type we want to return - v := new(library.Service) + v := new(api.Service) // send request using client resp, err := svc.client.Call("GET", u, nil, v) @@ -28,7 +28,7 @@ func (svc *SvcService) Get(org, repo string, build, service int) (*library.Servi } // GetAll returns a list of all services. -func (svc *SvcService) GetAll(org, repo string, build int, opt *ListOptions) (*[]library.Service, *Response, error) { +func (svc *SvcService) GetAll(org, repo string, build int, opt *ListOptions) (*[]api.Service, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/repos/%s/%s/builds/%d/services", org, repo, build) @@ -39,7 +39,7 @@ func (svc *SvcService) GetAll(org, repo string, build int, opt *ListOptions) (*[ } // slice library Service type we want to return - v := new([]library.Service) + v := new([]api.Service) // send request using client resp, err := svc.client.Call("GET", u, nil, v) @@ -48,12 +48,12 @@ func (svc *SvcService) GetAll(org, repo string, build int, opt *ListOptions) (*[ } // Add constructs a service with the provided details. -func (svc *SvcService) Add(org, repo string, build int, s *library.Service) (*library.Service, *Response, error) { +func (svc *SvcService) Add(org, repo string, build int, s *api.Service) (*api.Service, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/repos/%s/%s/builds/%d/services", org, repo, build) // library Service type we want to return - v := new(library.Service) + v := new(api.Service) // send request using client resp, err := svc.client.Call("POST", u, s, v) @@ -62,12 +62,12 @@ func (svc *SvcService) Add(org, repo string, build int, s *library.Service) (*li } // Update modifies a service with the provided details. -func (svc *SvcService) Update(org, repo string, build int, s *library.Service) (*library.Service, *Response, error) { +func (svc *SvcService) Update(org, repo string, build int, s *api.Service) (*api.Service, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/repos/%s/%s/builds/%d/services/%d", org, repo, build, s.GetNumber()) // library Service type we want to return - v := new(library.Service) + v := new(api.Service) // send request using client resp, err := svc.client.Call("PUT", u, s, v) diff --git a/vela/service_test.go b/vela/service_test.go index 563f00f..3b0d0ed 100644 --- a/vela/service_test.go +++ b/vela/service_test.go @@ -13,8 +13,8 @@ import ( "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/library" ) func TestService_Get_200(t *testing.T) { @@ -26,7 +26,7 @@ func TestService_Get_200(t *testing.T) { data := []byte(server.ServiceResp) - var want library.Service + var want api.Service _ = json.Unmarshal(data, &want) // run test @@ -52,7 +52,7 @@ func TestService_Get_404(t *testing.T) { s := httptest.NewServer(server.FakeHandler()) c, _ := NewClient(s.URL, "", nil) - want := library.Service{} + want := api.Service{} // run test got, resp, err := c.Svc.Get("github", "octocat", 1, 0) @@ -79,7 +79,7 @@ func TestService_GetAll_200(t *testing.T) { data := []byte(server.ServicesResp) - var want []library.Service + var want []api.Service _ = json.Unmarshal(data, &want) // run test @@ -107,10 +107,10 @@ func TestService_Add_201(t *testing.T) { data := []byte(server.ServiceResp) - var want library.Service + var want api.Service _ = json.Unmarshal(data, &want) - req := library.Service{ + req := api.Service{ Number: Int(1), Name: String("clone"), Status: String("created"), @@ -146,10 +146,10 @@ func TestService_Update_201(t *testing.T) { data := []byte(server.ServiceResp) - var want library.Service + var want api.Service _ = json.Unmarshal(data, &want) - req := library.Service{ + req := api.Service{ Number: Int(1), Status: String("finished"), Started: Int64(1563475419), @@ -179,9 +179,9 @@ func TestService_Update_404(t *testing.T) { s := httptest.NewServer(server.FakeHandler()) c, _ := NewClient(s.URL, "", nil) - want := library.Service{} + want := api.Service{} - req := library.Service{ + req := api.Service{ Number: Int(0), Status: String("finished"), Started: Int64(1563475419), @@ -281,7 +281,7 @@ func ExampleSvcService_Add() { // Set new token in existing client c.Authentication.SetPersonalAccessTokenAuth("token") - req := library.Service{ + req := api.Service{ Number: Int(1), Name: String("clone"), Status: String("pending"), @@ -308,7 +308,7 @@ func ExampleSvcService_Update() { // Set new token in existing client c.Authentication.SetPersonalAccessTokenAuth("token") - req := library.Service{ + req := api.Service{ Status: String("error"), Error: String("Something in the runtime broke"), } diff --git a/vela/step.go b/vela/step.go index 4ca7613..4a83e31 100644 --- a/vela/step.go +++ b/vela/step.go @@ -6,7 +6,7 @@ package vela import ( "fmt" - "github.com/go-vela/types/library" + api "github.com/go-vela/server/api/types" ) // StepService handles retrieving steps for builds @@ -14,12 +14,12 @@ import ( type StepService service // Get returns the provided step. -func (svc *StepService) Get(org, repo string, build, step int) (*library.Step, *Response, error) { +func (svc *StepService) Get(org, repo string, build, step int) (*api.Step, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/repos/%s/%s/builds/%d/steps/%d", org, repo, build, step) // library Step type we want to return - v := new(library.Step) + v := new(api.Step) // send request using client resp, err := svc.client.Call("GET", u, nil, v) @@ -28,7 +28,7 @@ func (svc *StepService) Get(org, repo string, build, step int) (*library.Step, * } // GetAll returns a list of all steps. -func (svc *StepService) GetAll(org, repo string, build int, opt *ListOptions) (*[]library.Step, *Response, error) { +func (svc *StepService) GetAll(org, repo string, build int, opt *ListOptions) (*[]api.Step, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/repos/%s/%s/builds/%d/steps", org, repo, build) @@ -39,7 +39,7 @@ func (svc *StepService) GetAll(org, repo string, build int, opt *ListOptions) (* } // slice library Step type we want to return - v := new([]library.Step) + v := new([]api.Step) // send request using client resp, err := svc.client.Call("GET", u, nil, v) @@ -48,12 +48,12 @@ func (svc *StepService) GetAll(org, repo string, build int, opt *ListOptions) (* } // Add constructs a step with the provided details. -func (svc *StepService) Add(org, repo string, build int, s *library.Step) (*library.Step, *Response, error) { +func (svc *StepService) Add(org, repo string, build int, s *api.Step) (*api.Step, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/repos/%s/%s/builds/%d/steps", org, repo, build) // library Step type we want to return - v := new(library.Step) + v := new(api.Step) // send request using client resp, err := svc.client.Call("POST", u, s, v) @@ -62,12 +62,12 @@ func (svc *StepService) Add(org, repo string, build int, s *library.Step) (*libr } // Update modifies a step with the provided details. -func (svc *StepService) Update(org, repo string, build int, s *library.Step) (*library.Step, *Response, error) { +func (svc *StepService) Update(org, repo string, build int, s *api.Step) (*api.Step, *Response, error) { // set the API endpoint path we send the request to u := fmt.Sprintf("/api/v1/repos/%s/%s/builds/%d/steps/%d", org, repo, build, s.GetNumber()) // library Step type we want to return - v := new(library.Step) + v := new(api.Step) // send request using client resp, err := svc.client.Call("PUT", u, s, v) diff --git a/vela/step_test.go b/vela/step_test.go index fe73535..8377968 100644 --- a/vela/step_test.go +++ b/vela/step_test.go @@ -13,8 +13,8 @@ import ( "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/mock/server" - "github.com/go-vela/types/library" ) func TestStep_Get_200(t *testing.T) { @@ -26,7 +26,7 @@ func TestStep_Get_200(t *testing.T) { data := []byte(server.StepResp) - var want library.Step + var want api.Step _ = json.Unmarshal(data, &want) // run test @@ -52,7 +52,7 @@ func TestStep_Get_404(t *testing.T) { s := httptest.NewServer(server.FakeHandler()) c, _ := NewClient(s.URL, "", nil) - want := library.Step{} + want := api.Step{} // run test got, resp, err := c.Step.Get("github", "octocat", 1, 0) @@ -79,7 +79,7 @@ func TestStep_GetAll_200(t *testing.T) { data := []byte(server.StepsResp) - var want []library.Step + var want []api.Step _ = json.Unmarshal(data, &want) // run test @@ -107,10 +107,10 @@ func TestStep_Add_201(t *testing.T) { data := []byte(server.StepResp) - var want library.Step + var want api.Step _ = json.Unmarshal(data, &want) - req := library.Step{ + req := api.Step{ Number: Int(1), Name: String("clone"), Status: String("created"), @@ -149,10 +149,10 @@ func TestStep_Update_201(t *testing.T) { data := []byte(server.StepResp) - var want library.Step + var want api.Step _ = json.Unmarshal(data, &want) - req := library.Step{ + req := api.Step{ Number: Int(1), Status: String("finished"), Started: Int64(1563475419), @@ -182,9 +182,9 @@ func TestStep_Update_404(t *testing.T) { s := httptest.NewServer(server.FakeHandler()) c, _ := NewClient(s.URL, "", nil) - want := library.Step{} + want := api.Step{} - req := library.Step{ + req := api.Step{ Number: Int(0), Status: String("finished"), Started: Int64(1563475419), @@ -284,7 +284,7 @@ func ExampleStepService_Add() { // Set new token in existing client c.Authentication.SetPersonalAccessTokenAuth("token") - req := library.Step{ + req := api.Step{ Number: Int(1), Name: String("clone"), Status: String("pending"), @@ -314,7 +314,7 @@ func ExampleStepService_Update() { // Set new token in existing client c.Authentication.SetPersonalAccessTokenAuth("token") - req := library.Step{ + req := api.Step{ Status: String("error"), Error: String("Something in the runtime broke"), }