-
Notifications
You must be signed in to change notification settings - Fork 443
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
Conversation
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
return err | ||
} | ||
|
||
if err := workflow.MarkWorkflowRunsAsDelete(api.mustDB(), wfIDs); err != nil { |
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.
Do we have to stop them all?
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.
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>
engine/hooks/webhook.go
Outdated
@@ -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) |
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.
Error return value of s.enqueueBranchDeletion
is not checked (from errcheck
)
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
missing some doc about vcs event on https://ovh.github.io/cds/docs/integrations/bitbucket/ , https://ovh.github.io/cds/docs/integrations/github/, and https://ovh.github.io/cds/docs/integrations/gitlab/ |
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>
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
Signed-off-by: Benjamin Coenen benjamin.coenen@corp.ovh.com
close delete workflow run related to deleted branches #2517
@ovh/cds