feat(stepfunctions): resolve payload-template .$ inside arrays and $$ context in intrinsic args#1691
Open
abanna wants to merge 1 commit into
Open
Conversation
… context in intrinsic args
Two AWS States Language parity fixes in the payload-template / intrinsic path:
- resolveParameters now recurses into arrays, not just objects. A Parameters / ItemSelector /
ResultSelector template resolves .$ references at any nesting depth, including inside arrays
(e.g. an ECS Overrides.ContainerOverrides[].Environment[].Value.$). Previously array elements
passed through verbatim, so those references were never substituted.
- Intrinsic-function arguments can now reference the Context Object ($$). resolvePath /
evaluateIntrinsic / resolveIntrinsicArg thread the Context Object through, so an argument like
States.Format('{}', $$.Map.Item.Value.x) or a bare $$.Execution.Id resolves against the
context. Ordinary $. / input-only resolution is unchanged (context is null there).
Adds AslExecutorArrayParamsTest and AslExecutorIntrinsicContextTest.
| import com.fasterxml.jackson.databind.ObjectMapper; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; |
There was a problem hiding this comment.
Test naming convention mismatch
AGENTS.md specifies that unit tests should follow the *ServiceTest.java naming pattern. Both new test files (AslExecutorArrayParamsTest and AslExecutorIntrinsicContextTest) use a different suffix. While AslExecutor is not technically a service, establishing an inconsistent test-naming pattern here may cause confusion when locating tests with build tooling or running focused test commands like ./mvnw test -Dtest=AslExecutor*.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two AWS States Language parity fixes in the Step Functions payload-template / intrinsic path.
1.
resolveParametersnow recurses into arraysA
Parameters/ItemSelector/ResultSelectorpayload template must resolve.$references at any nesting depth. PreviouslyresolveParametersrecursed into nested objects but passed array elements through verbatim, so a.$reference inside an array was never substituted.Real-world shape this fixes — an ECS
Overrides.ContainerOverrides[].Environment[].Value.$:Without array recursion,
Value.$stayed literal and the launched task got an empty environment.2. Intrinsic arguments can reference the Context Object (
$$)resolvePath/evaluateIntrinsic/resolveIntrinsicArgnow thread the Context Object through, so an intrinsic argument can read$$:Ordinary
$./States.*input-only resolution is unchanged —contextisnullon that path, so existing behavior is preserved.Tests
AslExecutorArrayParamsTest—.$resolution inside arrays.AslExecutorIntrinsicContextTest—$$references in intrinsic args (and that input-only resolution still ignores context).Built + tested in the temurin container (targeted SFN suite green).