diff --git a/cli/cdsctl/workflow_run.go b/cli/cdsctl/workflow_run.go index 2cf092d72c..63c9538338 100644 --- a/cli/cdsctl/workflow_run.go +++ b/cli/cdsctl/workflow_run.go @@ -162,9 +162,7 @@ func workflowRunManualRun(v cli.Values) error { } if v.GetBool("sync") { - if _, err := client.WorkflowRunResync(v.GetString(_ProjectKey), v.GetString(_WorkflowName), runNumber); err != nil { - return cli.WrapError(err, "Cannot resync your workflow run %d ", runNumber) - } + manual.Resync = true } if v.GetString("node-name") != "" { diff --git a/sdk/cdsclient/client_workflow.go b/sdk/cdsclient/client_workflow.go index 4abaca3a5e..a8e2e9d979 100644 --- a/sdk/cdsclient/client_workflow.go +++ b/sdk/cdsclient/client_workflow.go @@ -106,15 +106,6 @@ func (c *client) WorkflowRunsDeleteByBranch(projectKey string, workflowName stri return nil } -func (c *client) WorkflowRunResync(projectKey string, workflowName string, number int64) (*sdk.WorkflowRun, error) { - url := fmt.Sprintf("/project/%s/workflows/%s/runs/%d/resync", projectKey, workflowName, number) - var run sdk.WorkflowRun - if _, err := c.PostJSON(context.Background(), url, nil, &run); err != nil { - return nil, err - } - return &run, nil -} - func (c *client) WorkflowRunSearch(projectKey string, offset, limit int64, filters ...Filter) ([]sdk.WorkflowRun, error) { if offset < 0 { offset = 0 diff --git a/sdk/cdsclient/interface.go b/sdk/cdsclient/interface.go index dac1634a69..e376fcb3a4 100644 --- a/sdk/cdsclient/interface.go +++ b/sdk/cdsclient/interface.go @@ -333,7 +333,6 @@ type WorkflowClient interface { WorkflowGroupDelete(projectKey, name, groupName string) error WorkflowRunGet(projectKey string, workflowName string, number int64) (*sdk.WorkflowRun, error) WorkflowRunsDeleteByBranch(projectKey string, workflowName string, branch string) error - WorkflowRunResync(projectKey string, workflowName string, number int64) (*sdk.WorkflowRun, error) WorkflowRunSearch(projectKey string, offset, limit int64, filter ...Filter) ([]sdk.WorkflowRun, error) WorkflowRunList(projectKey string, workflowName string, offset, limit int64) ([]sdk.WorkflowRun, error) WorkflowRunArtifacts(projectKey string, name string, number int64) ([]sdk.WorkflowNodeRunArtifact, error) diff --git a/sdk/cdsclient/mock_cdsclient/interface_mock.go b/sdk/cdsclient/mock_cdsclient/interface_mock.go index 12400cc657..daaad8148e 100644 --- a/sdk/cdsclient/mock_cdsclient/interface_mock.go +++ b/sdk/cdsclient/mock_cdsclient/interface_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: interface.go +// Source: sdk/cdsclient/interface.go // Package mock_cdsclient is a generated GoMock package. package mock_cdsclient @@ -4341,21 +4341,6 @@ func (mr *MockWorkflowClientMockRecorder) WorkflowRunResultsList(ctx, projectKey return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkflowRunResultsList", reflect.TypeOf((*MockWorkflowClient)(nil).WorkflowRunResultsList), ctx, projectKey, name, number) } -// WorkflowRunResync mocks base method. -func (m *MockWorkflowClient) WorkflowRunResync(projectKey, workflowName string, number int64) (*sdk.WorkflowRun, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WorkflowRunResync", projectKey, workflowName, number) - ret0, _ := ret[0].(*sdk.WorkflowRun) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// WorkflowRunResync indicates an expected call of WorkflowRunResync. -func (mr *MockWorkflowClientMockRecorder) WorkflowRunResync(projectKey, workflowName, number interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkflowRunResync", reflect.TypeOf((*MockWorkflowClient)(nil).WorkflowRunResync), projectKey, workflowName, number) -} - // WorkflowRunSearch mocks base method. func (m *MockWorkflowClient) WorkflowRunSearch(projectKey string, offset, limit int64, filter ...cdsclient.Filter) ([]sdk.WorkflowRun, error) { m.ctrl.T.Helper() @@ -8688,21 +8673,6 @@ func (mr *MockInterfaceMockRecorder) WorkflowRunResultsList(ctx, projectKey, nam return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkflowRunResultsList", reflect.TypeOf((*MockInterface)(nil).WorkflowRunResultsList), ctx, projectKey, name, number) } -// WorkflowRunResync mocks base method. -func (m *MockInterface) WorkflowRunResync(projectKey, workflowName string, number int64) (*sdk.WorkflowRun, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WorkflowRunResync", projectKey, workflowName, number) - ret0, _ := ret[0].(*sdk.WorkflowRun) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// WorkflowRunResync indicates an expected call of WorkflowRunResync. -func (mr *MockInterfaceMockRecorder) WorkflowRunResync(projectKey, workflowName, number interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkflowRunResync", reflect.TypeOf((*MockInterface)(nil).WorkflowRunResync), projectKey, workflowName, number) -} - // WorkflowRunSearch mocks base method. func (m *MockInterface) WorkflowRunSearch(projectKey string, offset, limit int64, filter ...cdsclient.Filter) ([]sdk.WorkflowRun, error) { m.ctrl.T.Helper()