Skip to content

Feat/adding UI for aws sqs - #142

Closed
ingluisfelipemunoz wants to merge 9 commits into
floci-io:mainfrom
ingluisfelipemunoz:feat/adding-ui-for-aws-sqs
Closed

Feat/adding UI for aws sqs#142
ingluisfelipemunoz wants to merge 9 commits into
floci-io:mainfrom
ingluisfelipemunoz:feat/adding-ui-for-aws-sqs

Conversation

@ingluisfelipemunoz

@ingluisfelipemunoz ingluisfelipemunoz commented Jul 18, 2026

Copy link
Copy Markdown

Summary

Adds Amazon SQS as a new Cloud Explorer service (queue), including a
dedicated Amazon-Console-style "send and receive messages" flow view.

  • Backend (packages/api): new queue CloudServiceType, AwsQueueAdapter
    (@aws-sdk/client-sqs) implementing list/get/create/delete plus
    sendMessage/receiveMessages/deleteMessage/purgeQueue, queueSchema.ts,
    and the matching /api/clouds/aws/services/queue/... routes
    (.../messages, .../messages/delete, .../purge). Registered in
    cloudProxy.ts and CloudProxyService.ts following the existing SPI pattern.
  • Frontend (packages/frontend): queue wired into CloudServiceType,
    the Cloud Explorer nav/routing, and DynamicResourceView. New
    QueueFlowPanel component renders a Producer → Queue → Consumer flow
    diagram 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 queue card on the Cloud Console home page
    (useCloudConsoleHomeData), which previously pointed at a nonexistent
    /queue route with a placeholder icon and no resource count.
  • Review fixes: list() now follows ListQueuesCommand's NextToken
    instead of silently dropping queues past the first page; sendMessage
    requires and forwards MessageGroupId/MessageDeduplicationId for FIFO
    queues (previously every FIFO send was rejected by SQS), with matching
    fields added to QueueFlowPanel; a malformed RedrivePolicy attribute no
    longer throws and breaks list()/get() for every queue; the purge
    confirmation 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

  • Bug fix (fix:)
  • New feature / service UI (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

Area

  • Frontend (packages/frontend)
  • API / Cloud Proxy (packages/api)
  • Cloud Explorer adapter / schema
  • Build / CI / Docker

Verification

Tested against AWS SQS via a local Floci core (:4566), both directly via
curl against the API routes and end-to-end through the UI:

  • Created a queue, sent a message, polled/received it, deleted (acked) it,
    and purged the queue — confirmed message counts (Available/In flight/
    Delayed) update on the flow diagram.
  • Verified the Cloud Console home page's Queue card now shows a live count
    and routes to /cloud-explorer/aws/queue.
  • Verified the FIFO fix directly: creating a .fifo queue and sending
    without a messageGroupId now returns 400 messageGroupId is required...,
    and sending with one succeeds (201).
  • Verified the receive-mutation fix against a queue pre-loaded with several
    messages: polling renders all received message bodies with their receive
    counts, live counts update (Available/In flight), and deleting a
    message removes it from the list while the rest correctly return to
    Available after their visibility timeout.

Checklist

  • pnpm lint, pnpm type-check, pnpm test, and pnpm build pass locally
  • New or updated tests added where it makes sense (bun test in packages/api)
  • No fake/mock data added — unwired states stay empty or show an explicit placeholder
  • Commit messages / PR title follow Conventional Commits

@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds Amazon SQS as a new Cloud Explorer service, following the existing schema-driven multi-cloud SPI pattern end-to-end. All previously identified review issues have been addressed in this revision.

  • Backend: New AwsQueueAdapter handles list (with NextToken pagination), get, create, delete, sendMessage (with FIFO MessageGroupId/MessageDeduplicationId enforcement), receiveMessages, deleteMessage, and purgeQueue; malformed RedrivePolicy is safely parsed with parseJsonSafe; the adapter is registered in cloudProxy.ts and new queue-specific routes are wired into clouds.ts.
  • Frontend: New QueueFlowPanel renders the Producer → Queue → Consumer flow diagram with live message-count badges, a DLQ branch, send/receive/delete/purge forms (including FIFO fields), correct queue-scoped receive mutation that discards stale in-flight responses, and message deduplication by stable message id; the Cloud Console home page Queue card now routes correctly with a live count.

Confidence Score: 5/5

Safe to merge. All previously flagged issues have been addressed; the two remaining findings are redundant code with no runtime impact.

The adapter, routes, service layer, and frontend panel are all correctly wired end-to-end. Pagination, FIFO enforcement, malformed-JSON resilience, queue-scoped mutation, and message deduplication by stable id are all in place and covered by tests. The only remaining observations are a dead duplicate endpoint registration and a duplicate interface declaration, neither of which affects behavior.

Files Needing Attention: packages/frontend/src/api/api.ts (duplicate invoke endpoint registration) and packages/frontend/src/api/cloudProxyClient.ts (duplicate ServerlessInvokeResult declaration) are worth a quick cleanup pass.

Important Files Changed

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

Comment thread packages/api/src/adapter-aws/AwsQueueAdapter.ts
Comment thread packages/api/src/adapter-aws/AwsQueueAdapter.ts Outdated
Comment thread packages/frontend/src/components/QueueFlowPanel.tsx
Comment thread packages/frontend/src/components/QueueFlowPanel.tsx
Comment thread packages/api/src/adapter-aws/AwsQueueAdapter.ts Outdated
Comment thread packages/api/src/adapter-aws/AwsQueueAdapter.ts
Comment thread packages/frontend/src/components/QueueFlowPanel.tsx Outdated
- 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
Comment thread packages/frontend/src/components/QueueFlowPanel.tsx
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.
@ingluisfelipemunoz
ingluisfelipemunoz force-pushed the feat/adding-ui-for-aws-sqs branch 2 times, most recently from 47fb69e to 5c4782d Compare July 25, 2026 01:25

@hectorvent hectorvent 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.

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.lock wasn't regenerated, which is exactly why both CI jobs die at install before your tests ever run. bun install at 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!

@ingluisfelipemunoz

Copy link
Copy Markdown
Author

Thanks @hectorvent!
Will address those issues

@fredpena

Copy link
Copy Markdown
Contributor

@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 messaging category, which is being introduced through #157 alongside Azure Service Bus and GCP Pub/Sub. This PR is based on the older queue category and would require a broad migration to merge safely.

Would you be interested in opening a new, focused PR that ports the advanced SQS experience from this branch onto the messaging architecture?

The new PR should build on current main after #157 lands, reuse the AwsSqsAdapter, and focus on:

  • send message
  • receive/peek and acknowledge/delete
  • purge with confirmation
  • FIFO message fields
  • DLQ and message-count visualization

Please avoid restoring the queue catalog entry, route, or navigation. The new UI should live under Cloud Explorer → AWS → Messaging.

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

@fredpena fredpena closed this Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(aws): SQS in Cloud Explorer foundation: add queue service-type category

3 participants