yadt/yadt-minion — pull request #5 by esc (2013-11-15 14:17:42+00:00)
Title: expose bug when merging YAML files

The issue is the following, imagine two yaml files

'a.yaml'

""" a:
b: True
c: ['foo']
"""

and 'b.yaml' which contains only:

""" a:
"""

The problem is that the 'b.yaml' is interpreted incorrectly and will
overwrite the entires for 'a:' provided in 'a.yaml'. The reason is that due
to parsing, b.yaml is interpreted as:

"""
{
"a": null
}
"""

This has caused a problem for us, as the yadt services order was broken when
we modularised.

Another big problem with this is that the commutativity of the merge
operation does not hold. I.e. if I merge 'a.yaml' with 'b.yaml' I get a
different result than if i merge 'b.yaml' with 'a.yaml'. This can be easily
verified by moving 'a.yaml' to
'c.yaml' and observing that the unit test passes.

Our current temporary workaround is to do:

""" a: {}
"""

That this works can also be verified easily by changing the contents of
'b.yaml' as above.