Feat/adding UI for aws sqs - #142
Conversation
|
| Filename | Overview |
|---|---|
| packages/api/src/adapter-aws/AwsQueueAdapter.ts | New SQS adapter implementing the full CloudServiceAdapter SPI; correctly handles ListQueues pagination, safe RedrivePolicy parsing, and FIFO messageGroupId enforcement. |
| packages/api/src/adapter-aws/AwsQueueAdapter.test.ts | New test suite covers list (with pagination), create, sendMessage (standard and FIFO), receiveMessages, deleteMessage, purgeQueue, and malformed-RedrivePolicy resilience. |
| packages/frontend/src/components/QueueFlowPanel.tsx | New panel implementing Producer→Queue→Consumer flow diagram, send/receive/delete/purge with FIFO fields, cancel-safe purge confirmation, stable attribute-row keys, and queue-scoped receive mutation with id-based deduplication. |
| packages/frontend/src/api/api.ts | Queue endpoint keys and registry entries added correctly; contains a duplicate registration for the invoke endpoint (lines 222–228 and 254–261) — Map silently deduplicates but the dead entry is misleading. |
| packages/frontend/src/api/cloudProxyClient.ts | Queue client functions added correctly; ServerlessInvokeResult interface is declared twice (lines 116 and 124), which TypeScript merges silently. |
| packages/api/src/routes/clouds.ts | Queue-specific routes added correctly before the generic resource routes; isServiceType guard updated to include 'queue'. |
| packages/api/src/service/CloudProxyService.ts | Four new queue service methods added following the existing optional-method guard pattern. |
| packages/api/src/cloud-spi/queueSchema.ts | New queue schema for AWS; exports both awsQueueSchema() for the adapter and queueSchemaFor(cloud) for the fallback in CloudProxyService. |
| packages/frontend/src/features/cloud-console/useCloudConsoleHomeData.ts | Queue card now correctly fetches live resource count, uses a real route, and the MessageSquare icon; properly gated to AWS-only. |
| packages/api/src/cloudProxy.ts | AwsQueueAdapter registered with account-scoped SQS client following the same pattern as other adapters. |
Reviews (6): Last reviewed commit: "fix: guard receive-mutation against queu..." | Re-trigger Greptile
- list(): follow ListQueuesCommand NextToken instead of dropping queues past the first page - sendMessage(): require messageGroupId for FIFO queues and pass MessageGroupId/MessageDeduplicationId through to SendMessageCommand; QueueFlowPanel now surfaces these fields when a FIFO queue is selected - toResource(): parse RedrivePolicy safely so one malformed policy can't break list()/get() for every queue - QueueFlowPanel: add a Cancel option to the purge confirmation, and key message-attribute rows by a stable id instead of array index
Tie the receive mutation to the queueId it targeted so a slow long-poll response can't leak messages into a different queue's list after the user switches queues mid-request. Also dedupe by the stable message id instead of receiptHandle, which changes on SQS redelivery and let the same message reappear as a false "new" entry.
47fb69e to
5c4782d
Compare
hectorvent
left a comment
There was a problem hiding this comment.
Thanks @ingluisfelipemunoz, and welcome, this is a great first contribution to Floci UI! What stands out is the review-response discipline: every fix across the review rounds landed with a matching regression test (pagination call count, both FIFO paths, malformed RedrivePolicy). That's above the bar.
Blockers (both mechanical)
- This repo carries two lockfiles, which is not discoverable, sorry!
bun.lockwasn't regenerated, which is exactly why both CI jobs die at install before your tests ever run.bun installat the root plus a commit fixes it. - Could you retitle to
feat(sqs): add SQS queue explorer? The title becomes the squash-merge commit, and the CI check only lints commits, so it won't catch this.
Should-fix: sendMessage returns a QueueMessage with receiptHandle: '' and a locally generated sentAt; a narrower SendMessageResult avoids the footgun. Screenshots of the flow panel would help since CI hasn't built the branch. Nits: key the rendered list by message.id; MessageSystemAttributeNames over the deprecated AttributeNames; the api.ts and cloudProxyClient.ts duplicates Greptile flagged are pre-existing on main, not yours to fix.
Heads-up: three open PRs currently add SQS. That's our coordination gap, not yours, and we'll resolve it quickly and fairly. Thanks again!
|
Thanks @hectorvent! |
|
@ingluisfelipemunoz Thank you for the substantial SQS work, especially the QueueFlowPanel, FIFO handling, and message lifecycle controls. We are standardizing the Cloud Explorer on the multi-cloud Would you be interested in opening a new, focused PR that ports the advanced SQS experience from this branch onto the The new PR should build on current
Please avoid restoring the We are closing this PR to avoid maintaining two overlapping implementations, but it will remain available as the reference for the follow-up. Thank you again for the contribution. CC: @hectorvent |
Summary
Adds Amazon SQS as a new Cloud Explorer service (
queue), including adedicated Amazon-Console-style "send and receive messages" flow view.
packages/api): newqueueCloudServiceType,AwsQueueAdapter(
@aws-sdk/client-sqs) implementing list/get/create/delete plussendMessage/receiveMessages/deleteMessage/purgeQueue,queueSchema.ts,and the matching
/api/clouds/aws/services/queue/...routes(
.../messages,.../messages/delete,.../purge). Registered incloudProxy.tsandCloudProxyService.tsfollowing the existing SPI pattern.packages/frontend):queuewired intoCloudServiceType,the Cloud Explorer nav/routing, and
DynamicResourceView. NewQueueFlowPanelcomponent renders a Producer → Queue → Consumer flowdiagram with live message-count badges, animated connectors, a
dead-letter-queue branch when a redrive policy is set, a send-message form
(body + message attributes), and a receive/poll panel with per-message
delete (ack). Also fixed the
queuecard on the Cloud Console home page(
useCloudConsoleHomeData), which previously pointed at a nonexistent/queueroute with a placeholder icon and no resource count.list()now followsListQueuesCommand'sNextTokeninstead of silently dropping queues past the first page;
sendMessagerequires and forwards
MessageGroupId/MessageDeduplicationIdfor FIFOqueues (previously every FIFO send was rejected by SQS), with matching
fields added to
QueueFlowPanel; a malformedRedrivePolicyattribute nolonger throws and breaks
list()/get()for every queue; the purgeconfirmation now has a Cancel option; message-attribute rows are keyed by
a stable id instead of array index; and the receive mutation is now scoped
to the queue it targeted (a stale long-poll response could otherwise leak
messages into a different queue's list) and dedupes by message id instead
of receipt handle (which changes on SQS redelivery).
Closes #77, closes #65
Type of change
fix:)feat:)feat!:orfix!:)Area
packages/frontend)packages/api)Verification
Tested against AWS SQS via a local Floci core (
:4566), both directly viacurlagainst the API routes and end-to-end through the UI:and purged the queue — confirmed message counts (
Available/In flight/Delayed) update on the flow diagram.and routes to
/cloud-explorer/aws/queue..fifoqueue and sendingwithout a
messageGroupIdnow returns400 messageGroupId is required...,and sending with one succeeds (
201).messages: polling renders all received message bodies with their receive
counts, live counts update (
Available/In flight), and deleting amessage removes it from the list while the rest correctly return to
Availableafter their visibility timeout.Checklist
pnpm lint,pnpm type-check,pnpm test, andpnpm buildpass locallybun testinpackages/api)