Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a marketplace integration system and refactors the Integrations UI. New data layer: typed marketplace client, marketplace types, React Query helpers (integrations + categories) and query keys. Introduces Sequence DiagramsequenceDiagram
participant Page as Integration Page
participant Hook as useAvailableIntegrations
participant Flags as FeatureFlagContext
participant Query as React Query
participant Client as createMarketplaceClient
participant DB as Marketplace DB
participant Transform as Transformer
participant UI as ProjectIntegrationsLayout
Page->>Hook: invoke to load available integrations
Hook->>Flags: check marketplace feature flag
Flags-->>Hook: flag value
alt marketplace enabled
Hook->>Query: run marketplaceIntegrationsQueryOptions
Query->>Client: create client & request integrations
Client->>DB: query items (+ categories)
DB-->>Client: return rows
Client-->>Query: return marketplace data
Query-->>Hook: provide query result
Hook->>Transform: map rows -> IntegrationDefinition[]
Transform-->>Hook: transformed integrations
Hook->>Hook: combine with local INTEGRATIONS, filter & sort
else marketplace disabled
Hook->>Hook: use local INTEGRATIONS only
end
Hook-->>Page: return allIntegrations + state flags
Page->>UI: render layout and pages (Overview, FilesViewer, listings)
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. Comment |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/studio/components/interfaces/Integrations/Landing/AvailableIntegrations.tsx (1)
42-45:⚠️ Potential issue | 🟠 MajorCategory tabs exclude marketplace integrations.
useAvailableIntegrations()adds partner items with category slugs, but this filter only matchesi.type. For marketplace entries,typeis notwrapper/postgres_extension, so the "Wrappers" and "Postgres Modules" tabs can never show them.Suggested fix
const integrationsByCategory = selectedCategory === 'all' ? availableIntegrations - : availableIntegrations.filter((i) => i.type === selectedCategory) + : availableIntegrations.filter( + (i) => i.type === selectedCategory || i.categories?.includes(selectedCategory) + )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/studio/components/interfaces/Integrations/Landing/AvailableIntegrations.tsx` around lines 42 - 45, The category filter in integrationsByCategory only checks i.type and thus excludes marketplace/partner items that use a category slug; update the filter expression (the integrationsByCategory computation) to include marketplace category fields by checking i.type === selectedCategory OR i.category === selectedCategory OR i.categorySlug === selectedCategory (or whichever partner property useAvailableIntegrations adds), so partner/marketplace entries appear in the "Wrappers" and "Postgres Modules" tabs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTabV2/index.tsx`:
- Line 29: The code computes siteUrlLabel with new URL(siteUrl) which will throw
for malformed URLs; update the logic around the siteUrlLabel variable
(referencing siteUrlLabel and siteUrl) to safely parse the origin — wrap the new
URL(siteUrl) call in a try-catch (or use a safe parsing utility) and fall back
to undefined (or a sanitized value) when parsing fails so the page cannot crash
on invalid siteUrl values.
In `@apps/studio/pages/project/`[ref]/integrations/index.tsx:
- Around line 50-51: The page currently gates rendering of the integrations
catalog on useInstalledIntegrations() (installedIntegrations,
isLoading/isError/isSuccess) which hides availableIntegrations cards when the
installed-status query fails; change the control flow so the catalog rendering
and loading/error state come from useAvailableIntegrations() (use
data/isLoading/isError/isSuccess from useAvailableIntegrations) and treat
useInstalledIntegrations() as best-effort only for badge/status decoration
(merge installedIntegrations results into the availableIntegrations items when
available, but do not block or show global error UI if installed query errors).
Update the same wiring in the AvailableIntegrations component
(Landing/AvailableIntegrations.tsx) to rely on useAvailableIntegrations for
primary UI gating and only apply useInstalledIntegrations for optional
badge/state enrichment.
---
Outside diff comments:
In
`@apps/studio/components/interfaces/Integrations/Landing/AvailableIntegrations.tsx`:
- Around line 42-45: The category filter in integrationsByCategory only checks
i.type and thus excludes marketplace/partner items that use a category slug;
update the filter expression (the integrationsByCategory computation) to include
marketplace category fields by checking i.type === selectedCategory OR
i.category === selectedCategory OR i.categorySlug === selectedCategory (or
whichever partner property useAvailableIntegrations adds), so
partner/marketplace entries appear in the "Wrappers" and "Postgres Modules"
tabs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Repository UI (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: f1428017-8d80-4a92-ad32-438477673e84
📒 Files selected for processing (17)
apps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTabV2/FilesViewer.tsxapps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTabV2/index.tsxapps/studio/components/interfaces/Integrations/Landing/AvailableIntegrations.tsxapps/studio/components/interfaces/Integrations/Landing/Integrations.constants.tsxapps/studio/components/interfaces/Integrations/Landing/useAvailableIntegrations.tsxapps/studio/components/interfaces/Integrations/Landing/useInstalledIntegrations.tsxapps/studio/components/layouts/Integrations/layout.tsxapps/studio/components/layouts/ProjectIntegrationsLayout.tsxapps/studio/data/marketplace/integration-categories-query.tsapps/studio/data/marketplace/integrations-query.tsapps/studio/data/marketplace/keys.tsapps/studio/data/marketplace/marketplace-client.tsapps/studio/data/marketplace/marketplace.types.tsapps/studio/pages/project/[ref]/integrations/[id]/[pageId]/[childId]/index.tsxapps/studio/pages/project/[ref]/integrations/[id]/[pageId]/index.tsxapps/studio/pages/project/[ref]/integrations/[id]/index.tsxapps/studio/pages/project/[ref]/integrations/index.tsx
💤 Files with no reviewable changes (2)
- apps/studio/components/interfaces/Integrations/Landing/useInstalledIntegrations.tsx
- apps/studio/components/layouts/Integrations/layout.tsx
🎭 Playwright Test ResultsDetails
Flaky testsFeatures › realtime-inspector.spec.ts › Realtime Inspector › Broadcast Messages › broadcast modal validates JSON payload Skipped testsFeatures › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/studio/components/layouts/ProjectIntegrationsLayout.tsx`:
- Around line 72-82: ProjectIntegrationsLayout has a plural slug mismatch: the
menu entry uses url `?category=wrappers` and pages
`integrations?category=wrapper` while the integrations page logic
(selectedCategory / filter i.type === selectedCategory in
apps/studio/pages/project/[ref]/integrations/index.tsx) expects the singular
`wrapper`; update the ProjectIntegrationsLayout entry (name/key/url/pages) to
use the singular `wrapper` consistently (align url query and pages to
`category=wrapper`) so selectedCategory matches i.type and the Wrappers view
loads correctly.
In
`@apps/studio/pages/project/`[ref]/integrations/[id]/[pageId]/[childId]/index.tsx:
- Around line 27-32: The crash occurs because allIntegrations (from
useAvailableIntegrations) can be undefined while loading; update the useMemo
that computes integration to guard against that by treating allIntegrations as
an empty array when undefined (e.g., use optional chaining or a default []
before calling .find). Locate the integration useMemo in the component (the
block using useMemo, allIntegrations and id) and change the dependency callback
to safely handle undefined allIntegrations so .find is never invoked on
undefined.
In `@apps/studio/pages/project/`[ref]/integrations/[id]/[pageId]/index.tsx:
- Around line 48-56: The integration lookup crashes because allIntegrations can
be undefined while loading; update the useMemo for integration (the variable
named integration) to guard against undefined allIntegrations by either
defaulting it to an empty array or using optional chaining before calling .find
(i.e., reference allIntegrations?.find(...) or use (allIntegrations || [])
inside useMemo) and keep the same dependency array [allIntegrations, id] to
avoid UI resets.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Repository UI (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: bff27f6a-a16b-474a-bad0-9efe75aa7429
📒 Files selected for processing (5)
apps/studio/components/layouts/ProjectIntegrationsLayout.tsxapps/studio/pages/project/[ref]/integrations/[id]/[pageId]/[childId]/index.tsxapps/studio/pages/project/[ref]/integrations/[id]/[pageId]/index.tsxapps/studio/pages/project/[ref]/integrations/[id]/index.tsxapps/studio/pages/project/[ref]/integrations/index.tsx
…ntegrations-into-project
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
apps/studio/components/layouts/ProjectIntegrationsLayout.tsx (1)
76-84:⚠️ Potential issue | 🟠 MajorUse the singular
wrapperslug here.Line 81 still links to
category=wrappers, butapps/studio/pages/project/[ref]/integrations/index.tsxmatcheswrapperat Lines 66 and 94. That leaves the Wrappers view empty even though wrapper integrations exist.Proposed fix
...(showWrappers ? [ { name: 'Wrappers', - key: 'wrappers', - url: `/project/${ref}/integrations?category=wrappers`, + key: 'wrapper', + url: `/project/${ref}/integrations?category=wrapper`, items: [], }, ] : []),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/studio/components/layouts/ProjectIntegrationsLayout.tsx` around lines 76 - 84, The "Wrappers" tab URL uses the plural slug `category=wrappers` which doesn't match the integrations page expecting the singular `wrapper`; update the URL string in the ProjectIntegrationsLayout component where the tab object is built (the object with name: 'Wrappers', key: 'wrappers', url: `/project/${ref}/integrations?category=wrappers`) to use `category=wrapper` so it matches the routing logic in the integrations page and surfaces existing wrapper integrations.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTabV2/index.tsx`:
- Around line 23-24: The code calls useAvailableIntegrations() and immediately
does allIntegrations.find(...) which will crash if data is undefined; update the
destructuring or usage so allIntegrations defaults to an empty array (e.g.,
const { data: allIntegrations = [] } = useAvailableIntegrations()) or guard
before using .find, then compute integration = (allIntegrations || []).find(i =>
i.id === id); ensure you change references to useAvailableIntegrations,
allIntegrations, and integration so .find is never invoked on undefined.
In `@apps/studio/components/layouts/ProjectIntegrationsLayout.tsx`:
- Around line 61-66: The current logic in ProjectIntegrationsLayout ties
rendering of the entire Explore sidebar to isSuccessCategories via the isSuccess
and isLoading flags, which causes the whole menu (including static entries like
All, Wrappers, Postgres Modules) to disappear when marketplace category fetch
fails; update the logic so only marketplace-specific entries are gated by
isSuccessCategories/isPendingCategories: keep the Explore/sidebar rendering
unconditional when isMarketplaceEnabled is true (or when not on platform), and
move the isSuccessCategories check into the conditional that renders
marketplace-dependent items (references: isLoading, isSuccess,
isMarketplaceEnabled, isSuccessCategories, isPendingCategories and the sidebar
render block inside ProjectIntegrationsLayout that currently returns nothing
when the category fetch fails). Ensure static menu items render regardless of
category fetch outcome and only the marketplace list shows a loading/error state
when isPendingCategories/isSuccessCategories indicates failure.
---
Duplicate comments:
In `@apps/studio/components/layouts/ProjectIntegrationsLayout.tsx`:
- Around line 76-84: The "Wrappers" tab URL uses the plural slug
`category=wrappers` which doesn't match the integrations page expecting the
singular `wrapper`; update the URL string in the ProjectIntegrationsLayout
component where the tab object is built (the object with name: 'Wrappers', key:
'wrappers', url: `/project/${ref}/integrations?category=wrappers`) to use
`category=wrapper` so it matches the routing logic in the integrations page and
surfaces existing wrapper integrations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Repository UI (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: cf19cceb-0595-409a-92af-496d54aa79c1
📒 Files selected for processing (4)
apps/studio/components/interfaces/Integrations/Integration/IntegrationOverviewTabV2/index.tsxapps/studio/components/interfaces/Integrations/Landing/useAvailableIntegrations.tsxapps/studio/components/layouts/ProjectIntegrationsLayout.tsxapps/studio/pages/project/[ref]/integrations/index.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/studio/components/interfaces/Integrations/Landing/useAvailableIntegrations.tsx
…ntegrations-into-project
charislam
left a comment
There was a problem hiding this comment.
Status quo and CLI look good! 👍🏼
The only thing I still can't get working is seeing observability/Grafana. I looked through all the network requests and can't find the ones that fetch from the marketplace project tables
Going to approve to unblock though since this is feature-flagged and status quo is good anyway
…ntegrations-into-project
Braintrust eval report
|


Context
Initial ground work for Marketplace Integrations (feature flagged under the flag
marketplaceIntegrations), in which some integrations will be fetched over a network request (than hard-coded within the repo). Feature flag just controls whether to we need to fetch them.Similarly, categories under "Explore" will also be fetched, and the flag just decides whether that should be enabled.
We're also planning to update the overview tab for integrations as well, in which integrations fetched over the network request will use the new UI (altho not functional just yet)
To test
Note that the LOC changes are seemingly large, but that's just because I've added in a types file for the Supabase project that we're using to store the integrations data