mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
Moves the last type that answered in the dispatcher's update-cleanup hooks out of the monolith. Monolith 4,521 to 3,886 lines, legacy types 28 to 27, and no reference to StepFunctions or StateMachine remains in the class. The prize is the five hooks. Each one delegated to the provisioner that owns the type and then fell through to a StepFunctions arm for the types that had none. StepFunctions was the last of those, so all five collapse to plain delegation: completeUpdate 60 lines to 6, rollbackUpdate 79 to 5, updateCleanupPhysicalId 28 to 8, hasReplacementUpdate 18 to 5, clearUpdate 5 to 4. A replacement's bookkeeping, its retry budget and its rollback now live beside the code that creates the replacement. The provisioner wraps three collaborators rather than one. StepFunctionsService is its own. ObjectMapper reads and writes the update snapshot. S3Service is there because a state machine's definition may arrive as DefinitionS3Location rather than DefinitionString, so resolving it means fetching and parsing the object; s3Service stays in the monolith as well, since ApiGateway and Lambda also read from S3. Two constants are copied rather than moved: NAME_MODE_EXPLICIT and NAME_MODE_GENERATED are also used by Lambda, and GENERATED_NAME_SUFFIX_LENGTH by generatePhysicalName. Copying is what keeps this move behaviour-preserving. CloudFormationYamlParser's constructor becomes public. The parser is already a public class, but its constructor was package-private and the provisioners live in a subpackage, so the definition-from-S3 path could not reach it. Tests: 2,862 green across the cloudformation, provisioners and stepfunctions packages. The rollback path is the one worth proving rather than assuming, since a status-only assertion would not notice its loss: neutralising rollbackUpdate to return false fails five integration tests across three classes, with the stack reporting UPDATE_ROLLBACK_FAILED and naming InitialStateMachine.