-
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
Fix Refresh Relationships and Power States button for VMs, Instances, Images #17863
Fix Refresh Relationships and Power States button for VMs, Instances, Images #17863
Conversation
@miq-bot add_label bug |
I also haven't found any BZ for exactly this problem. Do you think I should create the new one or can the problem be part of related BZ I have mentioned in the description of this PR (https://bugzilla.redhat.com/show_bug.cgi?id=1600678) ? It's about some not working toolbar buttons, generally. Thank you for any advice! :) |
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
@agrare the reason we see this issue is that now every button must have supports or the old validate.
@agrare right, then probably more places will be failing with missing validate/supports method :-) |
@Ladas yeah exactly what I'm worried about. For example will we get the same error for refresh_ems on an ExtManagementSystem? How about Host? |
@martinpovolny WDYT? These buttons aren't something that make sense for supports_feature_mixin IMO. |
@agrare I think for consistency, every button acts the same now. So I think the UI team is now hunting the actions not having support. |
Actually a good deal of buttons test for a particular feature. In many cases button "A" tests for feature "A". But generally buttons "B, C, D" can test for a feature "E". See here: https://github.com/ManageIQ/guides/blob/master/ui/toolbars.md This makes sense to me: a particular function requires existing support on the backend. From the UI perspective we would love to do this in a unified way. However in reality we have As @Ladas wrote:
Really we have BZs that are caused by inconsistencies in the behavior of button actions and are trying to unify and generalize the behavior. We believe that unification of the behavion not only leaves us with less code but gives us less buggy and easier to maintain codebase ;-) |
@agrare : To sum up: Is there any other feature that the UI can test for to see if refresh is supported? If so then we don't need this PR. Else we do need it. We need to know if refresh is supported. |
I'm still confused, are these buttons generic for all types of inventory or specific for VMs? If it is generic for all types then I don't know why we don't need to also add this to ExtManagementSystem, Host, anything that has Basically I'm confused why this is only being added to Vms. |
@agrare so the change is that @romanblanco refactored the button code, so that every action must have supports (or the old validate_something..), so we can do this checks in a consistent way. E.g. there was a 'supports' code for refresh, but it was as a hacky pieces of code scattered somewhere in controllers (and I think it always returned true, it was just hidden in some crazy conditions). That being said, I think we should have specs or something to check all buttons are working (e.g. all of them have supports/validate implemented), since it looks like we are discovering that manually now, @romanblanco @martinpovolny ? |
@Ladas the problem with this is we don't have a consistent list of all the supported features for each entities we test in the toolbar buttons. I can get a list of features and a list of toolbar buttons doing the test, but I don't know how they should respond. |
@romanblanco not sure I understand. There should be a way to write a spec for every button, that will catch bugs like in this PR? |
@romanblanco ah, I see what you're saying. I think it's ok if you'll test that everything is unsupported by default (except things like refresh that are supported by all providers). So we'll at least test that it won't explode. |
@hstastna is this still an problem? I wasn't able to reproduce...I added a provider and was able to refresh relationships & power states for a provider, vm, and a host without issue. |
@agrare Yes, it is still a problem. Did you follow my steps to reproduce in the description of the PR? The important detail here is that for VMs under Compute > Infra > VMs it works but in any other screen displaying VMs (nested list of VMs), it does not work. So it depends where you are, how did you display the list of VMs. |
@hstastna okay I still don't see this, but if we're seeing this on vms we'll eventually see it for the rest of the types so can you add A quick grep shows: |
@agrare Thank you, Adam. I will take a look and will add the line to the rest of models. But probably we will not need to add it to all of them you have mentioned. For example, when I try to refresh relationships of some provider, it works well. This is because not every action goes thru |
d1ca244
to
e73600d
Compare
@agrare The only place I've found where refresh does not work with this PR, is refresh of Hosts displayed thru Compute > Clouds > Host Aggregates > some host aggregate details page. But no error.. so there must be different problem. I will take a look more and will try to fix it. |
@agrare I think that this PR can be merged. The problem with refresh of Hosts displayed thru Compute > Clouds > Host Aggregates > some host aggregate details page is not a problem with refresh but any action in that page (tagging etc.). I would better fix this in a separate PR. |
I think this needs a rebase with current master - that should fix the travis failure |
2231676
to
d5b3c09
Compare
@hstastna you just need to |
d5b3c09
to
493d20f
Compare
Checked commits hstastna/manageiq@566fb1e~...493d20f with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Related BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1600678
Related UI PR: ManageIQ/manageiq-ui-classic#4301
There is a problem with Refresh Relationships and Power States button in all of the pages under Compute > Clouds and also Compute > Infra while trying to refresh relationships and power states of any VM, Instance or Image. It's because
validate_refresh_ems
method is called every time we try to refresh relationships and power states, but this method does not exist. Similar problem was recently withdestroy
action, this is the PR which fixed that: #17780Steps to reproduce: (one of possible scenarios)
=> refresh is not initiated, error:
Before:
After: