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/expression package in the step runner
  • expression.Expand needs to change to internally use Moa
  • Use Moa by calling moa.ParseTemplate([expression]). Pass the resulting expression to moa.Evaluate
  • Convert the expression.InterpolationContext to the Moa env/model using Moa's stdlib.Env. Make sure Moa's stdlib functions are registered using RegisterFunction
  • There will be need to map *structpb.Value to Moa's value.Value, and back again. The Moa value.Value should 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 return value_is_42
    • After: value_is_${{ 42 }} errors. Fix it by casting to a string value_is_${{ str(42) }}
Edited by Cameron Swords