-
Notifications
You must be signed in to change notification settings - Fork 433
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
feat(api): manually delete 1 build from history #3782 #4400
Conversation
Signed-off-by: Benjamin Coenen <[email protected]>
CDS Report ut-engine#10029.0 ✘
|
Signed-off-by: Benjamin Coenen <[email protected]>
Signed-off-by: Benjamin Coenen <[email protected]>
engine/api/workflow/dao_run.go
Outdated
@@ -41,6 +41,7 @@ type LoadRunOptions struct { | |||
WithTests bool | |||
WithLightTests bool | |||
WithVulnerabilities bool | |||
WithoutDeleted bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent returns deleted runs, maybe we should have a WithDeleted flag instead of Without. So the default case will be to return only not deleted runs. No ?
engine/api/workflow/dao_run.go
Outdated
@@ -469,6 +473,9 @@ func loadRun(db gorp.SqlExecutor, loadOpts LoadRunOptions, query string, args .. | |||
return nil, sdk.WrapError(err, "Unable to load workflow run. query:%s args:%v", query, args) | |||
} | |||
wr := sdk.WorkflowRun(*runDB) | |||
if loadOpts.WithoutDeleted && wr.ToDelete { | |||
return nil, sdk.ErrWorkflowNotFound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return nil, sdk.ErrWorkflowNotFound | |
return nil, sdk.WithStack(sdk.ErrWorkflowNotFound) |
Signed-off-by: Benjamin Coenen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add a unit test about deleteWorkflowRunHandler
please ?
Signed-off-by: Benjamin Coenen <[email protected]>
Signed-off-by: Benjamin Coenen <[email protected]>
Signed-off-by: Benjamin Coenen [email protected]
close feat: manually delete 1 build from history #3782
@ovh/cds