Replace the expression language with Moa
Problem
The Steps expression language does not support propagation of sensitive variables.
Proposal
Use Moa as the Steps expression language. This issue is complete when Moa is able to be used in the step-runner, even if the behaviour is under a feature flag turned off by default.
The issue Turn the new expression language on by default (#309) is responsible for turning Moa on by default.
Implementation plan
(this is a suggestion only)
- The changes in this MR greatly affect the
pkg/internal/expressionpackage in the step runner -
expression.Expandneeds to change to internally use Moa - Use Moa by calling
moa.ParseTemplate([expression]). Pass the resulting expression tomoa.Evaluate - Convert the
expression.InterpolationContextto the Moa env/model using Moa'sstdlib.Env. Make sure Moa's stdlib functions are registered usingRegisterFunction - There will be need to map
*structpb.Valueto Moa'svalue.Value, and back again. The Moavalue.Valueshould remain encapsulated within the expression package - This is a breaking change, expect tests to fail. Notably, strings must be cast now - there is no implicit coercion
- Before:
value_is_${{ 42 }}would returnvalue_is_42 - After:
value_is_${{ 42 }}errors. Fix it by casting to a stringvalue_is_${{ str(42) }}
- Before:
Edited by Cameron Swords