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

Fixed issue where dialog values are not passed consistently #22849

Closed
wants to merge 1 commit into from

Conversation

Fryguy
Copy link
Member

@Fryguy Fryguy commented Jan 23, 2024

This matches the way it's passed for the dynamic_dialog_field_value_processor i.e.

dialog_values = {:dialog => dialog_field.dialog.try(:automate_values_hash)}

@agrare Please review.

@miq-bot
Copy link
Member

miq-bot commented Jan 23, 2024

Checked commit Fryguy@ea0109f with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 👍

@agrare
Copy link
Member

agrare commented Jan 23, 2024

@Fryguy spec failures look related

@miq-bot miq-bot added the stale label Apr 29, 2024
@miq-bot
Copy link
Member

miq-bot commented Apr 29, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

@Fryguy
Copy link
Member Author

Fryguy commented May 8, 2024

I see why it's failing, but I'm not sure I understand it - maybe this isn't the right fix :(

@miq-bot miq-bot added the stale label Aug 12, 2024
@miq-bot
Copy link
Member

miq-bot commented Aug 12, 2024

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).

@agrare
Copy link
Member

agrare commented Aug 28, 2024

The logs from the specs here are gone so here are the failures

  1) ServiceReconfigureTask#deliver_to_automate automation entry point available queues the reconfigure automate entry point
     Failure/Error:
       MiqQueue.put(
         :class_name     => 'MiqAeEngine',
         :method_name    => 'deliver',
         :args           => [args],
         :role           => 'automate',
         :zone           => zone,
         :tracking_label => tracking_label_id
       )
     
       #<MiqQueue(id: integer, target_id: integer, priority: integer, method_name: string, state: string, created_on: datetime, updated_on: datetime, lock_version: integer, task_id: string, deliver_on: datetime, queue_name: string, class_name: string, instance_id: integer, args: text, miq_callback: text, msg_data: binary, zone: string, role: string, server_guid: string, msg_timeout: integer, handler_id: integer, handler_type: string, expires_on: datetime, tracking_label: string, user_id: integer, group_id: integer, tenant_id: integer, miq_task_id: integer, href_slug: string, region_number: integer, region_description: string) (class)> received :put with unexpected arguments
         expected: ({:args=>[{:attrs=>{"dialog_key"=>"value", "request"=>"service_reconfigure"}, :automate_message=>"crea...>"automate", :tracking_label=>"r38000000000236_service_reconfigure_task_38000000000045", :zone=>nil})
              got: ({:args=>[{:attrs=>{:dialog=>{"dialog_key"=>"value"}}, :automate_message=>"create", :class_name=>"clas...>"automate", :tracking_label=>"r38000000000236_service_reconfigure_task_38000000000045", :zone=>nil})
       Diff:
       @@ -1,5 +1,5 @@
        [{:args=>
       -   [{:attrs=>{"dialog_key"=>"value", "request"=>"service_reconfigure"},
       +   [{:attrs=>{:dialog=>{"dialog_key"=>"value"}},
             :automate_message=>"create",
             :class_name=>"class",
             :instance_name=>"instance",
       
     # ./app/models/service_reconfigure_task.rb:39:in `deliver_to_automate'
     # ./spec/models/service_reconfigure_task_spec.rb:107:in `block (4 levels) in <main>'
     # /home/grare/adam/.gem/ruby/3.1.0/gems/webmock-3.23.1/lib/webmock/rspec.rb:39:in `block (2 levels) in <main>'
  1) ServiceTemplateProvisionTask with multiple tasks #deliver_queue when the state is not active with AUTOMATE_DRIVES delivers to the queue
     Failure/Error:
       MiqQueue.put(
         :class_name     => 'MiqAeEngine',
         :method_name    => 'deliver',
         :args           => [args],
         :role           => 'automate',
         :zone           => options.fetch(:miq_zone, my_zone),
         :tracking_label => tracking_label_id
       )
     
       #<MiqQueue(id: integer, target_id: integer, priority: integer, method_name: string, state: string, created_on: datetime, updated_on: datetime, lock_version: integer, task_id: string, deliver_on: datetime, queue_name: string, class_name: string, instance_id: integer, args: text, miq_callback: text, msg_data: binary, zone: string, role: string, server_guid: string, msg_timeout: integer, handler_id: integer, handler_type: string, expires_on: datetime, tracking_label: string, user_id: integer, group_id: integer, tenant_id: integer, miq_task_id: integer, href_slug: string, region_number: integer, region_description: string) (class)> received :put with unexpected arguments
         expected: ({:args=>[{:attrs=>{"Service::Service"=>87000000000037, "request"=>"clone_to_service"}, :automate_mess...:tracking_label=>"r87000000000089_service_template_provision_task_87000000000617", :zone=>"special"})
              got: ({:args=>[{:attrs=>{"Service::Service"=>87000000000037, :dialog=>{}, "request"=>"clone_to_service"}, :...:tracking_label=>"r87000000000089_service_template_provision_task_87000000000617", :zone=>"special"})
       Diff:
       @@ -1,6 +1,8 @@
        [{:args=>
           [{:attrs=>
       -      {"Service::Service"=>87000000000037, "request"=>"clone_to_service"},
       +      {"Service::Service"=>87000000000037,
       +       :dialog=>{},
       +       "request"=>"clone_to_service"},
             :automate_message=>"create",
             :class_name=>"ServiceProvision_Template",
             :instance_name=>"clone_to_service",
       
     # ./app/models/service_template_provision_task.rb:161:in `deliver_to_automate'
     # ./app/models/miq_request_task.rb:153:in `deliver_queue'
     # ./spec/models/service_template_provision_task_spec.rb:115:in `block (6 levels) in <main>'
     # /home/grare/adam/.gem/ruby/3.1.0/gems/webmock-3.23.1/lib/webmock/rspec.rb:39:in `block (2 levels) in <main>'

Finished in 10.23 seconds (files took 6.96 seconds to load)
176 examples, 1 failure

Failed examples:

rspec ./spec/models/service_template_provision_task_spec.rb:91 # ServiceTemplateProvisionTask with multiple tasks #deliver_queue when the state is not active with AUTOMATE_DRIVES delivers to the queue

@agrare
Copy link
Member

agrare commented Aug 28, 2024

#23138 is an alternate which (accidentally) only changes the dialog_values format for workflows so it isn't subject to the same errors as this with other Services

@agrare
Copy link
Member

agrare commented Aug 28, 2024

@Fryguy I do like keeping the input consistent for everything, but I'd be wary of changing the attrs that get delivered to automate which is what is (luckily) causing these test failures.

@Fryguy
Copy link
Member Author

Fryguy commented Aug 29, 2024

Closing in favor of #23138

@Fryguy Fryguy closed this Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants