feat(sqs): implement message-move tasks#697
Merged
vieiralucas merged 3 commits intomainfrom Apr 23, 2026
Merged
Conversation
Synchronously drains source-queue messages on StartMessageMoveTask, redirecting them to the specified destination ARN or round-robin back to the queues that name the source as their DLQ. Tasks land in COMPLETED status immediately, so CancelMessageMoveTask returns UnsupportedOperation for finished work and ListMessageMoveTasks returns up to MaxResults entries newest-first. Closes the SQS conformance gap to 23/23 (100%).
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
2 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/fakecloud-sqs/src/service.rs">
<violation number="1" location="crates/fakecloud-sqs/src/service.rs:2891">
P2: `MaxNumberOfMessagesPerSecond` is parsed with `as_i64()` only, so query-protocol string values are ignored, and the early `i64 -> i32` cast can wrap before validation.</violation>
<violation number="2" location="crates/fakecloud-sqs/src/service.rs:3085">
P2: `MaxResults` parsing ignores query-protocol string values, so list operations default to 1 result even when callers pass `MaxResults`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…rings Cubic flagged that StartMessageMoveTask and ListMessageMoveTasks parsed their integer params with as_i64() only, so Query-protocol callers (boto3) — which encode integers as strings — silently fell back to defaults. Switch both to val_as_i64, which already handles number-or- string. Defer the i64 -> i32 cast on the per-second rate until after range validation so out-of-i32 inputs can't wrap before the check. Adds unit coverage for query-protocol parsing, range validation, DLQ gate, unknown-source / unknown-handle / completed-task error branches.
Adds tests for explicit destination drain, unknown destination ARN, already-running task guard, cancellation of a Running task, and ListMessageMoveTasks 10-cap with TaskHandle hidden on Completed entries. Lifts patch coverage above the project baseline.
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
StartMessageMoveTask,CancelMessageMoveTask,ListMessageMoveTaskswith real state mutation: drains source DLQ messages and routes them to the destination ARN or back to redrive sources.MessageMoveTaskstate record per account; tasks complete synchronously so cancel of a finished task returnsUnsupportedOperationper AWS semantics.Test plan
cargo test -p fakecloud-conformance --test sqscargo run -p fakecloud-conformance -- run --services sqs-> 23/23 OKcargo run -p fakecloud-conformance -- audit-> PASScargo run -p fakecloud-conformance -- check-> PASScargo clippy --workspace --all-targets -- -D warningscargo fmt --checkSummary by cubic
Implements SQS message-move tasks in
fakecloud-sqs(StartMessageMoveTask,ListMessageMoveTasks,CancelMessageMoveTask) and fixes query-protocol parsing for numeric params so SDKs like boto3 work. DLQ messages are moved synchronously to a destination or back to redrive sources; SQS conformance now passes 23/23.New Features
StartMessageMoveTask: validateSourceArnis a DLQ; validate optionalDestinationArn; enforceMaxNumberOfMessagesPerSecond(1–500); block concurrent tasks; drain DLQ and move messages; returns a handle; completes immediately.ListMessageMoveTasks: filter bySourceArn; newest first; respectMaxResults(1–10); returns status, counts, timestamp; showsTaskHandleonly while RUNNING.CancelMessageMoveTask: cancel only RUNNING; returnApproximateNumberOfMessagesMoved; returnUnsupportedOperationif not RUNNING.Bug Fixes
MaxNumberOfMessagesPerSecondandMaxResultsfrom query strings; add tests for query-protocol parsing, range checks, DLQ-only source, explicit destination drain and unknown destination, already-running guard, unknown source/handle, cancel RUNNING vs completed, andMaxResults10-cap withTaskHandlehidden when completed.Written for commit c308b84. Summary will update on new commits.