Skip to content

refactor: extract shared Query protocol helpers to fakecloud-core#281

Merged
vieiralucas merged 1 commit intomainfrom
worktree-extract-shared-utilities
Apr 12, 2026
Merged

refactor: extract shared Query protocol helpers to fakecloud-core#281
vieiralucas merged 1 commit intomainfrom
worktree-extract-shared-utilities

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 12, 2026

Summary

  • Adds fakecloud_core::query module with shared Query protocol XML wrapping (query_response_xml, query_metadata_only_xml) and param extraction (optional_query_param, required_query_param)
  • Migrates SQS, ElastiCache, RDS, SES v1 to delegate to the shared implementations, eliminating 4 identical xml_wrap() copies and 2 identical optional_param/required_param pairs
  • Makes SQS md5_hex/sha256_hex pub(crate) since they're only used within the crate

Test plan

  • cargo clippy --workspace --all-targets -- -D warnings passes clean
  • Existing xml_wrap_produces_valid_response test in ElastiCache still passes
  • CI passes
  • Cubic review passes

Summary by cubic

Extracted shared AWS Query protocol helpers into fakecloud-core and updated fakecloud-sqs, fakecloud-elasticache, fakecloud-rds, and fakecloud-ses (v1) to use them. Removes duplicate XML wrappers and parameter parsing; no behavior change intended.

  • Refactors

    • Added fakecloud_core::query::{query_response_xml, query_metadata_only_xml, optional_query_param, required_query_param}.
    • Replaced per-service xml_wrap() and param helpers in the services to delegate to core.
    • Set fakecloud-sqs md5_hex/sha256_hex to pub(crate) as they are internal utilities.
  • Migration

    • If external code used fakecloud-sqs::md5_hex or sha256_hex, switch to md5/sha2 directly or copy the small helpers.

Written for commit 7610253. Summary will update on new commits.

- Add fakecloud_core::query module with query_response_xml(),
  query_metadata_only_xml(), optional_query_param(), and
  required_query_param()
- Migrate SQS, ElastiCache, RDS, SES v1 xml_wrap() to delegate to core
- Migrate ElastiCache, RDS optional_param/required_param to delegate to core
- Make SQS md5_hex/sha256_hex pub(crate) instead of pub
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

@vieiralucas vieiralucas merged commit e68c624 into main Apr 12, 2026
22 checks passed
@vieiralucas vieiralucas deleted the worktree-extract-shared-utilities branch April 12, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant