Project

General

Profile

Bug #8052

Smart class parameters with ERB snippets are broken for other that String types

Added by Petr Chalupa almost 4 years ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Smart Variables
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Smart class parameters currently have broken validation and type-casting when used with ERB snippets. It tries to validate the value with the ERB without evaluation when key is being saved. It was hacked around it in Staypuft. How to fix it: Validation and type-casting has to be done on classification when ERB can be evaluated; SafeRender needs to be aware of the ERB parameters, they need to be validated and properly type-casted based on the given KeyValue (this association is missing currently).

The hack for Staypuft is in this file https://github.com/theforeman/staypuft/blob/master/app/models/staypuft/concerns/lookup_key_extensions.rb


Related issues

Related to Foreman - Refactor #9142: Unify validate_regexp and validate_list for lookup value/keyDuplicate2015-01-28
Related to Foreman - Bug #10088: Smart class default parameter interpreted as stringNew2015-04-08
Related to Foreman - Bug #9673: YAML type casting fails for lookup values in 1.7.3Closed2015-03-06
Related to Foreman - Bug #9787: Default values of smart class parameters can't be JSON or YAMLClosed2015-03-16
Blocked by Foreman - Bug #9044: Tests can fail randomly on mac.succClosed2015-01-20

Associated revisions

Revision f8a56f5b (diff)
Added by Marek Hulán over 3 years ago

Fixes #8052 - allows erb in array and hash params

Revision 0f203546 (diff)
Added by Marek Hulán over 3 years ago

Fixes #8052 - allows erb in array and hash params

(cherry picked from commit f8a56f5bd809305080e4ba69113f73f65957a3f9)

History

#1 Updated by Dominic Cleal almost 4 years ago

  • Category set to Smart Variables
  • Priority changed from High to Normal

#2 Updated by Marek Hulán over 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Marek Hulán

#3 Updated by The Foreman Bot over 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2080 added
  • Pull request deleted ()

#4 Updated by Ivan Necas over 3 years ago

  • Bugzilla link set to 1183643

#5 Updated by Dominic Cleal over 3 years ago

  • Blocked by Bug #9044: Tests can fail randomly on mac.succ added

#6 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 32

#7 Updated by Dominic Cleal over 3 years ago

  • Related to Refactor #9142: Unify validate_regexp and validate_list for lookup value/key added

#8 Updated by Marek Hulán over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#9 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #10088: Smart class default parameter interpreted as string added

#10 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #9673: YAML type casting fails for lookup values in 1.7.3 added

#11 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #9787: Default values of smart class parameters can't be JSON or YAML added

Also available in: Atom PDF