mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
* feat(stepfunctions): emit execution status change events to EventBridge STANDARD executions now publish "Step Functions Execution Status Change" events (source aws.states) to the default EventBridge bus on RUNNING, SUCCEEDED, FAILED, TIMED_OUT and ABORTED, so rules matching aws.states fire as they do on AWS. EXPRESS executions emit nothing, as on AWS. StepFunctionsEventPublisher follows the EcsEventPublisher pattern. RUNNING is published when StartExecution creates the execution, terminal statuses from the worker's completion callback, and ABORTED from StopExecution only, so a stopped execution emits exactly one ABORTED. An idempotent StartExecution and the startup sweep of executions abandoned by a restart emit nothing. * fix(stepfunctions): match the documented execution status change event Address review feedback on the aws.states events: - Always send stateMachineVersionArn and stateMachineAliasArn, null when unused, as AWS's documented events do. - Report redrive status as the documented examples do: FAILED and TIMED_OUT are REDRIVABLE with "Execution is <status> and is redrivable"; RUNNING, SUCCEEDED and ABORTED are NOT_REDRIVABLE with "Execution is <status> and cannot be redriven". - Name States.Timeout as the error of a TIMED_OUT event. - Apply the 248 KiB rule: input is left out when the escaped input and output together exceed it, output when the escaped output alone does, and inputDetails/outputDetails.included report it. * test(stepfunctions): check event absences without waiting on empty queues The integration test long-polled SQS for 2 s after each case to show nothing more arrived, so the class waited about 10 s by design. It now asserts only the events that should arrive. The absences that matter are checked in StepFunctionsServiceExecutionEventsTest: it captures the completion callback from a mocked AslExecutor and verifies that an EXPRESS execution publishes nothing and that the worker's callback after StopExecution adds no second ABORTED. Add StepFunctionsExecutions.waitForTerminalState to the shared testing package and use it here; moving the other Step Functions integration tests onto it is left for a separate PR.