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

Add zone to service provisioning. #18601

Merged
merged 1 commit into from
Mar 30, 2019

Conversation

lfu
Copy link
Member

@lfu lfu commented Mar 27, 2019

Add zone to service provisioning to allow the running of service-related automate tasks in a specific zone.

Zone could be set at following two places with priority from high to low:

  1. Service catalog item dialog
  2. Service template

Each individual catalog items could specify their zones to run in, but the catalog bundle is zone-agnostic as it’s not a real workflow item, more of an organizational / container thing.

UI change is required: add a drop down list for zone selection when adding a new catalog item.
There is no change for adding a new catalog bundle.

Depends on ManageIQ/manageiq-schema#358.
https://bugzilla.redhat.com/show_bug.cgi?id=1415106

@miq-bot add_label enhancement, services
@miq-bot assign @gmcculloug
cc @tinaafitz

@gmcculloug gmcculloug assigned tinaafitz and unassigned gmcculloug Mar 27, 2019
@lfu lfu force-pushed the add_zone_to_service_1415106 branch from a208cc8 to 5581341 Compare March 28, 2019 14:17
@lfu lfu force-pushed the add_zone_to_service_1415106 branch from 5581341 to a8c7f1b Compare March 28, 2019 14:32
@lfu lfu changed the title Add zone to service. Add zone to service provisioning. Mar 28, 2019
@lfu lfu force-pushed the add_zone_to_service_1415106 branch 2 times, most recently from c1d2e92 to 73287b1 Compare March 29, 2019 17:59
@lfu lfu force-pushed the add_zone_to_service_1415106 branch 2 times, most recently from c9a9805 to 48557e9 Compare March 29, 2019 21:01
@lfu lfu force-pushed the add_zone_to_service_1415106 branch from 48557e9 to 156eda5 Compare March 29, 2019 23:00
@miq-bot
Copy link
Member

miq-bot commented Mar 29, 2019

Checked commit lfu@156eda5 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
5 files checked, 0 offenses detected
Everything looks fine. 🍰

@Loicavenel
Copy link

@lfu any UI plan for this? How do you specify which zone a Service catalog item dialog will run in?

@gmcculloug gmcculloug merged commit 0bf7cc0 into ManageIQ:master Mar 30, 2019
@gmcculloug gmcculloug added this to the Sprint 108 Ending Apr 1, 2019 milestone Mar 30, 2019
@gmcculloug
Copy link
Member

@Loicavenel We update the BZ and switch the component over to UI so they can continue with the enhancement.

before do
@st_zone = FactoryBot.create(:zone, :name => "service_template_zone")
@service = FactoryBot.create(:service, :name => 'Test Service')
@task_0.source = FactoryBot.create(:service_template, :zone => @st_zone)
Copy link
Member

Choose a reason for hiding this comment

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

This line is failing for me locally when I run the tests. ServiceTemplate doesn't have a zone_id column

I get 4 errors, all looking the same:

  4) ServiceTemplateProvisionTask with multiple tasks #deliver_to_automate when the state is not active sets queue item to server's zone if not specified in dialog and service template
     Failure/Error: factory_exists?(factory) ? super : class_from_symbol(factory).create!(*args)

     ActiveModel::MissingAttributeError:
       can't write unknown attribute `zone_id`
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/activerecord-5.0.7.2/lib/active_record/attribute.rb:182:in `with_value_from_database'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/activerecord-5.0.7.2/lib/active_record/attribute_set.rb:53:in `write_from_user'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/activerecord-5.0.7.2/lib/active_record/attribute_methods/write.rb:50:in `write_attribute_with_type_cast'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/activerecord-5.0.7.2/lib/active_record/attribute_methods/write.rb:32:in `write_attribute'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/activerecord-5.0.7.2/lib/active_record/attribute_methods.rb:361:in `[]='
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/activerecord-5.0.7.2/lib/active_record/associations/belongs_to_association.rb:76:in `replace_keys'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/activerecord-5.0.7.2/lib/active_record/associations/belongs_to_association.rb:14:in `replace'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/activerecord-5.0.7.2/lib/active_record/associations/singular_association.rb:22:in `writer'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/activerecord-5.0.7.2/lib/active_record/associations/builder/association.rb:119:in `zone='
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/attribute_assigner.rb:16:in `public_send'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/attribute_assigner.rb:16:in `block (2 levels) in object'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/attribute_assigner.rb:15:in `each'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/attribute_assigner.rb:15:in `block in object'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/attribute_assigner.rb:14:in `tap'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/attribute_assigner.rb:14:in `object'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/evaluation.rb:13:in `object'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/strategy/create.rb:9:in `result'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/factory.rb:43:in `run'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/factory_runner.rb:29:in `block in run'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/activesupport-5.0.7.2/lib/active_support/notifications.rb:166:in `instrument'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/factory_runner.rb:28:in `run'
     # /Users/joerafaniello/.gem/ruby/2.4.5/gems/factory_bot-4.11.1/lib/factory_bot/strategy_syntax_method_registrar.rb:20:in `block in define_singular_strategy_method'
     # ./spec/support/missing_factory_helper.rb:10:in `create'
     # ./spec/models/service_template_provision_task_spec.rb:83:in `block (5 levels) in <top (required)>'

Finished in 7.47 seconds (files took 12.85 seconds to load)
28 examples, 4 failures

Failed examples:

rspec ./spec/models/service_template_provision_task_spec.rb:90 # ServiceTemplateProvisionTask with multiple tasks #deliver_to_automate when the state is not active delivers to the queue
rspec ./spec/models/service_template_provision_task_spec.rb:117 # ServiceTemplateProvisionTask with multiple tasks #deliver_to_automate when the state is not active sets queue item to zone specified in dialog
rspec ./spec/models/service_template_provision_task_spec.rb:124 # ServiceTemplateProvisionTask with multiple tasks #deliver_to_automate when the state is not active sets queue item to zone specified in service template without dialog
rspec ./spec/models/service_template_provision_task_spec.rb:129 # ServiceTemplateProvisionTask with multiple tasks #deliver_to_automate when the state is not active sets queue item to server's zone if not specified in dialog and service template

Copy link
Member

Choose a reason for hiding this comment

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

cc @lfu

Copy link
Member

Choose a reason for hiding this comment

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

@jrafanie I think this was added in ManageIQ/manageiq-schema#358. right?

Copy link
Member

Choose a reason for hiding this comment

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

Let me look at my environment... 🏃

Copy link
Member

Choose a reason for hiding this comment

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

My bad. I ran it on my rails-5-1 branch with a vendored manageiq-schema and then on master but must have only run the test:vmdb:setup on the rails-5-1 branch.

@lfu
Copy link
Member Author

lfu commented Apr 29, 2019

@miq-bot add_label hammer/no

@lfu lfu deleted the add_zone_to_service_1415106 branch November 4, 2019 15:23
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.

7 participants