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

Update provider_region to nil for Google provider #184

Merged
merged 4 commits into from
Apr 10, 2018

Conversation

ZitaNemeckova
Copy link
Contributor

@ZitaNemeckova ZitaNemeckova commented Apr 5, 2018

Fixes UI failure after ManageIQ/manageiq-providers-google#52 .
To reproduce:
Make sure you have ManageIQ::Providers::Google::CloudManager or ManageIQ::Providers::Google::NetworkManager with provider_region not set to nil.
Go to summary page of said provider.
Before:
image
After:
image

With both providers not having description method but having historically set provider_region following lines are problem solved by removing values from provider_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

@miq-bot miq-bot changed the title Update provider_region to nil for Google provider [WIP] Update provider_region to nil for Google provider Apr 5, 2018
@ZitaNemeckova ZitaNemeckova force-pushed the update_provider_region branch 2 times, most recently from be8a807 to 0d33413 Compare April 6, 2018 08:57
@ZitaNemeckova ZitaNemeckova force-pushed the update_provider_region branch 2 times, most recently from eeedc8e to aa80005 Compare April 6, 2018 09:18
@ZitaNemeckova
Copy link
Contributor Author

@miq-bot remove_label wip

@miq-bot miq-bot changed the title [WIP] Update provider_region to nil for Google provider Update provider_region to nil for Google provider Apr 6, 2018
@miq-bot miq-bot removed the wip label Apr 6, 2018
Copy link
Contributor

@lpichler lpichler left a 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|
Copy link
Contributor

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)

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

@ZitaNemeckova

  • I would join your its to one it with expect( because it would be nice to keep one it 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 the it and remove before block.

What do you think about this suggestions ?

Copy link
Member

@tumido tumido left a 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',
Copy link
Member

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

Copy link
Contributor

@lpichler lpichler left a comment

Choose a reason for hiding this comment

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

Thanks @ZitaNemeckova !

@h-kataria
Copy link
Contributor

@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.

@lpichler
Copy link
Contributor

lpichler commented Apr 6, 2018

@miq-bot assign @Fryguy

@tumido
Copy link
Member

tumido commented Apr 6, 2018

@h-kataria, I don't think it changes the schema, only data for one (or two possibly) specific emses

@ZitaNemeckova, I wonder, is this change needed only for Google::CloudManager? Don't we need this for Google::NetworkManager manager as well?

…nager as well

Added it to migration and specs
@miq-bot
Copy link
Member

miq-bot commented Apr 9, 2018

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
2 files checked, 2 offenses detected

db/migrate/20180405145642_remove_provider_region_for_google_provider.rb

Copy link
Member

@tumido tumido left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@h-kataria
Copy link
Contributor

@Fryguy @gtanzillo please review/merge

@gtanzillo
Copy link
Member

@Fryguy You ok with merging this one?

@Fryguy
Copy link
Member

Fryguy commented Apr 10, 2018

Are you expecting this to be backported? We can't backport migrations.

@ZitaNemeckova
Copy link
Contributor Author

No, Gaprindashvili will be fixed by UI workaround.

@h-kataria
Copy link
Contributor

@Fryguy UI PR with workaround for G branch ManageIQ/manageiq-ui-classic#3735

Copy link
Member

@Fryguy Fryguy left a 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?

@Fryguy
Copy link
Member

Fryguy commented Apr 10, 2018

And there's the answer...thanks GitHub for not refreshing ;)

@Fryguy Fryguy merged commit f49d5d5 into ManageIQ:master Apr 10, 2018
@Fryguy Fryguy added this to the Sprint 84 Ending Apr 23, 2018 milestone Apr 10, 2018
@Fryguy Fryguy removed the blocker label Apr 10, 2018
@ZitaNemeckova ZitaNemeckova deleted the update_provider_region branch November 14, 2019 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants