-
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
Enable custom actions for Vms API #14817
Conversation
Nice work @imtayadeway on the model side 🎵 I'll review shortly. |
3e95b04
to
663ce76
Compare
@imtayadeway Pulled down and it looks like everything necessary to render custom actions for vm details on the SUI is available. 💯 |
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 is looking great @imtayadeway a couple of questions/comments. Thanks !!
} | ||
expect(response.parsed_body).to include(expected) | ||
end | ||
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.
would you prefer to move these tests to custom_actions_spec.rb ? maybe some stuff can be DRYed up in future PRs between services and vms custom actions specs ?
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 might, but prefer to do that in a future PR. The current specs there are set up assuming that the service template is at the center of what's being tested, so would at least need to scope the existing tests in a new context. The resultant diff I thought would be unnecessarily large for this PR
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.
👍
spec/factories/custom_button_set.rb
Outdated
|
||
after(:create) do |custom_button_set, evaluator| | ||
custom_button_set.replace_children(evaluator.children) | ||
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.
why was this needed ?
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 thought it made these a bit nicer (rather than having to do the replace_children
after each one).
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.
ahh ok, and this does not affect current users of this Factory outside our API ?
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 will not, since currently setting :children
in this way would result in:
NoMethodError:
undefined method `children=' for #<CustomButtonSet:0x0055c0df9d1ca0>
Did you mean? children
child_rels
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.
@abellotti I guess it could be possible to build a custom button set, add children, then save. I'll change this to non-destructively shovel children on instead
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.
@abellotti updated in e3c785d
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.
😍
3a34604
to
ab015e0
Compare
CustomButton.buttons_for(self).select { |b| b.parent.nil? } | ||
end | ||
|
||
def generic_custom_buttons |
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.
@abellotti just updated with this to make the contract between this mixin and the host more explicit. It might be nice to add some lower-level tests for Vms now that this has been included - LMK if you'd rather I do that here or in a follow up. Thanks!
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 is fine. Thanks.
@imtayadeway I don't know if it is more suitable for this PR or a follow-up, but I am investigating a custom actions BZ and believe there is an error in From the SUI, we are using |
ab015e0
to
83e1b51
Compare
@miq-bot add-label wip |
83e1b51
to
e0daf3a
Compare
@abellotti marking this as WIP as it will need to be rebased onto #14845 (which I pulled out of this PR) |
This pull request is not mergeable. Please rebase and repush. |
e0daf3a
to
3c87bbe
Compare
@miq-bot rm-label wip |
|
||
def generic_button_group | ||
CustomButton.buttons_for("Service").select { |button| !button.parent.nil? } | ||
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.
shouldn't be defined here, just the one on line 48
3c87bbe
to
8318d5c
Compare
Checked commits imtayadeway/manageiq@01d1771~...8318d5c with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
Thanks @imtayadeway this is a great enhancement !! 🎵 |
@abellotti @gtanzillo do you feel comfortable labeling this |
@miq-bot add_label blocker |
Enable custom actions for Vms API (cherry picked from commit a1d985c) https://bugzilla.redhat.com/show_bug.cgi?id=1450502
Fine backport details:
|
As required by https://www.pivotaltracker.com/n/projects/1914499/stories/142774757
/cc @jjlangholtz
Haven't tested this extensively, just submitting for feedback. @jjlangholtz feel free to pull down and kick the wheels
@miq-bot add-label api, enhancement
@miq-bot assign @abellotti