StackStorm / orquestaconvert

Converts Mistral workflows into Orchestra workflows
Apache License 2.0
13 stars 7 forks source link

Expand ctx dict regex #28

Closed blag closed 4 years ago

blag commented 4 years ago

This PR expands the regex used to extract context variable references to accept the dict.get() method used in YAQL expressions:

<% ctx().get("dict_key") %>

Note that specifying default values are also accepted:

<% ctx().get("dict_key", "default_value") %>

This feature was added to Orquesta in the lead up to the ST2 v3.1 release, but support for it was not added to this project.

I also add a lot more tests for the context variable extraction, since that regex is getting more and more gnarly.

Furthermore, I also pulled in some changes from st2 for dist_utils.py and made a few tweaks to the Makefile. The issues in dist_utils.py were causing import issues in setup.py, which was causing PYMODULE_NAME in the Makefile to be blank, which was causing the coverage module flag to nose to be empty, which made coverage run results over all imported Python modules...which made my coverage results look huge and the coverage percent to inaccurately be ~0%. Whee, cascading failures are fun!