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

Migrate AnsibleTower ConfigurationManager to AutomationManager #13630

Merged
merged 3 commits into from
Jan 26, 2017

Conversation

jameswnl
Copy link
Contributor

search and replace, plus some new AutomationManagers.

@jameswnl
Copy link
Contributor Author

@miq-bot add_labels wip, providers/anisble_tower

@miq-bot
Copy link
Member

miq-bot commented Jan 23, 2017

@jameswnl Cannot apply the following label because they are not recognized: providers/anisble_tower

@miq-bot miq-bot added the wip label Jan 23, 2017
@jameswnl
Copy link
Contributor Author

@miq-bot add_label providers/ansible_tower

describe ManageIQ::Providers::AutomationManager do
let(:provider) { FactoryGirl.build(:provider) }
let(:automation_manager) { FactoryGirl.build(:automation_manager, :provider => provider) }
end
Copy link
Member

Choose a reason for hiding this comment

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

????

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chrisarcand Thanks, but this 🍖 is still very raw, not ready for consumption yet 😄. Way too many broken cases. Actively updated...

Copy link
Member

Choose a reason for hiding this comment

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

👍

🙏 Please squash your commits when it's ready, this is quite a many rough commits to follow in history later on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

☠️ Don't look further.... dangerous to your eyes...

@Fryguy Fryguy closed this Jan 24, 2017
@Fryguy Fryguy reopened this Jan 24, 2017
@jameswnl jameswnl force-pushed the automgr2 branch 4 times, most recently from 3779e60 to 5bc38aa Compare January 25, 2017 14:56
@miq-bot
Copy link
Member

miq-bot commented Jan 25, 2017

Some comments on commits jameswnl/manageiq@2f0ef1a~...af2c269

spec/models/manageiq/providers/ansible_tower/automation_manager/configuration_script_spec.rb

  • ⚠️ - 38 - Detected allow_any_instance_of. This RSpec method is highly discouraged, please only use when absolutely necessary.

spec/models/manageiq/providers/ansible_tower/automation_manager/job_spec.rb

  • ⚠️ - 50 - Detected allow_any_instance_of. This RSpec method is highly discouraged, please only use when absolutely necessary.
  • ⚠️ - 69 - Detected allow_any_instance_of. This RSpec method is highly discouraged, please only use when absolutely necessary.
  • ⚠️ - 98 - Detected allow_any_instance_of. This RSpec method is highly discouraged, please only use when absolutely necessary.

spec/models/manageiq/providers/ansible_tower/automation_manager/refresh_parser_spec.rb

  • ⚠️ - 22 - Detected allow_any_instance_of. This RSpec method is highly discouraged, please only use when absolutely necessary.

spec/models/service_ansible_tower_spec.rb

  • ⚠️ - 77 - Detected allow_any_instance_of. This RSpec method is highly discouraged, please only use when absolutely necessary.

spec/vcr_cassettes/manageiq/providers/ansible_tower/automation_manager/refresher.yml

  • 💣 💥 🔥 🚒 - 1018 - Detected cfme
  • 💣 💥 🔥 🚒 - 1404 - Detected cfme
  • 💣 💥 🔥 🚒 - 1466 - Detected cfme
  • 💣 💥 🔥 🚒 - 1474 - Detected cloudforms
  • 💣 💥 🔥 🚒 - 183 - Detected cfme
  • 💣 💥 🔥 🚒 - 2024 - Detected cfme
  • 💣 💥 🔥 🚒 - 2038 - Detected cfme
  • 💣 💥 🔥 🚒 - 2042 - Detected cfme
  • 💣 💥 🔥 🚒 - 2051 - Detected cloudforms
  • 💣 💥 🔥 🚒 - 2072 - Detected cfme
  • 💣 💥 🔥 🚒 - 2085 - Detected cfme
  • 💣 💥 🔥 🚒 - 2089 - Detected cfme
  • 💣 💥 🔥 🚒 - 2098 - Detected cloudforms
  • 💣 💥 🔥 🚒 - 2562 - Detected cfme
  • 💣 💥 🔥 🚒 - 2576 - Detected cfme
  • 💣 💥 🔥 🚒 - 2580 - Detected cfme
  • 💣 💥 🔥 🚒 - 2588 - Detected cloudforms
  • 💣 💥 🔥 🚒 - 353 - Detected cfme
  • 💣 💥 🔥 🚒 - 3680 - Detected cloudforms
  • 💣 💥 🔥 🚒 - 386 - Detected cfme
  • 💣 💥 🔥 🚒 - 4002 - Detected cfme
  • 💣 💥 🔥 🚒 - 419 - Detected cfme
  • 💣 💥 🔥 🚒 - 4193 - Detected cfme
  • 💣 💥 🔥 🚒 - 4218 - Detected cfme
  • 💣 💥 🔥 🚒 - 4220 - Detected cfme
  • 💣 💥 🔥 🚒 - 452 - Detected cfme
  • 💣 💥 🔥 🚒 - 4635 - Detected cfme
  • 💣 💥 🔥 🚒 - 4656 - Detected cfme
  • 💣 💥 🔥 🚒 - 4685 - Detected cfme
  • 💣 💥 🔥 🚒 - 4723 - Detected cfme
  • 💣 💥 🔥 🚒 - 4783 - Detected cfme
  • 💣 💥 🔥 🚒 - 4820 - Detected cfme
  • 💣 💥 🔥 🚒 - 484 - Detected cfme
  • 💣 💥 🔥 🚒 - 4881 - Detected cfme
  • 💣 💥 🔥 🚒 - 517 - Detected cfme
  • 💣 💥 🔥 🚒 - 551 - Detected cfme
  • 💣 💥 🔥 🚒 - 584 - Detected cfme
  • 💣 💥 🔥 🚒 - 617 - Detected cfme
  • 💣 💥 🔥 🚒 - 650 - Detected cfme
  • 💣 💥 🔥 🚒 - 684 - Detected cfme
  • 💣 💥 🔥 🚒 - 717 - Detected cfme
  • 💣 💥 🔥 🚒 - 750 - Detected cfme
  • 💣 💥 🔥 🚒 - 784 - Detected cfme
  • 💣 💥 🔥 🚒 - 818 - Detected cfme
  • 💣 💥 🔥 🚒 - 851 - Detected cfme
  • 💣 💥 🔥 🚒 - 884 - Detected cfme
  • 💣 💥 🔥 🚒 - 918 - Detected cfme
  • 💣 💥 🔥 🚒 - 951 - Detected cfme
  • 💣 💥 🔥 🚒 - 985 - Detected cfme

@miq-bot
Copy link
Member

miq-bot commented Jan 25, 2017

Checked commits jameswnl/manageiq@2f0ef1a~...af2c269 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
62 files checked, 17 offenses detected

app/models/manageiq/providers/ansible_tower/automation_manager/job.rb

app/models/manageiq/providers/ansible_tower/automation_manager/refresh_parser.rb

app/models/manageiq/providers/ansible_tower/automation_manager/refresher.rb

  • ❗ - Line 8, Col 13 - Style/CommentAnnotation - Annotation keywords like TODO should be all upper case, followed by a colon, and a space, then a note describing the problem.

spec/factories/ext_management_system.rb

spec/lib/miq_automation_engine/service_methods/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-playbook_spec.rb

  • ❗ - Line 1, Col 1 - Style/FileName - The name of this source file (miq_ae_service_manageiq-providers-ansible_tower-automation_manager-playbook_spec.rb) should use snake_case.

spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-configuration_script_spec.rb

  • ❗ - Line 1, Col 1 - Style/FileName - The name of this source file (miq_ae_service_manageiq-providers-ansible_tower-automation_manager-configuration_script_spec.rb) should use snake_case.

spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-configured_system_spec.rb

  • ❗ - Line 1, Col 1 - Style/FileName - The name of this source file (miq_ae_service_manageiq-providers-ansible_tower-automation_manager-configured_system_spec.rb) should use snake_case.

spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager_spec.rb

  • ❗ - Line 1, Col 1 - Style/FileName - The name of this source file (miq_ae_service_manageiq-providers-ansible_tower-automation_manager_spec.rb) should use snake_case.

spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-provider_spec.rb

  • ❗ - Line 1, Col 1 - Style/FileName - The name of this source file (miq_ae_service_manageiq-providers-ansible_tower-provider_spec.rb) should use snake_case.

spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-automation_manager-inventory_group_spec.rb

  • ❗ - Line 1, Col 1 - Style/FileName - The name of this source file (miq_ae_service_manageiq-providers-automation_manager-inventory_group_spec.rb) should use snake_case.

spec/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-automation_manager-inventory_root_group_spec.rb

  • ❗ - Line 1, Col 1 - Style/FileName - The name of this source file (miq_ae_service_manageiq-providers-automation_manager-inventory_root_group_spec.rb) should use snake_case.

spec/models/manageiq/providers/ansible_tower/automation_manager/refresh_parser_spec.rb

spec/models/manageiq/providers/ansible_tower/automation_manager/refresher_spec.rb

end

def self.settings_name
:ems_refresh_worker_ansible_tower_automation
Copy link
Member

Choose a reason for hiding this comment

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

This implies a Settings migration is needed, as well as a change to settings.yml

Copy link
Member

Choose a reason for hiding this comment

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

Follow up PR?

Copy link
Member

@Fryguy Fryguy Jan 25, 2017

Choose a reason for hiding this comment

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

Yeah, just to unblock others, but it must be the next PR so we don't forget. (Normally I'd say "heck no" 😉 )

has_many :configured_systems, :dependent => :destroy, :foreign_key => "manager_id"
has_many :configuration_profiles, :dependent => :destroy, :foreign_key => "manager_id"
has_many :configuration_scripts, :dependent => :destroy, :foreign_key => "manager_id"
has_many :inventory_groups, :dependent => :destroy, :foreign_key => "ems_id", :inverse_of => :manager
Copy link
Member

Choose a reason for hiding this comment

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

@bdunne Should this stay in ConfigurationManager? That is, would any config manager need it, and if not, why was it here in the base to begin with?

Copy link
Member

Choose a reason for hiding this comment

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

Let's put back in a follow up PR if necessary.

Copy link
Member

Choose a reason for hiding this comment

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

It was introduced for Ansible Tower with the thought that it would be reused in Foreman (but that hasn't been done yet).

Copy link
Member

Choose a reason for hiding this comment

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

OK

@@ -1448,13 +1448,13 @@
_("Provider")
# TRANSLATORS: en.yml key: dictionary.model.ManageIQ::Providers::BaseManager (plural form)
_("Providers")
# TRANSLATORS: en.yml key: dictionary.model.ManageIQ::Providers::AnsibleTower::ConfigurationManager
Copy link
Member

Choose a reason for hiding this comment

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

dictionary strings and .po/.pot files should not be in this PR. @mzazrivec will rebuild them for zanata afterwards.

@@ -14,13 +14,14 @@
- :sto
- :svc
- :vi
- ems-type:ansible_tower_configuration
- ems-type:ansible_tower_automation
Copy link
Member

Choose a reason for hiding this comment

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

Note to @simaishi for downstream.

@@ -110,7 +110,7 @@
:purge_window_size: 1000
:ems_refresh:
:capture_vm_created_on_date: false
:ansible_tower_configuration:
:ansible_tower_automation:
Copy link
Member

Choose a reason for hiding this comment

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

yeah, data migration is necessary for both of these changes to settings.yml

Copy link
Member

Choose a reason for hiding this comment

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

Follow up PR as above.

@@ -0,0 +1,5 @@
module MiqAeMethodService
class MiqAeServiceManageIQ_Providers_AnsibleTower_AutomationManager_Playbook <
MiqAeServiceConfigurationScriptPayload
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a fan of breaking the line...just keep it one line (We turned off the 120 char rule :P )

Copy link
Member

Choose a reason for hiding this comment

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

Also can be a separate PR.

ManageIQ::Providers::AnsibleTower::ConfigurationManager: Configuration Manager (Ansible Tower)
ManageIQ::Providers::AnsibleTower::ConfigurationManager::ConfigurationScript: Job Template (Ansible Tower)
ManageIQ::Providers::AnsibleTower::AutomationManager: Automation Manager (Ansible Tower)
ManageIQ::Providers::AnsibleTower::AutomationManager::ConfigurationScript: Job Template (Ansible Tower)
Copy link
Member

Choose a reason for hiding this comment

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

@mzazrivec Should these kinds of changes stay in this PR, or would you prefer they were generated by you separately?

@@ -15,7 +15,7 @@ title: Ansible Tower Providers
name: ConfigurationManagerForeman
Copy link
Member

Choose a reason for hiding this comment

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

o_O WAT @bdunne ??

Copy link
Member

Choose a reason for hiding this comment

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

o_O WAT is that??

Copy link
Member

Choose a reason for hiding this comment

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

Not letting it block this PR as this PR is blocking a bunch, but that looks like a bug.

"azure" => "Azure",
"azure_network" => "Azure Network",
"ec2" => "Amazon EC2",
"ec2_network" => "Amazon EC2 Network",
"ec2_ebs_storage" => "Amazon EBS",
"embedded_ansible_automation" => "Embedded Ansible Automation",
Copy link
Member

Choose a reason for hiding this comment

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

I really don't like the name having Automation at the end. @blomquisg Thoughts? I understand it's because of the multiple manager thing, but it feels gross. Even so, it should not hold up this PR.

Copy link
Member

Choose a reason for hiding this comment

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

Ansible Inside?

Copy link
Member

Choose a reason for hiding this comment

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

I really don't like that name, but that's could just be me 😄

Copy link
Member

Choose a reason for hiding this comment

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

Who would be the consumer of this name?

Copy link
Member

Choose a reason for hiding this comment

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

I guess technically no one on the end, but it might show up as a "provider type" in a summary screen or something.

It's not in this PR, but at some point, we will have to exclude it from the supported_emses list so they don't appear in the "create provider" screens. Perhaps we do that with permissions.yml...haven't quite decided yet.

Copy link
Member

Choose a reason for hiding this comment

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

embedded_ansible seems fine to me. We should change it to that in a follow up PR.

It's a bit like ec2, where we have newer managers that were added later for network and ebs (which really should be "storage"). We could start with a baseline embedded_ansible, then tack on new managers if they ever pop up.

@Fryguy Fryguy changed the title [WIP] Migrate AnsibleTower ConfigurationManager to AutomationManager Migrate AnsibleTower ConfigurationManager to AutomationManager Jan 25, 2017
@Fryguy Fryguy removed the wip label Jan 25, 2017
@Fryguy
Copy link
Member

Fryguy commented Jan 25, 2017

I unWIPed this PR, because I think it's ready, but I am not comfortable merging until at least these changes are made to the UI: https://github.com/ManageIQ/manageiq-ui-classic/search?utf8=%E2%9C%93&q=AnsibleTower%3A%3AConfigurationManager

Otherwise we insta-break the UI, which is unfair to them as they are busted across the board. I am not sure this will affect the service UI at all, but I don't think it will.

@blomquisg
Copy link
Member

Fixes ManageIQ/manageiq-ui-classic#248

@blomquisg blomquisg merged commit 4012200 into ManageIQ:master Jan 26, 2017
@blomquisg blomquisg added this to the Sprint 53 Ending Jan 30, 2017 milestone Jan 26, 2017
@bdunne
Copy link
Member

bdunne commented Jan 30, 2017

Where are the associated data migrations? I don't see anything in this PR updating the :type column for all of the STI records. Is that on the to-do list @jameswnl ?

@jameswnl jameswnl deleted the automgr2 branch January 30, 2017 23:13
@jameswnl
Copy link
Contributor Author

@bdunne yes, there're 2 migrations pending, 1 for the STI records and 1 for the settings.

@bdunne
Copy link
Member

bdunne commented Jan 31, 2017

@jameswnl Is there a PR for them? I can't use my master database at the moment.

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