Skip to content

Read Supabase projects, logs and insights through the distilled SDK - #2859

Merged
Makisuo merged 1 commit into
mainfrom
t3/distilled-supabase
Nov 19, 2026
Merged

Makisuo merged 1 commit into
mainfrom
t3/distilled-supabase

Conversation

@Makisuo

@Makisuo Makisuo commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Stacked on #2858. Moves the Supabase Management API reads onto @distilled.cloud/supabase, through the vendor-sdk adapter from #2858.

What changed

  • Through the SDK: organizations, projects, project logs, the performance and security advisors, and the read-only pg_stat_statements query. Each keeps its own schema decode, error type and messages, so callers and the services' tests are unchanged.
  • Still plain HTTP: the OAuth revoke (it sends no bearer, and the SDK always adds one) and the three v2 log drain calls (not in the SDK's spec).
  • Adapter, rateLimitResetHeader: Supabase sends its 429 wait as x-ratelimit-reset, which the SDK does not read. The adapter copies it into retry-after before the SDK sees the answer, so the poller's back-off still gets the wait, as vendor-http did.
  • Adapter, empty error bodies: the SDK fills in HTTP <status> when a refusal has no message. That is no longer kept as the vendor's message, so Supabase's "the OAuth app may be missing a scope" hint on a bare 403 still shows.
  • The Supabase modules themselves shrink slightly (each call is now one typed operation, no hand-built paths or JSON parsing).

Behaviour to know about

  • The read-only query is still retried on a passing failure like a read, as before.
  • logsQueryRequest now returns the SDK input (ref, sql and the two timestamps) instead of a path and query; its unit test follows. The logs service test still checks the SQL sent over the wire.
  • Spans: each call gets the SDK's span, which records the path template, never the query string (the logs SQL travels in the query).

Bundle

Verification

  • vendor-sdk.test.ts gains two cases: a 429 whose wait comes in x-ratelimit-reset, and a 403 with an empty body keeping no message.
  • The Supabase service suites pass unchanged, including 429s on projects, logs and advisors.
  • vitest over services/integrations and services/cost: 1,628 passed.
  • packages/backend typecheck: no errors. oxlint -c .oxlintrc.effect.json and oxfmt on every changed file: clean.

No UI change, so no screenshots.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Devin Review

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@maple-review-bot

This comment has been minimized.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

@Makisuo
Makisuo force-pushed the t3/distilled-vercel branch from 91a3349 to 47810fd Compare November 19, 2026 14:28
@Makisuo
Makisuo force-pushed the t3/distilled-supabase branch from ea29ecc to 7a781e7 Compare November 19, 2026 14:30
@maple-review-bot

This comment has been minimized.

@Makisuo
Makisuo force-pushed the t3/distilled-vercel branch from 47810fd to 264743b Compare November 19, 2026 15:15
Base automatically changed from t3/distilled-vercel to main November 19, 2026 15:16
…illed SDK

Organizations, projects, project logs, the advisors and the read-only
query go through @distilled.cloud/supabase on the vendor-sdk adapter. The
OAuth revoke (sends no bearer) and the v2 log drains (not in the spec) stay
on plain HTTP.

The adapter gains rateLimitResetHeader: Supabase sends its 429 wait as
x-ratelimit-reset, which the SDK does not read, so it is copied into
retry-after before the SDK sees the answer. The SDK's `HTTP <status>`
stand-in for an empty error body is no longer kept as the vendor message.
@Makisuo
Makisuo force-pushed the t3/distilled-supabase branch from 7a781e7 to 3b05549 Compare November 19, 2026 15:17
@Makisuo
Makisuo merged commit 526f3aa into main Nov 19, 2026
@Makisuo
Makisuo deleted the t3/distilled-supabase branch November 19, 2026 15:17
@maple-review-bot

maple-review-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge. The SDK swap keeps each schema, error type and status classification, and the 429 back-off path is pinned by both the new adapter test and the existing Supabase service suite.
no findings · tests covered · risk medium · 1/1 new units observable

Moves Supabase organizations, projects, advisors, the read-only query and project logs onto @distilled.cloud/supabase through the vendor-sdk adapter, adding a rateLimitResetHeader option so a 429 wait still reaches the poller. The migration is faithful; safe to merge.

  • supabaseSdk reads orgs, projects, advisors, queries and logs through the SDK, plain HTTP only for the OAuth revoke and v2 log drains
  • VendorSdk copies x-ratelimit-reset into retry-after on a 429 that lacks it
  • vendor-sdk no longer keeps the SDK's HTTP <status> placeholder as the vendor's message
  • logsQueryRequest returns the SDK input (ref, sql, two timestamps)

3b05549 · What was checked, coverage and telemetry details are on the Maple / review check. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@maple-review-bot

Copy link
Copy Markdown

Maple: after this shipped

✅ Shipped clean. Nothing this change touches got worse in the hour after it deployed.

Deployed at 2026-11-19 15:46 UTC as 1051642, the first version after the merge (the merge commit itself never reported). Compared the 60 minutes before and after.

  • 5 operations compared, 0 regressed

Details are in Maple. A public repository's comment names no service, operation or error.

@maple-review-bot

Copy link
Copy Markdown

Maple: after this shipped

✅ Shipped clean. Nothing this change touches got worse in the hour after it deployed.

Deployed at 2026-11-19 15:46 UTC as 1051642, the first version after the merge (the merge commit itself never reported). Compared the 60 minutes before and after.

  • 5 operations compared, 0 regressed

Details are in Maple. A public repository's comment names no service, operation or error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant