Closed agrare closed 3 months ago
Is there a way to test that it executes this properly? Not sure how to do this, so the current test may be the best option
Backported to radjabov
in commit 1286aa34992340cad7a0778df01a845f1772e561.
commit 1286aa34992340cad7a0778df01a845f1772e561
Author: Keenan Brock <keenan@thebrocks.net>
Date: Tue Aug 27 14:37:45 2024 -0400
Merge pull request #23123 from agrare/fix_miq_request_task_resource_action_workflow
Fix MiqRequestTask ResourceAction with a Workflow
(cherry picked from commit 4b49d3055eb87173cc8c7b983b8ebf7500737989)
If a ServiceTemplate has a ResourceAction with a configuration_script_payload as its entrypoint this was not being run by MiqRequestTask#deliver_queue.
Introduced by https://github.com/ManageIQ/manageiq/pull/23039
We did have a spec test covering this case but it was changed by https://github.com/ManageIQ/manageiq/pull/23039/files#diff-169a716c426d776976d164d5088f0f2dc18360c2417272e40af19f153e86f437 so the regression wasn't caught.
Service Templates
Pure workflows based service catalog item
VMware provision with workflows built-in
Ordering
Pure Workflows
You get a single MiqRequestTask that is a
ServiceTemplateProvisionTask
This was where we had the original https://github.com/ManageIQ/manageiq/pull/22511/files#diff-8dfa5b51b60d86d6591a7daba20e32a847ffd140f057a52b251dccb5b82984faR142-R143 code to execute this.
deliver_queue here is called by:
VMware MiqProvision with Workflows
With this you get 3 MiqRequestTasks, 2
ServiceTemplateProvisionTask
and 1ManageIQ::Providers::Vmware::InfraManager::Provision
/MiqProvision
task.Top level service template provision task:
"intermediate" service tempalate provision task:
And finally the MiqProvision task:
The problem
The issue here is that for a pure-workflows
ServiceTemplateProvisionTask
we have the workflow id in the resource_action, and we want to execute it for thatServiceTemplateProvisionTask
However, with a VMware based provision using a workflow we also have a
ServiceTemplateProvisionTask
that has a resource_action with the workflow id, BUT we don't want to execute that with workflows we only want to execute theMiqProvision
task with workflows.I tried moving the workflow definition down to
MiqProvision
to check options and leaving theServiceTemplateProvisionTask
to check the resource_action, but the issue is both have a valid resource_action workflow_id and we only want to call workflows on ONE of these types.I think if we could get the pure-workflow
ServiceTemplateProvisionTask
to have the configuration_script_payload_id in options to indicate that we want to execute the workflow on this miq_request_task that would work.