8000 feat(api): delete workflow run on branch delete by bnjjj · Pull Request #4177 · ovh/cds · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(api): delete workflow run on branch delete #4177

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

Merged
merged 9 commits into from
May 13, 2019
Merged

feat(api): delete workflow run on branch delete #4177

merged 9 commits into from
May 13, 2019

Conversation

bnjjj
Copy link
Contributor
@bnjjj bnjjj commented Apr 10, 2019

Signed-off-by: Benjamin Coenen benjamin.coenen@corp.ovh.com

  1. Description
  2. Related issues
    close delete workflow run related to deleted branches #2517
  3. About tests
  4. Mentions

@ovh/cds

Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
@fsamin fsamin added ascode bugs, features concerning as code format and removed ascode bugs, features concerning as code format labels Apr 11, 2019
return err
}

if err := workflow.MarkWorkflowRunsAsDelete(api.mustDB(), wfIDs); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have to stop them all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, with future commit it will be deleted 24h after, so it will be stopped

Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
@@ -49,6 +52,9 @@ func executeRepositoryWebHook(t *sdk.TaskExecution) ([]sdk.WorkflowNodeRunHookEv
return nil, sdk.WrapError(err, "unable ro read github request: %s", string(t.WebHook.RequestBody))
}
if pushEvent.Deleted {
branch := strings.TrimPrefix(pushEvent.Ref, "refs/heads/")
s.enqueueBranchDeletion(t.UUID, projectKey, workflowName, branch)

Choose a reason for hiding this comment

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

Error return value of s.enqueueBranchDeletion is not checked (from errcheck)

Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
@yesnault
Copy link
Member

Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
Co-Authored-By: bnjjj <benjamin.coenen@hotmail.com>
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
@bnjjj bnjjj merged commit a1e8b44 into master May 13, 2019
@fsamin fsamin deleted the feat_2517 branch May 24, 2019 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ascode bugs, features concerning as code format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

delete workflow run related to deleted branches
6 participants
0