[PUP-8597] Modify rich data serialization to use shorter tags instead of __pcore_type__ Created: 2018/03/23  Updated: 2018/09/19  Resolved: 2018/09/17

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: PUP 6.0.0

Type: Improvement Priority: Normal
Reporter: Henrik Lindberg Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Template:
Epic Link: 6.y Rich Data
Sub-team: Language
Team: Platform Core
Sprint: Platform Core KANBAN
Release Notes: Deprecation
Release Notes Summary: The earlier experimental --rich_data format used the tags __pcore_type__ and __pcore_value__, these are now shortened to __ptype and __pvalue respectively. If you are using this experimental feature and have stored serializations you need to change them or write them again with the updated version.
QA Risk Assessment: Needs Assessment

 Description   

Serialization of rich data in JSON/YAML is currently using the tags:

__pcore_type__
__pcore_value__

Those are longer than they need to be for making them unique/non-clashing with normal attributes.

We should shorten those to:

__ptype
__pvalue

When writing, but continue to support the longer tags when reading.



 Comments   
Comment by Rick Sherman [ 2018/03/28 ]

Heads up Thomas Honey and William Meek - this will affect our YANG modules.  If we want to support earlier versions of Puppet I suppose we'll have to support both names.

cc Davin Hanlon

lib/puppet/provider/ietf_interfaces/netconf.rb
86:              if pcore.respond_to? :_pcore_type
92:          elsif @property_hash[puppet_name.to_sym].respond_to? :_pcore_type
 
lib/puppet/provider/yang_ietf.rb
117:      if k._pcore_type.instance_of? Puppet::Pops::Types::PObjectType
130:          elsif k.instance_variable_get(i).respond_to? :_pcore_type
137:              if k._pcore_type[i.to_s.tr('@','')].type.type.name == "Vanilla_ice::YangEmpty"

Comment by Henrik Lindberg [ 2018/03/28 ]

Rick Sherman That code is not affected, that is the Pcore API - the change is just for the human readable serialization format where the tags before the change were _pcore_type and pcore_value_ - i.e. not the _pcore_type method on an object that returns its type.

You would only have to change if you are reading or writing serializations of puppet objects using the human readable JSON serializer. Do you?

Comment by Thomas Hallgren [ 2018/05/28 ]

Merged to master at e3723a0.

Comment by Josh Cooper [ 2018/07/31 ]

Henrik Lindberg, Thomas Hallgren can you point me to the schema that describes the current pcore serialization format? /cc Rob Browning

Comment by Josh Cooper [ 2018/08/03 ]

Davin Hanlon, Rick Sherman will this change break YANG modules? Do you know if there is a specification for pcore format?

Comment by Davin Hanlon [ 2018/08/06 ]

Josh Cooper - from Rick Sherman's earlier comment it looks like it will. However, the YANG modules are not released, so we can make changes before we release them to account for this. Does that seem OK Rick Sherman Thomas Honey?

Comment by Rick Sherman [ 2018/08/06 ]

We should be okay.  Those modules are still unreleased and we can update them if needed.

Comment by Josh Cooper [ 2018/08/06 ]

Thanks all. Is there a specification for the serialization format?

Comment by Thomas Hallgren [ 2018/08/16 ]

Josh Cooper, I don't think any formal specification has been written yet. I created ticket PUP-9070.

Comment by Scott Garman [ 2018/09/17 ]

Since we had a green run of CI puppet-agent 6.0.0 last night, I'm bulk-changing these issues from Ready for CI -> Resolved in preparation of the release.

Generated at Thu Jun 27 05:14:20 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.