Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cdsctl): run with resync #5819

Merged
merged 1 commit into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.