-
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
Update provider_region to nil for Google provider #184
Conversation
be8a807
to
0d33413
Compare
eeedc8e
to
aa80005
Compare
@miq-bot remove_label wip |
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.
looks good but I left here some suggestions ⬆️
|
||
def up | ||
say_with_time("Removing provider_region from ManageIQ::Providers::Google::CloudManager") do | ||
ExtManagementSystem.where(:type => 'ManageIQ::Providers::Google::CloudManager').each do |provider| |
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.
@ZitaNemeckova
I think that we do it in one query.
ExtManagementSystem.where(:type => 'ManageIQ::Providers::Google::CloudManager').update_all(:provider_region => nil)
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.
@lpichler I did but miq-bot complained about update_all
. I don't mind changing it back if miq-bot's complain isn't important.
ems_stub.create!(:type => 'ManageIQ::Providers::Vmware::CloudManager', | ||
:provider_region => 42) | ||
|
||
migrate |
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 would join your
its
to one it withexpect(
because it would be nice to keep oneit
case for one migrating process and adapt 'it' message. -
I would also prefer creating object in lets although it is not needed in this case if there will be only one it.
-
move
migrate
command to theit
and remove before block.
What do you think about this suggestions ?
55ed535
to
2dce0a3
Compare
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.
Looks good 👍
Just a note for other reviewers, this bug was introduced by me in a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1433062
The resolution described there explains why such change is necessary and also why here's no down
migration present.
migration_context :up do | ||
let(:ems_stub) { migration_stub :ExtManagementSystem } | ||
|
||
ems_stub.create!(:type => 'ManageIQ::Providers::Google::CloudManager', |
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.
Please wrap these calls into before
block
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.
Thanks @ZitaNemeckova !
2dce0a3
to
95e879c
Compare
95e879c
to
6ec0ed8
Compare
@ZitaNemeckova just a note: this PR contains changes to schema, so can not be backported to Gaprindashvili or Fine branches, will need a fix in the code to handle the issue on those branches. |
@h-kataria, I don't think it changes the schema, only data for one (or two possibly) specific @ZitaNemeckova, I wonder, is this change needed only for |
…nager as well Added it to migration and specs
Checked commits ZitaNemeckova/manageiq-schema@ad28f50~...5b0534d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 db/migrate/20180405145642_remove_provider_region_for_google_provider.rb
|
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.
LGTM 👍
@Fryguy @gtanzillo please review/merge |
@Fryguy You ok with merging this one? |
Are you expecting this to be backported? We can't backport migrations. |
No, Gaprindashvili will be fixed by UI workaround. |
@Fryguy UI PR with workaround for G branch ManageIQ/manageiq-ui-classic#3735 |
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.
Looks good, but need an answer re:backporting. Is ManageIQ/manageiq-ui-classic#3735 the alternative for gaprindashvili?
And there's the answer...thanks GitHub for not refreshing ;) |
Fixes UI failure after ManageIQ/manageiq-providers-google#52 .
To reproduce:
Make sure you have
ManageIQ::Providers::Google::CloudManager
orManageIQ::Providers::Google::NetworkManager
withprovider_region
not set tonil
.Go to summary page of said provider.
Before:
After:
With both providers not having
description
method but having historically setprovider_region
following lines are problem solved by removing values fromprovider_region
.https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/helpers/ems_cloud_helper/textual_summary.rb#L42
https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/helpers/ems_network_helper/textual_summary.rb#L40
@miq-bot add_label wip, bug, blocker
https://bugzilla.redhat.com/show_bug.cgi?id=1563600
Fix for Gaprindashvili: ManageIQ/manageiq-ui-classic#3735
More info