mirror of
https://github.com/floci-io/floci.git
synced 2026-11-28 16:11:48 -05:00
fix(stepfunctions): return the PascalCase execution envelope from states:startExecution, .sync and .sync:2 (#4737)
AWS returns, as the Task result of the optimized states:startExecution
integration (measured in ap-northeast-1 on 2026-09-30):
- request-response: the StartExecution response, {ExecutionArn, StartDate},
StartDate in epoch milliseconds
- .sync: the child's DescribeExecution response, PascalCase with its keys
in alphabetical order, dates in epoch milliseconds, Input and Output as
JSON strings
- .sync:2: the same envelope with Input and Output as JSON values
Floci returned camelCase with dates in seconds for the first two and the
child's output alone for .sync:2, so a state machine written against AWS
found nothing at $.Output, $.ExecutionArn or $.Status.
The failure cause of the two .sync modes already built this envelope
(#4675). It now builds the success result too: a SUCCEEDED child carries
Output, OutputDetails and RedriveStatusReason and reports NOT_REDRIVABLE.
Request-response returns the response TaskSubmitted already records.
This changes the result shape for state machines written against Floci's
earlier one: the child output of .sync:2 moves from $ to $.Output.
Closes #4723
Co-authored-by: mitsukado-shinagawa <mitsukado-shinagawa@users.noreply.github.com>
This commit is contained in:
1 parent
d267ba3a9d
commit
fd094aee05
6 files changed
+348
-110
No files matched your search
+17
-15
@@ -8,9 +8,9 @@ import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
/**
|
||||
* Compatibility tests for nested state machine execution via optimised integrations:
|
||||
* arn:aws:states:::states:startExecution (fire-and-forget)
|
||||
* arn:aws:states:::states:startExecution.sync (wait, return full execution envelope)
|
||||
* arn:aws:states:::states:startExecution.sync:2 (wait, return only child output)
|
||||
* arn:aws:states:::states:startExecution (fire-and-forget, return the StartExecution response)
|
||||
* arn:aws:states:::states:startExecution.sync (wait, return the execution envelope, Output a JSON string)
|
||||
* arn:aws:states:::states:startExecution.sync:2 (wait, return the execution envelope, Output a JSON value)
|
||||
*
|
||||
* Covers Issue #254.
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ class StepFunctionsNestedSmTest {
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
void sync2_parentReceivesChildOutputDirectly() throws InterruptedException {
|
||||
void sync2_parentReceivesEnvelopeWithOutputAsJsonValue() throws InterruptedException {
|
||||
String parentDef = """
|
||||
{
|
||||
"StartAt": "InvokeChild",
|
||||
@@ -93,11 +93,12 @@ class StepFunctionsNestedSmTest {
|
||||
DescribeExecutionResponse result = pollUntilDone(execArn);
|
||||
|
||||
assertThat(result.status()).isEqualTo(ExecutionStatus.SUCCEEDED);
|
||||
// Output must be the child's parsed output object, not an envelope
|
||||
// Output must be the PascalCase envelope, with the child's output as a JSON value
|
||||
assertThat(result.output())
|
||||
.contains("\"computed\":true")
|
||||
.contains("\"value\":42")
|
||||
.doesNotContain("executionArn");
|
||||
.contains("\"ExecutionArn\"")
|
||||
.contains("\"Status\":\"SUCCEEDED\"")
|
||||
.contains("\"Input\":{\"trigger\":\"sync2\"}")
|
||||
.contains("\"Output\":{\"computed\":true,\"value\":42}");
|
||||
} finally {
|
||||
try { sfn.deleteStateMachine(b -> b.stateMachineArn(parentSmArn)); } catch (Exception ignored) {}
|
||||
}
|
||||
@@ -138,11 +139,12 @@ class StepFunctionsNestedSmTest {
|
||||
DescribeExecutionResponse result = pollUntilDone(execArn);
|
||||
|
||||
assertThat(result.status()).isEqualTo(ExecutionStatus.SUCCEEDED);
|
||||
// Output must be the full envelope: executionArn, status, output (as a string), etc.
|
||||
// Output must be the PascalCase envelope, with the child's output as a JSON string
|
||||
assertThat(result.output())
|
||||
.contains("executionArn")
|
||||
.contains("\"SUCCEEDED\"")
|
||||
.contains("\"output\"");
|
||||
.contains("\"ExecutionArn\"")
|
||||
.contains("\"Status\":\"SUCCEEDED\"")
|
||||
.contains("\"Input\":\"{\\\"trigger\\\":\\\"sync\\\"}\"")
|
||||
.contains("\"Output\":\"{\\\"computed\\\":true,\\\"value\\\":42}\"");
|
||||
} finally {
|
||||
try { sfn.deleteStateMachine(b -> b.stateMachineArn(parentSmArn)); } catch (Exception ignored) {}
|
||||
}
|
||||
@@ -183,10 +185,10 @@ class StepFunctionsNestedSmTest {
|
||||
DescribeExecutionResponse result = pollUntilDone(execArn);
|
||||
|
||||
assertThat(result.status()).isEqualTo(ExecutionStatus.SUCCEEDED);
|
||||
// Output must be { executionArn, startDate } — no child output
|
||||
// Output must be { ExecutionArn, StartDate } with no child output
|
||||
assertThat(result.output())
|
||||
.contains("executionArn")
|
||||
.contains("startDate")
|
||||
.contains("\"ExecutionArn\"")
|
||||
.contains("\"StartDate\"")
|
||||
.doesNotContain("\"SUCCEEDED\"");
|
||||
} finally {
|
||||
try { sfn.deleteStateMachine(b -> b.stateMachineArn(parentSmArn)); } catch (Exception ignored) {}
|
||||
|
||||
Reference in new issue
Block a user