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(api): fix hooks with empty UUID #5098

Merged
merged 1 commit into from
Apr 3, 2020
Merged

Conversation

fsamin
Copy link
Member

@fsamin fsamin commented Apr 2, 2020

Signed-off-by: francois samin [email protected]

@ovh-cds
Copy link
Collaborator

ovh-cds commented Apr 2, 2020

CDS Report build-all-cds#12895.0 ✘

  • Build
    • Build and Package All ✔
    • Build Debpacker ✔
    • Build OS-Ansible-Inventory ✔
    • Build SMTPMock ✔
    • Lint UI Translate ✔
    • Test CLI ✔
    • Test Engine ✘
    • Test SDK ✔
    • Test SDK Rust ✔
    • Test UI ✔

@@ -135,3 +135,80 @@ func cleanDuplicateHooks(ctx context.Context, db *gorp.DbMap, store cache.Store,

return nil
}

func FixEmptyUUIDHooks(ctx context.Context, db *gorp.DbMap, store cache.Store) error {
q := "select distinct(workflow.id) from w_node_hook join w_node on w_node.id = w_node_hook.node_id join workflow on workflow.id = w_node.workflow_id where uuid = ''"
Copy link
Collaborator

Choose a reason for hiding this comment

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

request must check workflow_data->node->hooks uuid that is the right data

@@ -707,6 +707,10 @@ func (a *API) Serve(ctx context.Context) error {
return migrate.CleanDuplicateHooks(ctx, a.DBConnectionFactory.GetDBMap(), a.Cache, false)
}})

migrate.Add(ctx, sdk.Migration{Name: "FixEmptyUUIDHooks", Release: "0.44.0", Blocker: false, Automatic: false, ExecFunc: func(ctx context.Context) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not delete these hooks?

@sguiheux sguiheux merged commit 5386f91 into master Apr 3, 2020
@fsamin fsamin deleted the fix/api/emptu_hook_uuid branch April 6, 2020 14:07
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.

5 participants