feat(queue): add SQS queue explorer - #148
Conversation
… delete, and purge
|
| Filename | Overview |
|---|---|
| packages/api/src/adapter-aws/AwsQueueAdapter.ts | New SQS adapter covering list, create, delete, get, send, receive (peek), deleteMessage, and purge. FIFO handling and MessageGroupId auto-derivation are correct; resolveQueueUrl correctly reconstructs LocalStack URLs. list() does not paginate past 1000 queues (no NextToken loop). |
| packages/api/src/adapter-aws/AwsQueueAdapter.test.ts | Comprehensive unit tests covering list, filter, create (including FIFO auto-suffix and explicit .fifo dedup), delete, get (with and without attributes), receive, deleteMessage, purge, and FIFO MessageGroupId injection. All happy paths and key edge cases are covered. |
| packages/api/src/cloud-spi/queueSchema.ts | Queue schema definition with corrected name pattern ^[a-zA-Z0-9_-]{1,75}(.fifo)?$ that permits the .fifo suffix; declares all eight resource actions and a standard column/filter set. |
| packages/frontend/src/components/QueuePanel.tsx | Queue action panel with per-message delete state tracked via deletingHandles Set, resource-change reset via useEffect, and non-consuming receive via useQuery. Logic and state management are correct. |
| packages/frontend/src/components/DynamicResourceView.tsx | Wires QueuePanel into the generic resource view. runtimeReachable is passed to QueuePanel instead of canUseRuntime (which is runtimeReachable && adapterAvailable), inconsistent with all other action panels. |
| packages/api/src/routes/clouds.ts | Adds four new route handlers (send, receive, delete-message, purge) and extends isServiceType to include 'queue'. Routes are thin and delegate cleanly to the service layer. |
| packages/api/src/service/CloudProxyService.ts | Adds sendQueueMessage, receiveQueueMessages, deleteQueueMessage, and purgeQueue service methods that delegate to the adapter interface with correct capability guards. |
| packages/frontend/src/api/cloudProxyClient.ts | Adds sendQueueMessage, receiveQueueMessages, deleteQueueMessage, and purgeQueue client functions. The duplicate ServerlessInvokeResult interface declaration is still present but TypeScript merges it silently. |
| packages/frontend/src/api/api.ts | Registers four new endpoint keys (send, receive, deleteMessage, purge) and removes the duplicate invoke registry entry that was previously flagged. |
Sequence Diagram
%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant UI as QueuePanel (React)
participant API as Hono API (:4501)
participant SVC as CloudProxyService
participant ADP as AwsQueueAdapter
participant SQS as SQS / LocalStack (:4566)
UI->>API: POST /clouds/aws/queue/resources/:id/send
API->>SVC: sendQueueMessage(cloud, service, id, body)
SVC->>ADP: sendMessage(id, body)
ADP->>SQS: SendMessageCommand
SQS-->>UI: messageId
UI->>API: POST /clouds/aws/queue/resources/:id/receive
API->>SVC: receiveQueueMessages(...)
SVC->>ADP: receiveMessages(id, 10)
ADP->>SQS: "ReceiveMessageCommand (VisibilityTimeout=0)"
SQS-->>UI: QueueMessage[]
UI->>API: "DELETE /clouds/aws/queue/resources/:id/messages?receiptHandle=rh"
API->>SVC: deleteQueueMessage(..., receiptHandle)
SVC->>ADP: deleteMessage(id, receiptHandle)
ADP->>SQS: DeleteMessageCommand
SQS-->>UI: ok
UI->>API: POST /clouds/aws/queue/resources/:id/purge
API->>SVC: purgeQueue(cloud, service, id)
SVC->>ADP: purgeQueue(id)
ADP->>SQS: PurgeQueueCommand
SQS-->>UI: ok
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant UI as QueuePanel (React)
participant API as Hono API (:4501)
participant SVC as CloudProxyService
participant ADP as AwsQueueAdapter
participant SQS as SQS / LocalStack (:4566)
UI->>API: POST /clouds/aws/queue/resources/:id/send
API->>SVC: sendQueueMessage(cloud, service, id, body)
SVC->>ADP: sendMessage(id, body)
ADP->>SQS: SendMessageCommand
SQS-->>UI: messageId
UI->>API: POST /clouds/aws/queue/resources/:id/receive
API->>SVC: receiveQueueMessages(...)
SVC->>ADP: receiveMessages(id, 10)
ADP->>SQS: "ReceiveMessageCommand (VisibilityTimeout=0)"
SQS-->>UI: QueueMessage[]
UI->>API: "DELETE /clouds/aws/queue/resources/:id/messages?receiptHandle=rh"
API->>SVC: deleteQueueMessage(..., receiptHandle)
SVC->>ADP: deleteMessage(id, receiptHandle)
ADP->>SQS: DeleteMessageCommand
SQS-->>UI: ok
UI->>API: POST /clouds/aws/queue/resources/:id/purge
API->>SVC: purgeQueue(cloud, service, id)
SVC->>ADP: purgeQueue(id)
ADP->>SQS: PurgeQueueCommand
SQS-->>UI: ok
Reviews (3): Last reviewed commit: "fix(queue): set MessageGroupId for FIFO ..." | Re-trigger Greptile
hectorvent
left a comment
There was a problem hiding this comment.
Thanks @tirthachetry-zoho. The non-consuming receive is exactly right: VisibilityTimeout: 0 with a comment explaining why, and a test pinning it so a refactor can't silently start eating messages. Welcome, and thanks for your first contribution to Floci UI!
Blockers
bun.lockwasn't regenerated. This repo carries two lockfiles (not obvious!), and CI'sbun install --frozen-lockfilewill fail on the new dep. Runningbun installand committing fixes it.resolveQueueUrl()usesdefaultAccountId()and a hardcodedlocalhost:4566fallback, so per-queue operations target the wrong account when the console is switched.GetQueueUrlCommand(or themetadata.queueUrlyou already carry) is the safe path.- FIFO send will fail against real SQS: no
ContentBasedDeduplicationon create and noMessageDeduplicationIdon send. AlsoMessageGroupIdcan end up being a whole URL. - README and
useCloudConsoleHomeData.tsstill show Queue as a placeholder, contradicting the new sidebar entry.
Nits: the {1,75} regex vs the "80 chars" message; canUseRuntime prop for consistency; route-level tests; a screenshot of the panel.
Heads-up on our side: three open PRs currently add SQS. That's a coordination gap on our end, not yours, and we'll resolve it quickly. This one's operation coverage is the broadest of the three. Thanks again!
|
You can do this @tirthachetry-zoho |
Summary
queueCloud Explorer category and Queue sidebar entry (AWS SQS)Validation
pnpm lintpnpm type-checkpnpm test— 171 tests passed (incl. new AwsQueueAdapter delete-message and purge tests)pnpm buildqueueavailable and/cloud-explorer/aws/queuereturns 200