uwefladrich/scriptengine

Context append to list may drop items

Closed this issue · 1 comments

Appending to lists sometimes doesn't work as expected, as in this example:

- when: "True"
  base.context:
    foo: [0, 1, 2, 3, 4, 5, 6, 7, 8]
- when: "True"
  base.context:
    foo: [9, 10, 11]
- base.echo:
    msg: "==> {{foo}}"

which results in:

> se missing-append.yml 
[...] INFO [se.cli] Logging configured and started
[...] INFO [se.task:context <...>] Context update: <ContextUpdate: merge {'foo': [0, 1, 2, 3, 4, 5, 6, 7, 8]}>
[...] INFO [se.task:context <...>] Context update: <ContextUpdate: merge {'foo': [9, 10, 11]}>
[...] INFO [se.task:echo <...>] ==> {{foo}}
==> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

where the last two items appended in the second task are erroneously dropped.

The underlying problem is a bug in deepdiff, see seperman/deepdiff#285. The issue has been solved in deepdiff 5.7.0, so the solution for ScriptEngine is to use that version.