-
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
Support for copy and compare of automate class, instance and methods #73
Conversation
@@ -0,0 +1,87 @@ | |||
class MiqAeClassCompareFields |
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.
If these are specific to MiqAeClass, why not namespace them with MiqAeClass::CompareFields?
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.
@Fryguy
The Compare works with both MiqAeClass (AR) and MiqAeClassYaml (YAML). My goal is to switch MiqAeClass with MiqAeClassYaml down the road when we can have all AR functionality in the MiqAeClassYaml.
@mkanoor Before further reviewing, I wanted to take a step back. This seems like mostly copying of ActiveRecord objects. If so, why not use |
@Fryguy Some of the differences between clone and this copy is (2)The Copy functions can start at the Instance/Method Level and then copy the Instance/Method into a different domain. As part of instance/method copying the domain, namespace and class are created if they don't exit. (3) The Class Schema can drift over a period of time so a comparison of the schema is necessary before forcing a copy. |
@mkanoor Got it. |
@Fryguy |
end | ||
|
||
context "clone the class to a new domain" do | ||
before(:each) do |
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.
@mkanoor :each is the default so you do not need to specify it here. Applies to all the other specs in this PR as well.
Allows for copy of class, instances and methods across domains.
Checked commit mkanoor@bb3167d with rubocop 0.21.0 |
@Fryguy @gmcculloug |
@mkanoor Verified spec. |
Support for copy and compare of automate class, instance and methods
Provisioning - First and Last names are not required. (cherry picked from commit 67175793ffdefec56ae6ac4e7a91167a7828dd2d) https://bugzilla.redhat.com/show_bug.cgi?id=1455686
Provisioning - First and Last names are not required. (cherry picked from commit 67175793ffdefec56ae6ac4e7a91167a7828dd2d) https://bugzilla.redhat.com/show_bug.cgi?id=1455685
…-found Handle case where do_volume_creation_check gets a nil from Fog (cherry picked from commit 752420bc07b2b4f606be119656e2eccc4b297374) https://bugzilla.redhat.com/show_bug.cgi?id=1482170
…lume-not-found Handle case where do_volume_creation_check gets a nil from Fog (cherry picked from commit 752420bc07b2b4f606be119656e2eccc4b297374) https://bugzilla.redhat.com/show_bug.cgi?id=1482170
more core ext's on 4.1.0 update for update sake https://github.com/ManageIQ/more_core_extensions/compare/179bf40..e5b4501 - Added Ruby 2.7 support [[ManageIQ#79](ManageIQ/more_core_extensions#79)] - Added Process#pause, Process#resume, and Process#alive? [[ManageIQ#73](ManageIQ/more_core_extensions#73)] array added * `#compact_map` - Collect non-nil results from the block array added `#tabular_sort` - Sorts an Array of Hashes by specific columns hierarchy added `#descendant_get` - Returns the descendant with a given name the two breaking changes: - **BREAKING**: Moved Object#descendant_get to Class#descendant_get [[ManageIQ#75](ManageIQ/more_core_extensions#75)] - **BREAKING**: Removed deprecated Enumerable#stable_sort_by [[ManageIQ#76](ManageIQ/more_core_extensions#76)] a minor header output change was made that hasn't been released yet to make tableize more markdown compliant see ManageIQ/linux_admin#221
more core ext's on 4.1.0 update for update sake https://github.com/ManageIQ/more_core_extensions/compare/179bf40..e5b4501 - Added Ruby 2.7 support [[ManageIQ#79](ManageIQ/more_core_extensions#79)] - Added Process#pause, Process#resume, and Process#alive? [[ManageIQ#73](ManageIQ/more_core_extensions#73)] array added * `#compact_map` - Collect non-nil results from the block array added `#tabular_sort` - Sorts an Array of Hashes by specific columns hierarchy added `#descendant_get` - Returns the descendant with a given name the two breaking changes: - **BREAKING**: Moved Object#descendant_get to Class#descendant_get [[ManageIQ#75](ManageIQ/more_core_extensions#75)] - **BREAKING**: Removed deprecated Enumerable#stable_sort_by [[ManageIQ#76](ManageIQ/more_core_extensions#76)] a minor header output change was made that hasn't been released yet to make tableize more markdown compliant see ManageIQ/linux_admin#221
The UI needs backend support for copying classes, instances and methods from a readonly domain like ManageIQ to an editable customer domain. Before an instance can be copied we have to compare the class schema, before overlaying an instance or a method we need to compare the values and the scripts. Comparison is a precursor to copying the automation components.
The comparison functions can also be used to compare automation components stored in YAML when importing automation models.
The comparison functions return 3 status values
By default an instance can only be copied if the Class Schema is either CONGRUENT or COMPATIBLE. A user can still force a copy of instances with INCOMPATIBLE schemas but would have to edit the instance after it has been created.