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 MiqExpression evaluation on tagged Services #18020

Merged

Conversation

yrudman
Copy link
Contributor

@yrudman yrudman commented Sep 25, 2018

Before MiqExpression evaluating expression, it is trying to resolve referenced associations (if any).
It is done by compare passed reference to a run-time object.
If passed object's class not the same as passed reference than MiqExpression consider that passed reference is an association and trying to obtain associated object.

ISSUE: If reference passed to MiqExpression is "service" and run-time object when evaluating expression is class descendant from Service,( like ServiceContainerTemplate) than MiqExpression will try to substitute passed object by invoking service on passed object, which will return nil

FIX: Do not attempt to substitute original (runtime) object passed to MiqExpression if that object descendant from Service and reference passed to MiqExpression is "service"

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

@miq-bot add-label bug, blocker, gaprindashvili/yes

\cc @gtanzillo

@yrudman yrudman force-pushed the fixed-expression-with-tag-on-service branch 3 times, most recently from 60a6a73 to d9b67e6 Compare September 26, 2018 13:47
… instance of class descendent from Service passed: class descendent from Service has `service` method and string "service" passed to MiqExpression as reference, so MiqExpression trying to obtaine 'real' object using passed reference by invoking `service` method on instance of class descendent from Service, which is wrong. Passed object should not be subsrituted using reference if reference is "service" and object < ... < Service

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628727
…vice' and passed object is descendant from Service class
@yrudman yrudman force-pushed the fixed-expression-with-tag-on-service branch from d9b67e6 to 321c844 Compare September 26, 2018 13:52
@miq-bot
Copy link
Member

miq-bot commented Sep 26, 2018

Checked commits yrudman/manageiq@b74e3df~...321c844 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. ⭐

@yrudman yrudman changed the title [WIP] Fixed MiqExpression evaluation on tagged Service Fixed MiqExpression evaluation on tagged Services Sep 26, 2018
@miq-bot miq-bot removed the wip label Sep 26, 2018
@yrudman
Copy link
Contributor Author

yrudman commented Sep 26, 2018

@miq-bot add-label hammer/yes

@gtanzillo gtanzillo self-assigned this Sep 28, 2018
@gtanzillo gtanzillo added this to the Sprint 96 Ending Oct 8, 2018 milestone Oct 1, 2018
@gtanzillo gtanzillo merged commit d670fe8 into ManageIQ:master Oct 1, 2018
@yrudman yrudman deleted the fixed-expression-with-tag-on-service branch October 1, 2018 13:24
simaishi pushed a commit that referenced this pull request Oct 1, 2018
…ervice

Fixed MiqExpression evaluation on tagged Services

(cherry picked from commit d670fe8)

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

simaishi commented Oct 1, 2018

Hammer backport details:

$ git log -1
commit 5d30389b1fbda1627073b466f344eb3059d3dd1c
Author: Gregg Tanzillo <gtanzill@redhat.com>
Date:   Mon Oct 1 09:17:44 2018 -0400

    Merge pull request #18020 from yrudman/fixed-expression-with-tag-on-service
    
    Fixed MiqExpression evaluation on tagged Services
    
    (cherry picked from commit d670fe8fa67f1cd6acb1c3405016062592fbeb6d)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1628727

simaishi pushed a commit that referenced this pull request Nov 5, 2018
…ervice

Fixed MiqExpression evaluation on tagged Services

(cherry picked from commit d670fe8)

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

simaishi commented Nov 5, 2018

Gaprindashvili backport details:

$ git log -1
commit 31993846491a3e0000841a2994612f94ff43ba0b
Author: Gregg Tanzillo <gtanzill@redhat.com>
Date:   Mon Oct 1 09:17:44 2018 -0400

    Merge pull request #18020 from yrudman/fixed-expression-with-tag-on-service
    
    Fixed MiqExpression evaluation on tagged Services
    
    (cherry picked from commit d670fe8fa67f1cd6acb1c3405016062592fbeb6d)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1634809

nizaminabeel pushed a commit to nizaminabeel/manageiq that referenced this pull request Dec 11, 2018
…tag-on-service

Fixed MiqExpression evaluation on tagged Services

(cherry picked from commit d670fe8)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1634809
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.

4 participants