-
Notifications
You must be signed in to change notification settings - Fork 897
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
Conversation
a208cc8
to
5581341
Compare
5581341
to
a8c7f1b
Compare
c1d2e92
to
73287b1
Compare
c9a9805
to
48557e9
Compare
48557e9
to
156eda5
Compare
Checked commit lfu@156eda5 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@lfu any UI plan for this? How do you specify which zone a Service catalog item dialog will run in? |
@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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @lfu
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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... 🏃
There was a problem hiding this comment.
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.
@miq-bot add_label hammer/no |
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:
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