refactor(ssm): extract CreatePatchBaselineInput and CreateAssociationInput#361
Merged
vieiralucas merged 1 commit intomainfrom Apr 13, 2026
Merged
refactor(ssm): extract CreatePatchBaselineInput and CreateAssociationInput#361vieiralucas merged 1 commit intomainfrom
vieiralucas merged 1 commit intomainfrom
Conversation
…Input The two longest functions in the SSM sub-modules were create_patch_baseline (~150 lines) and create_association_inner (~162 lines). Both were dominated by body parsing, field validation, and field extraction — with the actual state mutation only in the last 30-40 lines. This extracts dedicated *Input structs with from_body() constructors, leaving each function focused on idempotency, ID generation, and struct assembly. Same pattern as PRs #324/#328/#338/#355/#356.
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.
Summary
The two longest functions in the SSM sub-modules were
create_patch_baseline(~150 lines) andcreate_association_inner(~162 lines). Both were dominated by body parsing, field validation, and field extraction — with the actual state mutation only in the last 30-40 lines.This extracts dedicated
*Inputstructs withfrom_body()constructors, leaving each function focused on idempotency, ID generation, and struct assembly. Same pattern as PRs #324/#328/#338/#355/#356.Test plan
cargo clippy -p fakecloud-ssm --all-targets -- -D warningscargo test -p fakecloud-ssm(60 passed)Summary by cubic
Refactored SSM create flows by extracting
CreatePatchBaselineInputandCreateAssociationInputwithfrom_body()parsing and validation. This simplifiescreate_patch_baselineandcreate_association_innerand keeps them focused on idempotency and state updates.CreatePatchBaselineInput::from_bodyandCreateAssociationInput::from_body.Written for commit 7289b60. Summary will update on new commits.