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

Fixed expression evaluation for custom button in CustomActionMixin #16770

Conversation

yrudman
Copy link
Contributor

@yrudman yrudman commented Jan 8, 2018

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1505988

MiqExpressions for Custom Action defined on Service class are built based on Service model. MiqExpressions for Custom Action defined on ServiceTemplate are built based on ServiceTemplate model.
Before:
CustomActionMixin did not have ability to evaluate actions defined on template or class differently. Expression were evaluated in the same way using instance of ServcieTemplate, regardless where button come from - ServcieTemplateor Service class.
As a result, evaluating expression for custom action defined on Service class was throwing error: NoMethodError: undefined method vms' for #ServiceTemplate:0x007fd4b6f74490`
before

After:
Use different object for expression evaluation: instance of Service for actions defined on Service and instance of ServiceTemplate for action defined on ServicesTemplate`
after

@miq-bit add-label bug, core

\cc @lpichler @gtanzillo

@miq-bot miq-bot added the wip label Jan 8, 2018
@yrudman yrudman force-pushed the fixed-expression-evaluation-for-custom-button branch 5 times, most recently from 65b2c8c to 5bbcb20 Compare January 10, 2018 15:13
@lpichler
Copy link
Contributor

@miq-bot assign @lpichler

@yrudman yrudman force-pushed the fixed-expression-evaluation-for-custom-button branch 2 times, most recently from a546420 to f55f588 Compare January 13, 2018 00:05
@yrudman yrudman changed the title [WIP] Fixed expression evaluation for custom button in CustomActionMixin Fixed expression evaluation for custom button in CustomActionMixin Jan 13, 2018
@miq-bot miq-bot removed the wip label Jan 13, 2018
@yrudman
Copy link
Contributor Author

yrudman commented Jan 15, 2018

@miq-bot add_label gaprindashvili/yes

@yrudman yrudman force-pushed the fixed-expression-evaluation-for-custom-button branch from f55f588 to a9a8d4f Compare January 15, 2018 19:29
@miq-bot
Copy link
Member

miq-bot commented Jan 15, 2018

Checked commits yrudman/manageiq@d2716e0~...a9a8d4f with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. 🍪

@gtanzillo gtanzillo added this to the Sprint 78 Ending Jan 29, 2018 milestone Jan 16, 2018
@gtanzillo gtanzillo merged commit 091a546 into ManageIQ:master Jan 16, 2018
simaishi pushed a commit that referenced this pull request Jan 16, 2018
…r-custom-button

Fixed expression evaluation for custom button in CustomActionMixin
(cherry picked from commit 091a546)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1535153
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 039ca823711668e7b2ee4a553ce7a8ae644b3924
Author: Gregg Tanzillo <gtanzill@redhat.com>
Date:   Tue Jan 16 11:02:35 2018 -0500

    Merge pull request #16770 from yrudman/fixed-expression-evaluation-for-custom-button
    
    Fixed expression evaluation for custom button in CustomActionMixin
    (cherry picked from commit 091a546d55791f20d037d2d948308dc556d39d77)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1535153

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.

5 participants