-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the yaql/jinja vars extraction to ignore methods of base ctx() dict #196
Conversation
The ctx() method returns a dict and there are use cases where users call supported methods on the dict such as keys(), values(), and get(). The vars extraction would return false positives on these function calls. The regular expressions to extract variables from expressions is refactored to ignore these dict related function calls directly on ctx().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review still in progress.
Codecov Report
@@ Coverage Diff @@
## master #196 +/- ##
==========================================
- Coverage 94.04% 94.03% -0.02%
==========================================
Files 41 41
Lines 2739 2733 -6
Branches 542 544 +2
==========================================
- Hits 2576 2570 -6
Misses 100 100
Partials 63 63
Continue to review full report at Codecov.
|
9f5c094
to
c5ef955
Compare
…lify-regexes Simplify Jinja expression context regexes
Copy the simpliciation for Jinja evaluator to the YAQL evaluator. Add more test cases to ensure correctness.
The ctx() method returns a dict and there are use cases where users call supported methods on the dict such as keys(), values(), and get(). The vars extraction would return false positives on these function calls. The regular expressions to extract variables from expressions is refactored to ignore these dict related function calls directly on ctx(). Fixes StackStorm/st2#4866.