Repository navigation
Conversation
|
Thanks for contributing to Supabase! ❤️ Our team will review your PR. A few tips for a smoother review process:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@kallebysantos is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughAdds self‑hosted edge function retrieval and a GET API route by slug, a filesystem lookup method, removes IS_PLATFORM gating from query enabling, and introduces platform-aware UI/permisssion gating across studio edge-function components. Changes
Sequence Diagram(s)sequenceDiagram
participant Browser as Browser
participant NextAPI as Next.js API
participant FS as FileSystemFunctionsArtifactStore
Browser->>NextAPI: GET /api/v1/projects/:ref/functions/:slug
Note right of NextAPI: handlerWithErrorCatching -> GET branch
NextAPI->>FS: getFunctionBySlug(slug)
FS-->>NextAPI: FunctionArtifact or undefined
alt Function found
NextAPI-->>Browser: 200 JSON (FunctionResponse)
else Not found
NextAPI-->>Browser: 404 Not Found
end
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/studio/pages/project/`[ref]/functions/[functionSlug]/index.tsx:
- Around line 69-71: The redirect currently calls router.push inside render when
!IS_PLATFORM (using router, projectRef, functionSlug from useParams); move that
side-effect into a useEffect hook: create a useEffect that depends on
IS_PLATFORM, router, projectRef, and functionSlug, check IS_PLATFORM === false
and that projectRef and functionSlug are defined before calling
router.push(`/project/${projectRef}/functions/${functionSlug}/details`), and
during render return null or a placeholder while projectRef/functionSlug are
undefined to avoid invoking router.push during render.
| </PageSectionContent> | ||
| </PageSection> | ||
|
|
||
| <ConfirmationModal |
There was a problem hiding this comment.
I think this was deleted by accident
| const router = useRouter() | ||
| const { ref: projectRef, functionSlug } = useParams() | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
This will lead to a brief flash of the wrong page
Braintrust eval report
|
Functions page on self-hosted differs from Platform Adds the possibility to see function details page in Self-Host version. ## Summary by CodeRabbit * **New Features** * Edge function detail lookup added for self‑hosted deployments (new retrieval endpoint & store method). * Consistent navigation to function pages from the functions list. * **Improvements** * UI tabs, download, and test controls adapt to deployment type. * Region, JWT verification, local development, and delete controls shown only on the platform. * Edit/save/delete controls enable/disable correctly based on deployment and permissions. * Function details load reliably across deployments.
…nments (#42992) Feature ## What is the current behavior? The Functions counter on the Home page is only displayed in platform environments. In self-hosted setups, the counter is hidden due to a platform guard, even though Functions may be available. ## What is the new behavior? The Functions counter is now also displayed in self-hosted environments. This is now possible thanks to the following PRs: - #40690 - #42322 - #42349 - #42350 These PRs introduce and enable the API required for listing Functions in Studio, making it feasible to show the Functions count outside of the platform environment. ## Additional context Related issues: #36285 This change removes the platform-only restriction around the Functions card in the Home interface, allowing feature parity between platform and self-hosted deployments where the Functions API is available. --------- Co-authored-by: Andrey A. <[email protected]> Co-authored-by: Charis Lam <[email protected]>
What kind of change does this PR introduce?
Feature
What is the current behavior?
Functions page on self-hosted differs from Platform
What is the new behavior?
Adds the possibility to see function details page in Self-Host version.
Details
Summary by CodeRabbit
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.