ManageIQ / manageiq

ManageIQ Open-Source Management Platform
https://manageiq.org
Apache License 2.0
1.35k stars 900 forks source link

Fix inconsistent dialog input for Workflows #23138

Closed agrare closed 3 months ago

agrare commented 3 months ago

Workflows run for a dynamic dialog have their dialog_values nested under a top-level {:dialog => {}} key, workflows run as a Service Template Entrypoint should have the same format.

Before this the input from a dialog would be passed like: Running state: [CloneTemplate] with input [{"dialog_vm_name"=>"ag-prov-test", "dialog_provider"=>4, "dialog_verify_ssl"=>"false", "dialog_source_template"=>"vm-64"}]...

Which would cause e.g. https://github.com/ManageIQ/workflows-examples/blob/master/provision-vm-service/provision-vm.asl#L19-L23 to fail to find the values.

This way the input format should be the same as workflows run via a dynamic dialog e.g. https://github.com/ManageIQ/workflows-examples/blob/master/provision-vm-service/list-providers.asl#L17

Related: https://github.com/ManageIQ/manageiq/pull/22849

agrare commented 3 months ago

cc @Fryguy I thought we fixed this but I'm still running into this issue today, I had to tweak my provision-vm.asl to drop the $dialog. prefix in order for the workflow to work

miq-bot commented 3 months ago

Checked commit https://github.com/agrare/manageiq/commit/bce09e73a1e0f25d058337a38f9835a04149033e with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :cookie:

Fryguy commented 3 months ago

Backported to radjabov in commit 0702701d5d667f6c4d7da66c101e58522654f8e3.

commit 0702701d5d667f6c4d7da66c101e58522654f8e3
Author: Jason Frey <fryguy9@gmail.com>
Date:   Thu Aug 29 10:20:55 2024 -0400

    Merge pull request #23138 from agrare/fix_dialog_dialog_dialog

    Fix inconsistent dialog input for Workflows

    (cherry picked from commit e5a568dee9b6ff173c68fdc4b35ae10225bc3217)