* With disabled YAQL data output conversion, YAQL may return
instances of ContextView which can't be properly saved into
DB. This happens because Mistral serialization code doesn't
turn on JSON conversion of custom objects, and they are just
ignored by the "json" lib when it encounters them.
* Fixed how Mistral serializes context for Javascript evaluation
to address the same problem.
* Implemented __repr__ method of ContextView.
* Removed logging of "data_context" from YAQL evaluation because
previously it was always empty (because the string represetation
of ContextView was always "{}") and now it may be very big, like
megabytes, and the log gets populated too fast. It makes sense to
log YAQL data context only when an error happened. In this case
it helps to investigate an issue.
* Added all required unit tests.
* Fixed the tests for disabled YAQL conversion. In fact, they
didn't test it properly because data conversion wasn't disabled.
Reviewed: https:/ /review. opendev. org/713886 /git.openstack. org/cgit/ openstack/ mistral/ commit/ ?id=241ea888c69 93ac045cf12d6b6 1d4e1a1ff29ad3
Committed: https:/
Submitter: Zuul
Branch: stable/train
commit 241ea888c6993ac 045cf12d6b61d4e 1a1ff29ad3
Author: Renat Akhmerov <email address hidden>
Date: Fri Mar 13 16:55:25 2020 +0700
Fix ContextView JSON serialization
* With disabled YAQL data output conversion, YAQL may return
instances of ContextView which can't be properly saved into
DB. This happens because Mistral serialization code doesn't
turn on JSON conversion of custom objects, and they are just
ignored by the "json" lib when it encounters them.
* Fixed how Mistral serializes context for Javascript evaluation
to address the same problem.
* Implemented __repr__ method of ContextView.
* Removed logging of "data_context" from YAQL evaluation because
previously it was always empty (because the string represetation
of ContextView was always "{}") and now it may be very big, like
megabytes, and the log gets populated too fast. It makes sense to
log YAQL data context only when an error happened. In this case
it helps to investigate an issue.
* Added all required unit tests.
* Fixed the tests for disabled YAQL conversion. In fact, they
didn't test it properly because data conversion wasn't disabled.
Closes-Bug: #1867899 90d8ae09b72f73c 0da96254a86
Change-Id: I12b4d0c5f1f499