refactor(logs): extract subscription filter delivery and promote action list#336
Merged
vieiralucas merged 1 commit intomainfrom Apr 13, 2026
Merged
refactor(logs): extract subscription filter delivery and promote action list#336vieiralucas merged 1 commit intomainfrom
vieiralucas merged 1 commit intomainfrom
Conversation
…on list Two touches in fakecloud-logs: - put_log_events had an 80-line inline block that applied each subscription filter's pattern to the accepted log events, wrapped the matches in the DATA_MESSAGE envelope, gzip-compressed and base64-encoded the payload, and then fanned out to one of three destination kinds (SQS / Lambda / Kinesis) with a different wire shape each. Move that into deliver_to_subscription_filter so the top-level loop is just the usual 'for each matching filter, deliver' pattern. - supported_actions returned a 117-entry inline array literal constructed on every call (minor, but the pattern is that service trait implementations should return a borrow of a static slice). Lift the array into a file-level SUPPORTED_ACTIONS const and return that.
vieiralucas
added a commit
that referenced
this pull request
Apr 13, 2026
…cyInput - Promote IamService::supported_actions inline 130-element &[&str] to a file-level SUPPORTED_ACTIONS const; same shape PR #336 used for logs. - Extract CreatePolicyInput::from_query from create_policy. The parse + validate prologue (PolicyName, PolicyDocument, Path, Description, Tags + tag validation, MalformedPolicyDocument check) is now isolated from the state-mutation flow. list_policies (49L) audited in the same pass and judged clean: most of the body is parameter validation calls, with a short filter+render tail. Splitting would just rearrange validate_* calls.
4 tasks
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
Two touches in fakecloud-logs:
Test plan
Summary by cubic
Refactors the CloudWatch Logs service in
fakecloud-logsby extracting subscription filter delivery fromput_log_eventsand promoting the supported action list to a static constant. This simplifies the main loop and avoids per-call allocations without changing behavior.deliver_to_subscription_filter(...)to handle pattern matching, DATA_MESSAGE wrapping, gzip+base64, and fan-out to SQS/Lambda/Kinesis; replaces the inline block input_log_events.SUPPORTED_ACTIONSand updatedsupported_actions()to return a static borrow.Written for commit 0e80e02. Summary will update on new commits.