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

[EUWE] Suppots dots in custom attributes #14363

Merged
merged 6 commits into from
Mar 20, 2017

Conversation

lpichler
Copy link
Contributor

temporarily replacing #11112
fixes #10482 point 1
Using URI::RFC2396_Parser from #13713 - thanks! @gtanzillo @cben @zeari

@miq-bot add_label euwe/yes, bug, reporting

cc @simon3z

please review @cben @zeari

@miq-bot assign @gtanzillo

I have explanation in commit messages.
tested:

  • creating/updating UI reports with these attributes
  • using filtering with MiqExpression with virtual custom attributes in report

Links [Optional]

special characters in custom attributes
Field with virtual custom attributes  don’t contains associations so it don’t contain “.” as separator

it has always form:

<Model>-virtual_custom_attribute_<name_of_attribute>

After this  we need to escape it back because there was dynamic method created with unescaped form,
and such method will be called in evaluation.
before:
ns= ‘/virtual/parent_resource_pool/name’
predicate = ns.split("/")
=> ["", "virtual", "parent_resource_pool", "name"]
predicate = ns.split(“/“)[2..-1] # throw away /virtual
=> ["parent_resource_pool", "name"]

after: (same)
ns= ‘/virtual/parent_resource_pool/name’
ns.gsub!("/virtual/","")  # throw away /virtual
=> ‘parent_resource_pool/name’
predicate = ns.split("/")
=> ["parent_resource_pool", "name"]
…acters

now there is allowed to have special characters as `-` and `.` `/`
@miq-bot
Copy link
Member

miq-bot commented Mar 16, 2017

Checked commits lpichler/manageiq@dd5aa33~...c5bf37f with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
5 files checked, 6 offenses detected

app/models/miq_report.rb

lib/extensions/ar_taggable.rb

lib/miq_expression.rb

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@simon3z
Copy link
Contributor

simon3z commented Mar 18, 2017

@zeari @cben please review and approve if this works for us.

@simaishi simaishi merged commit b07bd16 into ManageIQ:euwe Mar 20, 2017
@simaishi simaishi added this to the Sprint 57 Ending Mar 27, 2017 milestone Mar 20, 2017
@simaishi simaishi removed the euwe/yes label Mar 20, 2017
@lpichler lpichler deleted the suppots_dots_in_custom_attributes branch March 20, 2017 13:53
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