Skip to content

feat(clp-rust-utils): Add a utility function for creating SQS client.#1517

Merged
LinZhihao-723 merged 4 commits into
y-scope:mainfrom
LinZhihao-723:sqs-client
Oct 29, 2025
Merged

feat(clp-rust-utils): Add a utility function for creating SQS client.#1517
LinZhihao-723 merged 4 commits into
y-scope:mainfrom
LinZhihao-723:sqs-client

Conversation

@LinZhihao-723

@LinZhihao-723 LinZhihao-723 commented Oct 28, 2025

Copy link
Copy Markdown
Member

Description

As the title suggests.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

Summary by CodeRabbit

  • New Features

    • Added AWS Simple Queue Service (SQS) support to enable message queuing and asynchronous processing.
  • Chores

    • Added the AWS SQS SDK dependency and standardized the AWS S3 SDK dependency declaration for improved compatibility and stability.

@LinZhihao-723 LinZhihao-723 requested a review from a team as a code owner October 28, 2025 21:41
@coderabbitai

coderabbitai Bot commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds AWS SQS support to clp-rust-utils: updates Cargo.toml (adds aws-sdk-sqs, simplifies aws-sdk-s3) and introduces a new public sqs module with a create_new_client async constructor for an SQS client.

Changes

Cohort / File(s) Summary
Cargo manifest
components/clp-rust-utils/Cargo.toml
Changed aws-sdk-s3 from table to string form; added aws-sdk-sqs = "1.86.0".
Library exports
components/clp-rust-utils/src/lib.rs
Added pub mod sqs; to expose the new SQS module.
SQS module surface
components/clp-rust-utils/src/sqs.rs
New module declaring mod client; and re-exporting pub use client::create_new_client;.
SQS client implementation
components/clp-rust-utils/src/sqs/client.rs
New file with pub async fn create_new_client(region_id: &str, access_key_id: &str, secret_access_key: &SecretString) -> Client that builds credentials, region, loads base AWS config, applies credentials/region, and returns an SQS Client.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Caller
    participant SqsModule as sqs::create_new_client
    participant AwsConfig as AWS SDK (config)
    participant SqsClient as AWS SQS Client

    Caller->>SqsModule: call create_new_client(region_id, access_key_id, secret)
    SqsModule->>SqsModule: build Credentials\ncreate Region
    SqsModule->>AwsConfig: load default config (BehaviorVersion::latest)
    SqsModule->>AwsConfig: attach Credentials and Region
    AwsConfig->>SqsClient: Client::from_conf(config)
    SqsClient-->>Caller: return Client
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus:
    • components/clp-rust-utils/src/sqs/client.rs — credential handling and use of SecretString.
    • Async usage and config merging correctness when calling AWS SDK.
    • Cargo manifest change for aws-sdk-s3 format and compatibility with workspace or other crates.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "feat(clp-rust-utils): Add a utility function for creating SQS client." directly and accurately reflects the main change in the changeset. The modifications across the files demonstrate the implementation of exactly this functionality: adding the aws-sdk-sqs dependency, creating a new sqs module, and implementing the create_new_client function. The title is concise, uses clear language, follows conventional commit formatting with an appropriate scope, and avoids vague or generic terms. A developer scanning the pull request history would immediately understand the primary change.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf28e78 and 5b107bb.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • components/clp-rust-utils/Cargo.toml (1 hunks)
  • components/clp-rust-utils/src/lib.rs (1 hunks)
  • components/clp-rust-utils/src/sqs.rs (1 hunks)
  • components/clp-rust-utils/src/sqs/client.rs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/clp-rust-utils/src/sqs.rs (1)
components/clp-rust-utils/src/sqs/client.rs (1)
  • create_new_client (15-37)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: package-image
  • GitHub Check: lint-check (ubuntu-24.04)
  • GitHub Check: lint-check (macos-15)
  • GitHub Check: rust-checks (ubuntu-22.04)
  • GitHub Check: rust-checks (ubuntu-24.04)
  • GitHub Check: rust-checks (macos-15)
🔇 Additional comments (3)
components/clp-rust-utils/src/lib.rs (1)

2-2: LGTM! Module export follows existing pattern.

The new SQS module is correctly exported alongside the existing S3 module.

components/clp-rust-utils/src/sqs.rs (1)

1-3: LGTM! Standard module organization pattern.

The module structure and re-export are clean and idiomatic.

components/clp-rust-utils/Cargo.toml (1)

8-9: AWS SDK versions are compatible with no security advisories detected.

The current aws-sdk-sqs 1.86.0 works with aws-config 1.1.7 and later, and aws-sdk-s3 1.108.0 works with aws-config 1.1.7, indicating broad compatibility within the AWS SDK for Rust ecosystem. The script execution shows the latest available versions are aws-sdk-s3 1.109.0, aws-sdk-sqs 1.87.0, and aws-config 1.8.8. No security vulnerabilities were found for aws-sdk-sqs. The versions in use (1.106.0 for S3 and 1.86.0 for SQS) are minor releases behind the latest and are compatible with each other. AWS SDKs are designed to evolve in a backwards-compatible way as new fields and operations are added.

Comment thread components/clp-rust-utils/src/sqs/client.rs
Comment thread components/clp-rust-utils/src/sqs/client.rs
Comment thread components/clp-rust-utils/src/sqs/client.rs
@LinZhihao-723 LinZhihao-723 merged commit 5312c87 into y-scope:main Oct 29, 2025
23 checks passed
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.

2 participants