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

Allow the suspension of cloud, infra and physical infra providers #4269

Merged
merged 9 commits into from
Jan 17, 2019

Conversation

skateman
Copy link
Member

@skateman skateman commented Jul 10, 2018

This is a followup on #4012 as @romanblanco is not available. Except of adding the necessary toolbar buttons, there are a few screens which display zones, these have been adjusted to not display the __maintenance__ zone.

Parent issue: ManageIQ/manageiq#17489
Depends on: ManageIQ/manageiq#17452
RFE BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1455145

@miq-bot add_label pending core
@miq-bot add_reviewer @slemrmartin

@miq-bot
Copy link
Member

miq-bot commented Jul 10, 2018

@skateman 'slemrmartin' is an invalid reviewer, ignoring...

@skateman skateman changed the title Allow the suspension of cloud, infra and physical infra providers [WIP] Allow the suspension of cloud, infra and physical infra providers Jul 11, 2018
@miq-bot miq-bot added the wip label Jul 11, 2018
@skateman skateman changed the title [WIP] Allow the suspension of cloud, infra and physical infra providers Allow the suspension of cloud, infra and physical infra providers Jul 13, 2018
@miq-bot miq-bot removed the wip label Jul 13, 2018
@miq-bot
Copy link
Member

miq-bot commented Oct 30, 2018

This pull request is not mergeable. Please rebase and repush.

@slemrmartin
Copy link
Contributor

slemrmartin commented Dec 19, 2018

@skateman Changes in core after this implementation:

  • ExtManagementSystem.backup_zone becomes ExtManagementSystem.zone_before_pause
  • Zone::MAINTENANCE_ZONE_NAME becomes MiqRegion.my_region.maintenance_zone.name

EDIT: use Zone.maintenance_zone.name instead, it's cached version of ^^

@skateman
Copy link
Member Author

@slemrmartin what about Zone.visible?

@slemrmartin
Copy link
Contributor

Zone.visible is available, but it's recommended not to make equal zone's visibility and Zone.maintenance_zone. Maintenance zone is only one of possible invisible zones.

@skateman skateman force-pushed the suspend-provider-zones branch 2 times, most recently from d10f34a to 6665066 Compare December 19, 2018 13:50
@skateman
Copy link
Member Author

@slemrmartin can you please test this if it does what you want? 😉

@skateman
Copy link
Member Author

@miq-bot rm_label pending core

@@ -146,7 +146,8 @@ def textual_security_groups
end

def textual_zone
{:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => @record.zone.name}
zone = @record.zone.visible? ? @record.zone : @record.backup_zone
Copy link
Member

@Fryguy Fryguy Dec 21, 2018

Choose a reason for hiding this comment

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

  1. This method is not called backup_zone anymore...I think it's zone_before_pause

  2. I feel like this section is wrong. This is showing the EMS as being in a zone that it's not really in, which can be confusing to end users as well as us trying to diagnose customer issues. IMO, we should just keep the original code and show that it's in the Maintenance Zone or wherever. Or, clarify it better with something like the following...

zone = @record.zone_before_pause? ? "#{@record.zone.name} (originally in #{@record.zone_before_pause.name})" : @record.zone.name

Copy link
Member

Choose a reason for hiding this comment

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

Same in the copy-paste areas below.

@Fryguy
Copy link
Member

Fryguy commented Dec 21, 2018

Most of this looks good to me, however I don't agree with some of the decisions on when to honor Zone#visible. See ManageIQ/manageiq#17489 (comment) for my entire opinion on the presentation of these.

@skateman skateman force-pushed the suspend-provider-zones branch 2 times, most recently from cce5ae7 to 4978042 Compare January 2, 2019 12:11
@slemrmartin
Copy link
Contributor

There is some problem I encountered only once - default zone had visible set to nil. But I cannot reproduce it, don't merge it now please

@@ -71,7 +71,12 @@ def textual_port
end

def textual_zone
{:label => _("Managed by Zone"), :icon => "pficon pficon-zone", :value => @record.zone.name}
zone = if @record.zone.visible?
Copy link
Contributor

Choose a reason for hiding this comment

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

if @record.zone.visible?
elsif @record.zone == Zone.maintenance_zone
end

is better, the same for other helpers below

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, what other cases can happen? Because this seems to me as fixing possible backend issues on the frontend 😞

Copy link
Contributor

@slemrmartin slemrmartin Jan 2, 2019

Choose a reason for hiding this comment

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

Your code doesn't cause error, but invisible zone won't have zone_before_pause relation set every time.

Current condition could confuse other developers that if zone.visible is false, then zone_before_pause is always there.

@martinpovolny
Copy link
Member

Ok, then just:

Please, move the duplicated textual summary code to a mixin.

@martinpovolny
Copy link
Member

Oh. Ok, you did that.

So how well is this one tested? Did you test this in the UI, @slemrmartin ?

@skateman
Copy link
Member Author

skateman commented Jan 8, 2019

@martinpovolny already done

@slemrmartin
Copy link
Contributor

slemrmartin commented Jan 9, 2019

So how well is this one tested? Did you test this in the UI, @slemrmartin ?

@martinpovolny not the last version, I'll do it asap

@skateman
Copy link
Member Author

@slemrmartin any update on this?

@slemrmartin
Copy link
Contributor

@slemrmartin any update on this?

Sorry I worked on another PR, I'll look after weekend

@slemrmartin
Copy link
Contributor

slemrmartin commented Jan 15, 2019

Generally it's working (tested on Amazon)

  • UI quadicon changed
  • workers are disabled
  • EMSes are moved to maintenance zone
  • alert is shown in provider/instance detail and cannot be dismissed.
  • new provider and server cannot be moved to Maintenance zone (not visible in select)

@skateman great job, only small changes needed:

  • when EMS paused, toolbar button "Refresh relationships and Power states" (in detail page) should be disabled.
  • On Configuration page, Zone.description is shown (nice name)
  • On provider detail page, Zone.name is shown (ugly name - __maintenance__cdbe9712-9e10-4796-8a04-fd0460312bce (originally in default)). @martinpovolny what about change it to Zone.description here too?
  • instance/vm toolbar doesn't change when provider is paused (although alert in instance detail is present). EDIT: alert in instances list is present, alert in instance detail is not present)

More comments in issue

Copy link
Contributor

@slemrmartin slemrmartin left a comment

Choose a reason for hiding this comment

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

👍
Additional functionalities will be done in next PR (described in related Issue)

@miq-bot
Copy link
Member

miq-bot commented Jan 15, 2019

Checked commits skateman/manageiq-ui-classic@7665ca6~...34d26d9 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
34 files checked, 13 offenses detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.6-compliant syntax, but you are running 2.3.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

app/helpers/application_helper/toolbar/ems_cloud_center.rb

app/helpers/application_helper/toolbar/ems_clouds_center.rb

app/helpers/application_helper/toolbar/ems_infra_center.rb

app/helpers/application_helper/toolbar/ems_infras_center.rb

app/helpers/application_helper/toolbar/ems_physical_infra_center.rb

app/helpers/application_helper/toolbar/ems_physical_infras_center.rb

@skateman
Copy link
Member Author

@martinpovolny coverage should be okay now 😉

@martinpovolny martinpovolny merged commit e44cf9a into ManageIQ:master Jan 17, 2019
@martinpovolny martinpovolny added this to the Sprint 103 Ending Jan 21, 2019 milestone Jan 17, 2019
@skateman skateman deleted the suspend-provider-zones branch January 17, 2019 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants