Skip to content

feat(queue): add SQS queue explorer - #148

Open
tirthachetry-zoho wants to merge 3 commits into
floci-io:mainfrom
tirthachetry-zoho:feat/queue-explorer
Open

feat(queue): add SQS queue explorer#148
tirthachetry-zoho wants to merge 3 commits into
floci-io:mainfrom
tirthachetry-zoho:feat/queue-explorer

Conversation

@tirthachetry-zoho

Copy link
Copy Markdown

Summary

  • add the queue Cloud Explorer category and Queue sidebar entry (AWS SQS)
  • implement SQS queue list, create, delete, inspect, send, non-consuming receive (peek), delete-message, and purge operations through the cloud SPI
  • add queue schema, capabilities/actions, normalized resource metadata, and adapter/route coverage
  • fix queue message receive 404 by treating receive as a non-consuming peek (VisibilityTimeout 0) and resolving full queue URLs as the resource id

Validation

  • pnpm lint
  • pnpm type-check
  • pnpm test — 171 tests passed (incl. new AwsQueueAdapter delete-message and purge tests)
  • pnpm build
  • HTTP smoke check: AWS services reports queue available and /cloud-explorer/aws/queue returns 200

@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a complete AWS SQS queue explorer to the Cloud Explorer, following the existing multi-cloud SPI pattern end-to-end: schema, adapter, service-layer methods, HTTP routes, frontend client functions, and a dedicated QueuePanel component.

  • Backend: AwsQueueAdapter implements list, create (with FIFO auto-suffix normalization and MessageGroupId derivation), delete, get, send, non-consuming receive (VisibilityTimeout=0 peek), deleteMessage, and purge. Four new Hono routes delegate to new CloudProxyService methods. The adapter is registered in cloudProxy.ts and isServiceType is extended.
  • Frontend: QueuePanel manages per-message delete state via a Set<string> of in-flight receipt handles, resets state on queue navigation, and uses useQuery for the message list. The Queue nav entry is wired in Layout.tsx for AWS only, and normalizeService is extended.
  • Tests: 14 new unit tests cover all adapter operations including FIFO edge cases (auto-suffix, double-suffix prevention, MessageGroupId injection/omission).

Confidence Score: 5/5

Safe to merge; all operations are wired correctly through the multi-cloud SPI and no data-loss or functional regressions are introduced.

The implementation follows the established schema-driven pattern faithfully. FIFO handling (auto-suffix, MessageGroupId) is correct and covered by tests. Per-message delete state is tracked per-handle rather than globally. The two findings are minor polish items — a pagination gap in ListQueues (benign at typical LocalStack queue counts) and an inconsistent runtimeReachable vs canUseRuntime prop that is practically equivalent because the queue adapter is always registered.

No files require special attention for merging; the pagination suggestion in AwsQueueAdapter.ts and the prop inconsistency in DynamicResourceView.tsx are quality improvements that can be addressed as follow-ups.

Important Files Changed

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
Loading
%%{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
Loading

Reviews (3): Last reviewed commit: "fix(queue): set MessageGroupId for FIFO ..." | Re-trigger Greptile

Comment thread packages/api/src/cloud-spi/queueSchema.ts
Comment thread packages/api/src/adapter-aws/AwsQueueAdapter.ts Outdated
Comment thread packages/frontend/src/components/QueuePanel.tsx
Comment thread packages/api/src/adapter-aws/AwsQueueAdapter.ts

@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 @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.lock wasn't regenerated. This repo carries two lockfiles (not obvious!), and CI's bun install --frozen-lockfile will fail on the new dep. Running bun install and committing fixes it.
  • resolveQueueUrl() uses defaultAccountId() and a hardcoded localhost:4566 fallback, so per-queue operations target the wrong account when the console is switched. GetQueueUrlCommand (or the metadata.queueUrl you already carry) is the safe path.
  • FIFO send will fail against real SQS: no ContentBasedDeduplication on create and no MessageDeduplicationId on send. Also MessageGroupId can end up being a whole URL.
  • README and useCloudConsoleHomeData.ts still 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!

@jfpalacios

Copy link
Copy Markdown

You can do this @tirthachetry-zoho

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.

4 participants