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

feat(api): manually delete 1 build from history #3782 #4400

Merged
merged 6 commits into from
Jul 5, 2019
Merged

Conversation

bnjjj
Copy link
Contributor

@bnjjj bnjjj commented Jun 26, 2019

Signed-off-by: Benjamin Coenen [email protected]

  1. Description
  2. Related issues
    close feat: manually delete 1 build from history #3782
  3. About tests
  4. Mentions

@ovh/cds

@ovh-cds
Copy link
Collaborator

ovh-cds commented Jun 26, 2019

CDS Report ut-engine#10029.0 ✘

  • Stage 1
    • Engine Test with DB ✘

@@ -41,6 +41,7 @@ type LoadRunOptions struct {
WithTests bool
WithLightTests bool
WithVulnerabilities bool
WithoutDeleted bool
Copy link
Member

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 ?

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, sdk.ErrWorkflowNotFound
return nil, sdk.WithStack(sdk.ErrWorkflowNotFound)

fsamin
fsamin previously requested changes Jul 3, 2019
Copy link
Member

@fsamin fsamin left a 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 ?

@yesnault yesnault merged commit 37d64a8 into master Jul 5, 2019
@richardlt richardlt deleted the feat_3782 branch September 12, 2019 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: manually delete 1 build from history
6 participants