-
Notifications
You must be signed in to change notification settings - Fork 125
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
Ensure EMS relationships are established #103
Conversation
The migrations will need a stub with a copy of the ensure_managers method. As migrations are a point-in-time snapshot, we cannot have changes to the underlying ensure_managers method from affecting old migrations. Thus, we need a copy. |
@@ -0,0 +1,5 @@ | |||
class EnsureCloudManagers < ActiveRecord::Migration[5.0] | |||
def change |
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 needs to be up, because it is not a reversible operation.
@djberg96 - bump ^^ |
@Fryguy I don't know if I did it the "expected" way, but please take a look and see what you think. I can squash the commits if you're happy with it. |
all data migrations require specs as well. I think this is passing by virtue of it not doing anything (i.e. there is no data in the database, so when it queries it has no data). |
|
||
class ManageIQ | ||
class Providers | ||
class CloudManager < BaseManager |
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 should be modifying the stub model created above.
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 Sorry, I don't follow.
class EnsureCloudManagers < ActiveRecord::Migration[5.0] | ||
class ExtManagementSystem < ActiveRecord::Base; end | ||
class BaseManager < ExtManagementSystem; end | ||
class Settings < ActiveRecord::Base; end |
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.
I don;t know why Settings is needed...Settings is not even an ActiveRecord model in the manageiq app.
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.
Settings (originally referenced as ::Settings
) is referred to within the ensure_managers
method. I've modified it so that it's not a subclass of AR any more.
@@ -0,0 +1,47 @@ | |||
class EnsureCloudManagers < ActiveRecord::Migration[5.0] | |||
class ExtManagementSystem < ActiveRecord::Base; end |
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 needs the
self.inheritance_column = :_type_disabled # disable STI
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.
Done.
Checked commits https://github.com/djberg96/manageiq-schema/compare/ac5aa05ea0beae70bb680617f3f4af576319ff2d~...361226b3bbc516c599ae97009b12cb6c2834c337 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 db/migrate/20171023170841_ensure_cloud_managers.rb
|
Replaced by #117 |
This pull request is not mergeable. Please rebase and repush. |
This addresses an issue, originally on the Amazon provider side, where the EMS relationships were not established when a StorageManager was added.
Originally brought to our attention via https://bugzilla.redhat.com/show_bug.cgi?id=1480629, but 5.7 -> 5.8 will be handled with a
self.seed
method.