[MAGNOLIA-7734] yaml export uses wrong format Created: 04/Mar/20  Updated: 25/Jun/20  Resolved: 25/Jun/20

Status: Closed
Project: Magnolia
Component/s: yaml
Affects Version/s: 6.1.4
Fix Version/s: None

Type: Bug Priority: High
Reporter: Antonio Tuor Assignee: Unassigned
Resolution: Obsolete Votes: 6
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File sample.png    
Issue Links:
relation
is related to MAGNOLIA-7652 OOME when exporting to YAML Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

The yaml export doesn't use quotion marks on the right side anymore. This affects the bootstrapping (importing) of those files to end up with wrong types, which may causes bugs e.g. in the format of jcrDeliveryEndpoints returning the wrong format.

This bug actually causes more work on producing bootstrapping sample for development for an enterprise customer of us.

How to reproduce

  1. Create a App via content-types that has multiple string properties and one of each type (e.g. double, long, boolean etc)
  2. Add an entry in the app with some special cases
    1. Add a string that contains only numbers
    2. Add a string that is `true` or `false`
    3. Add an empty string
    4. Add a string in double format e.g. `1.2`
  3. Check the jcr tree that the fields have the correct type
  4. Perform an yaml export of the above entry
  5. Add the entry as Bootstrap sample (maybe it alsow works with importing it directly)

Current behaviour

After importing the above node, the types are wrong since the yaml file does not contain the quotion marks anymore:

  • Empty String is converted to a contentNode
  • Number String is converted to a long
  • Double String is converted to a double
  • Boolean String is converted to a boolean

Expected behaviour

After importing the above node, the types should be the same as before:

  • Empty String should be a string
  • Number String should be a string
  • Double String should be a string
  • Boolean String should be a string

 

Probably reason for the bug

The reason may be that the exported yaml does not containt quotion marks on the right side anymore. Therefore the types may change during bootstrapping or exporting

 



 Comments   
Comment by Christopher Zimmermann [ 05/Mar/20 ]

Hi atuor thanks for the report. If you know off the top of your head - what version were you using where it quoted the values?

Comment by Antonio Tuor [ 05/Mar/20 ]

Hi @Christopher Zimmermann

We were using the version 5.7.4. Hope that helps

Comment by Antonio Tuor [ 05/Mar/20 ]

Another finding, Properties like `on` or `off` get converted to booleans => `on` gets to `true` and `off` gets converted to `false`

Comment by Richard Gange [ 09/Mar/20 ]

So I have tried:

  • 6.1.4 
  • 6.1.2 
  • 5.7.5 

That would lead me to believe that MAGNOLIA-7652 caused this issue. The only workaround that I can see at the moment is to manually add the quotes back in. 

Comment by Federico Grilli [ 16/Apr/20 ]

Seems to have been solved by MAGNOLIA-7720, which will be part of 6.1.6 and 6.2.1. I think the fix needs to be back ported to upcoming Magnolia 5.7.7. Will double check.
5.7.7 is affected as well.

Comment by Christopher Zimmermann [ 22/Jun/20 ]

fgrilli With your last comment do you mean that 5.7.7 the problem does not show up anymore - or that it is still affected by the problem?

Generated at Mon Feb 12 04:26:21 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.