refactor(ssm): split update_document and list_documents in documents.rs#358
Merged
vieiralucas merged 1 commit intomainfrom Apr 13, 2026
Merged
Conversation
- update_document: extract validate_update_document_target_version, validate_update_document_unique_content, and validate_update_document_unique_version_name. The outer function now reads as parse → 3 named validators → mutate → render. - list_documents: extract document_matches_list_filters (Owner/TargetType/Name filter dispatch) and document_identifier_json (DocumentIdentifier shape). The outer function is now a 12-line filter+paginate flow.
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
Test plan
Summary by cubic
Refactored
fakecloud-ssmdocuments service by splittingupdate_documentandlist_documentsinto small helpers for validation, filtering, and JSON shaping. Flows are now parse → validate → mutate → render and filter → paginate, with no behavior changes.update_document: extractedvalidate_update_document_target_version,validate_update_document_unique_content(SHA-256 dedupe), andvalidate_update_document_unique_version_name.list_documents: extracteddocument_matches_list_filters(Owner/TargetType/Name) anddocument_identifier_json.Written for commit cd6026d. Summary will update on new commits.