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

Integrate with external Tower Workflow #17440

Merged
merged 1 commit into from
Jun 7, 2018
Merged

Conversation

jameswnl
Copy link
Contributor

@jameswnl jameswnl commented May 18, 2018

@jameswnl
Copy link
Contributor Author

@Fryguy can you take a look? Some modeling work here and so would like to gather feedback early on. thanks

Copy link
Contributor

@Ladas Ladas left a comment

Choose a reason for hiding this comment

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

👍 looks great

@jameswnl jameswnl force-pushed the workflow branch 5 times, most recently from ff91490 to b49f6c8 Compare June 1, 2018 19:31

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 :workflows, :dependent => :destroy, :foreign_key => "manager_id"
has_many :workflow_nodes, :dependent => :destroy, :foreign_key => "manager_id"
Copy link
Member

Choose a reason for hiding this comment

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

I made this comment in the associated schema change, but I think these should be prefixed with configuration to make sure we know why the underlying tables exist.

I'm worried that just calling them workflow makes it look like we're introducing yet another state machine implementation. When in reality, this is inventory data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

def has_workflows(options = {})
has_inventory({
:model_class => ::Workflow,
:manager_ref => [:manager_ref],
Copy link
Member

Choose a reason for hiding this comment

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

Do you have a good idea of what's going to be used for the manager_ref?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the native id in Tower for this workflow. We need this in order to ask Tower to execute a particular workflow.

@jameswnl jameswnl changed the title [WIP] Integrate with external Tower Workflow Integrate with external Tower Workflow Jun 4, 2018
@jameswnl
Copy link
Contributor Author

jameswnl commented Jun 4, 2018

@miq-bot remove_label wip
@miq-bot add_labels enhancement, providers/ansible_tower

@@ -7,10 +7,12 @@ class ManageIQ::Providers::AutomationManager < ManageIQ::Providers::BaseManager
require_nested :InventoryGroup
require_nested :InventoryRootGroup
require_nested :OrchestrationStack
require_nested :ConfigurationWorkflow
Copy link
Member

Choose a reason for hiding this comment

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

Please sort alphabetically

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -5,4 +5,5 @@ class ManageIQ::Providers::ExternalAutomationManager < ManageIQ::Providers::Auto
require_nested :ConfigurationScriptSource
require_nested :ConfiguredSystem
require_nested :OrchestrationStack
require_nested :ConfigurationWorkflow
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -3,6 +3,16 @@ module ManagerRefresh::Inventory::AutomationManager
include ::ManagerRefresh::Inventory::Core

class_methods do
def has_automation_manager_configuration_workflows(options = {})
Copy link
Member

Choose a reason for hiding this comment

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

Can these be renamed as Rubocop suggested?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there are others, so I am not sure if we want to do this. Probably not this PR, even if we want to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @Ladas thinking about the naming about these has_*, are there meant to be a predicate? or they should be add_*?
That could be confusing rubocop...

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it's not a question (rubocop is wrong), so let's keep this consistent. FYI @slemrmartin is redoing the interface, so it will not look like this at all

@miq-bot
Copy link
Member

miq-bot commented Jun 7, 2018

Checked commit jameswnl@dd1215d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
12 files checked, 2 offenses detected

app/models/manager_refresh/inventory/automation_manager.rb

  • ❗ - Line 36, Col 9 - Naming/PredicateName - Rename has_automation_manager_configuration_workflows to automation_manager_configuration_workflows?.

app/models/manager_refresh/inventory/core.rb

@bdunne bdunne merged commit 5e454cb into ManageIQ:master Jun 7, 2018
@bdunne bdunne self-assigned this Jun 7, 2018
@bdunne bdunne added this to the Sprint 88 Ending Jun 18, 2018 milestone Jun 7, 2018
@jameswnl jameswnl deleted the workflow branch June 8, 2018 15:57
slemrmartin added a commit to slemrmartin/manageiq that referenced this pull request Jun 12, 2018
agrare pushed a commit to ManageIQ/inventory_refresh that referenced this pull request Aug 28, 2018
agrare pushed a commit to ManageIQ/inventory_refresh that referenced this pull request Sep 5, 2018
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.

6 participants