Skip to content

Commit 43cffbd

Browse files
authored
fix(cdsctl): run with resync (#5819)
Signed-off-by: Yvonnick Esnault <[email protected]>
1 parent 066372c commit 43cffbd

File tree

4 files changed

+2
-44
lines changed

4 files changed

+2
-44
lines changed

cli/cdsctl/workflow_run.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ func workflowRunManualRun(v cli.Values) error {
162162
}
163163

164164
if v.GetBool("sync") {
165-
if _, err := client.WorkflowRunResync(v.GetString(_ProjectKey), v.GetString(_WorkflowName), runNumber); err != nil {
166-
return cli.WrapError(err, "Cannot resync your workflow run %d ", runNumber)
167-
}
165+
manual.Resync = true
168166
}
169167

170168
if v.GetString("node-name") != "" {

sdk/cdsclient/client_workflow.go

-9
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,6 @@ func (c *client) WorkflowRunsDeleteByBranch(projectKey string, workflowName stri
106106
return nil
107107
}
108108

109-
func (c *client) WorkflowRunResync(projectKey string, workflowName string, number int64) (*sdk.WorkflowRun, error) {
110-
url := fmt.Sprintf("/project/%s/workflows/%s/runs/%d/resync", projectKey, workflowName, number)
111-
var run sdk.WorkflowRun
112-
if _, err := c.PostJSON(context.Background(), url, nil, &run); err != nil {
113-
return nil, err
114-
}
115-
return &run, nil
116-
}
117-
118109
func (c *client) WorkflowRunSearch(projectKey string, offset, limit int64, filters ...Filter) ([]sdk.WorkflowRun, error) {
119110
if offset < 0 {
120111
offset = 0

sdk/cdsclient/interface.go

-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ type WorkflowClient interface {
333333
WorkflowGroupDelete(projectKey, name, groupName string) error
334334
WorkflowRunGet(projectKey string, workflowName string, number int64) (*sdk.WorkflowRun, error)
335335
WorkflowRunsDeleteByBranch(projectKey string, workflowName string, branch string) error
336-
WorkflowRunResync(projectKey string, workflowName string, number int64) (*sdk.WorkflowRun, error)
337336
WorkflowRunSearch(projectKey string, offset, limit int64, filter ...Filter) ([]sdk.WorkflowRun, error)
338337
WorkflowRunList(projectKey string, workflowName string, offset, limit int64) ([]sdk.WorkflowRun, error)
339338
WorkflowRunArtifacts(projectKey string, name string, number int64) ([]sdk.WorkflowNodeRunArtifact, error)

sdk/cdsclient/mock_cdsclient/interface_mock.go

+1-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)