Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upConvert Automate Methods to new style using classes #8
Comments
mkanoor
self-assigned this
Dec 19, 2016
mkanoor
added
the
enhancement
label
Dec 19, 2016
mkanoor
referenced this issue
Dec 19, 2016
Closed
Convert Automate Methods to new style using classes #12038
pkomanek
referenced this issue
Jan 19, 2017
Merged
Refactoring update_serviceprovision_status method #19
pkomanek
referenced this issue
Feb 2, 2017
Closed
Refactoring ServiceTemplateProvisionRequestApproved method #31
pkomanek
referenced this issue
Feb 20, 2017
Merged
Refactoring cloud orchestration postreconfigure method #57
pkomanek
referenced this issue
Mar 1, 2017
Merged
Refactoring and fixing cloud/vm/provisioning/placement/best_fit_amazon method. #63
This was referenced Apr 10, 2017
miq-bot
added
the
stale
label
Dec 11, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
miq-bot
Dec 11, 2017
Member
This issue has been automatically marked as stale because it has not been updated for at least 6 months.
If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions!
|
This issue has been automatically marked as stale because it has not been updated for at least 6 months. If you can still reproduce this issue on the current release or on Thank you for all your contributions! |
gmcculloug
added
pinned
and removed
stale
labels
Dec 11, 2017
This was referenced Mar 6, 2018
pkomanek
referenced this issue
May 4, 2018
Merged
Refactoring cloud vm retirement openstack_pre_retirement method #286
This was referenced Jun 4, 2018
This was referenced Jun 12, 2018
pkomanek
referenced this issue
Jun 27, 2018
Closed
[WIP]Refactoring cloud vm retirement email vm_retirement_emails method #347
This was referenced Jul 10, 2018
pkomanek
referenced this issue
Sep 3, 2018
Open
[WIP]Refactoring cloud vm provisioning validate_request method #419
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mkanoor commentedDec 19, 2016
•
edited
Convert the Automate methods to new style using classes to facilitate testing outside the Automate Engine.
Notes:
This idea is borrowed from Python, which allows us to source in the file without executing any code. The if block gets executed only when we directly pass in the file to the ruby interpreter. When we test the method script we source in the file in the spec and then instantiate it for testing, it allows us to pass in a mock service for testing.
Good sample of a method
https://github.com/ManageIQ/manageiq-content/blob/master/content/automate/ManageIQ/Cloud/Orchestration/Operations/Methods.class/__methods__/available_availability_zones.rb
Good sample of a spec
https://github.com/ManageIQ/manageiq-content/blob/master/spec/content/automate/ManageIQ/Cloud/Orchestration/Operations/Methods.class/__methods__/available_availability_zones_spec.rb
In the spec the line
require_domain_file
loads the method file from the correct directory
The methods have been categorized based on different lifecycle's
ManageIQ/Cloud/Orchestration/Operations
ManageIQ/Cloud/Orchestration/Provisioning
ManageIQ/Cloud/Orchestration/Reconfiguration
ManageIQ/Cloud/Orchestration/Retirement
ManageIQ/Cloud/VM/Provisioning
ManageIQ/Cloud/VM/Retirement
ManageIQ/ConfigurationManagement/AnsibleTower/Operations
ManageIQ/ConfigurationManagement/AnsibleTower/Service/Provisioning
ManageIQ/Control/
ManageIQ/Deployment/ContainerProvider/System/
ManageIQ/Infrastructure/Cluster/Operations
ManageIQ/Infrastructure/Configured_System/Provisioning
ManageIQ/Infrastructure/Host/Operations
ManageIQ/Infrastructure/Host/Provisioning
ManageIQ/Infrastructure/VM/Migrate
ManageIQ/Infrastructure/VM/Operations
ManageIQ/Infrastructure/VM/Provisioning
ManageIQ/Infrastructure/VM/Reconfigure
ManageIQ/Infrastructure/VM/Retirement
ManageIQ/Service/Provisioning/
ManageIQ/Service/Retirement
ManageIQ/System