Skip to content

Commit

Permalink
fix(cdsctl): run with resync (#5819)
Browse files Browse the repository at this point in the history
Signed-off-by: Yvonnick Esnault <[email protected]>
  • Loading branch information
yesnault authored May 19, 2021
1 parent 066372c commit 43cffbd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 44 deletions.
4 changes: 1 addition & 3 deletions cli/cdsctl/workflow_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") != "" {
Expand Down
9 changes: 0 additions & 9 deletions sdk/cdsclient/client_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion sdk/cdsclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
32 changes: 1 addition & 31 deletions sdk/cdsclient/mock_cdsclient/interface_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 43cffbd

Please sign in to comment.