Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2019-10-21 Thread John Duarte (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 John Duarte updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-7675  
 
 
  Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
Change By: 
 John Duarte  
 
 
QA Risk Assessment: 
 Needs Assessment No Action  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.196773.1497894053000.9037.1571669341188%40Atlassian.JIRA.


Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2018-03-13 Thread Thomas Hallgren (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Thomas Hallgren commented on  PUP-7675  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
 Merged to 5.5.x at 4dd20f6.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2018-03-13 Thread Henrik Lindberg (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-7675  
 
 
  Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
Change By: 
 Henrik Lindberg  
 
 
Story Points: 
 2  
 
 
Sprint: 
 Platform Core KANBAN  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2018-03-13 Thread Henrik Lindberg (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg commented on  PUP-7675  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
 for docs - see the description  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2018-03-13 Thread Henrik Lindberg (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-7675  
 
 
  Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
Change By: 
 Henrik Lindberg  
 

  
 
 
 
 

 
 In order to  type-cast/transform  convert  values from hiera backends  to rich data values not directly representable in plain YAML/JSON , the {{lookup_options}} should be given a new key {{convert_to}} that accepts either a type name (for example {{ " Sensitive " }}), or an array of type name and arguments to the type's {{new}} function.This is of value as there is no way to represent certain data types directly in JSON, YAML, etc.and there is no way to have any logic post process a looked up value before it is assigned to a class parameter when using APL.   If a simple data type is used (for example {{Sensitive}}) it is expected that this type has a single argument constructor that accepts the looked up value and returns an instance of the specified data type. If the constructor is more complex and needs additional arguments, or where its single argument constructor is not appropriate for the use case, an array of typename + arguments is instead used. An example could be interpretation of a String in a particular format used to construct a time/date value.The type entry in lookup_options is a String with a valid Puppet Type System specification of a data type, thereby also adding type matching - since a `new` will check that what is produced is compliant with any type constraints expressed in the type. When implementing this, the Example - Making a value Sensitive  { code:yaml}mymodule::mykey: 42lookup_options:  mymodule::mykey:convert_to: "Sensitive" { lookup code } } function should have Example - turning a non Array value into  an  option to override/set the  array:  { { code:yaml}mymodule::mykey: 42lookup_options:  mymodule::mykey: convert_to :   - "Array"  - true{code } } lookup option.   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 

Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2018-03-13 Thread Henrik Lindberg (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-7675  
 
 
  Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
Change By: 
 Henrik Lindberg  
 
 
Component/s: 
 Language  
 
 
Component/s: 
 DOCS  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2018-03-13 Thread Henrik Lindberg (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-7675  
 
 
  Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
Change By: 
 Henrik Lindberg  
 
 
Release Notes Summary: 
 It is now possible to specify a type  cast  conversion  in the lookup options for hiera 5.This can be used to  transform/typecast  convert  values to a rich data type - for example making a value {{Sensitive}}, construct a {{Timestamp}} and other such values that cannot be directly represented in JSON or YAML.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2018-03-13 Thread Henrik Lindberg (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-7675  
 
 
  Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
Change By: 
 Henrik Lindberg  
 
 
Fix Version/s: 
 PUP 5.5.0  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2018-03-12 Thread Henrik Lindberg (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg commented on  PUP-7675  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
 Jacob Henner yes, all lookups, explicit or via APL will type convert if there is a lookup_option for the key being looked up. Users would not have to do anything except specifying the type conversion in the lookup_option. This will be enabled by default as the opt-in performed by adding the conversion to the lookup_options.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2018-03-12 Thread Henrik Lindberg (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-7675  
 
 
  Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
Change By: 
 Henrik Lindberg  
 

  
 
 
 
 

 
 With In order to type-cast/transform values from hiera backends,  the  addition of the  {{ Init\[T, arg, ...] lookup_options }}  data  should be given a new key {{convert_to}} that accepts either a  type  it is possible to formalize  name (for example {{Sensitive}}), or an array of type name  and  describe  arguments to the  type  casting of values 's {{new}} function .This  can be added to lookup_options to enable type casting. This  is of value as there is no way to represent certain data types directly in JSON, YAML, etc.  By adding the key {{data_type}} to lookup options, and setting either the desired type directly (for example {{Sensitive}}), or by setting it to an {{Init\[T, arg,...arg]}} enables type casts of the looked up data to be performed by lookup before the value is returned. If a simple data type is used (for example {{Sensitive}}) it is expected that this type has a single argument constructor that accepts the looked up value and returns an instance of the specified data type. If the constructor is more complex and needs additional arguments, or where its single argument constructor is not appropriate for the use case, an  {{Init\[T, args...]}}  array of typename + arguments  is instead used.  ( An example could be interpretation of a String in a particular format used to construct a time/date value ) .The  {{data_type}}  type  entry in lookup_options is a String with a valid Puppet Type System specification of a data type , thereby also adding type matching - since a `new` will check that what is produced is compliant with any type constraints expressed in the type . When implementing this, the {{lookup}} function should have an option to override/set the {{convert_to}} lookup option.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 

Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2018-03-11 Thread Jacob Henner (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jacob Henner commented on  PUP-7675  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Add the ability to typecast a key using lookup_options   
 

  
 
 
 
 

 
 Will type-casting be enabled by default during automatic class parameter lookup? This would help greatly with several use cases, especially for Sensitive values.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-7675) Add the ability to typecast a key using lookup_options

2017-06-19 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg created an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-7675 
 
 
 
  Add the ability to typecast a key using lookup_options  
 
 
 
 
 
 
 
 
 

Issue Type:
 
  New Feature 
 
 
 

Assignee:
 

 Unassigned 
 
 
 

Created:
 

 2017/06/19 10:40 AM 
 
 
 

Priority:
 
  Normal 
 
 
 

Reporter:
 
 Henrik Lindberg 
 
 
 
 
 
 
 
 
 
 
With the addition of the Init[T, arg, ...] data type it is possible to formalize and describe type casting of values. 
This can be added to lookup_options to enable type casting. This is of value as there is no way to represent certain data types directly in JSON, YAML, etc. By adding the key data_type to lookup options, and setting either the desired type directly (for example Sensitive), or by setting it to an Init[T, arg,...arg] enables type casts of the looked up data to be performed by lookup before the value is returned. 
If a simple data type is used (for example Sensitive) it is expected that this type has a single argument constructor that accepts the looked up value and returns an instance of the specified data type. If the constructor is more complex and needs additional arguments, or where its single argument constructor is not appropriate for the use case, an Init[T, args...] is instead used. (An example could be interpretation of a String in a particular format used to construct a time/date value). 
The data_type entry in lookup_options is a String with a valid Puppet Type System specification of a data type.