Repository navigation
Conversation
Feat/pgbouncer apikeys
Allow remote-env script to connect to dev env
There was a problem hiding this comment.
Pull request overview
Release PR for Vela 26.1, updating Studio to match new platform resource-limit/allocation endpoints, branch-scoped API keys, and new pg-meta routing requirements.
Changes:
- Introduces new
/resources/{limits|allocations|available}platform proxies and updates org/project resource limit flows to useLimits/Resourcesschemas. - Moves API keys to branch-scoped endpoints and updates related client queries/mutations and API routes.
- Updates pg-meta URL resolution to be branch-aware and forwards encrypted connection info via headers.
Reviewed changes
Copilot reviewed 48 out of 52 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/remote-env | New helper script to fetch remote env vars and configure Keycloak redirect URIs for local Studio dev against remote deployments. |
| packages/api-types/types/platform.d.ts | Updates platform API type definitions for new resource limit/available/allocation endpoints and schemas. |
| packages/api-types/types/api.d.ts | Updates public API types, including branch-scoped API keys routes. |
| examples/auth/nextjs/components/SupabaseLogo.tsx | Removes example logo component file. |
| docker/docker-compose.remote.yml | Adds compose config for running Studio locally against a remote platform deployment. |
| apps/studio/pages/org/[slug]/project/[ref]/resource-limits.tsx | Migrates project resource limits UI to Limits schema and updates payload construction/rounding. |
| apps/studio/pages/new/[slug]/index.tsx | Uses org “available creation resources” for slider maxes and conditionally seeds org limits if unconfigured. |
| apps/studio/pages/api/platform/resources/limits.ts | New authenticated proxy route to platform system resource limits. |
| apps/studio/pages/api/platform/resources/available.ts | New authenticated proxy route to platform system available resources. |
| apps/studio/pages/api/platform/resources/allocations.ts | New authenticated proxy route to platform system resource allocations. |
| apps/studio/pages/api/platform/organizations/[slug]/resources/limits.ts | Updates org limits proxy to new org resource limits endpoints; switches POST→PUT. |
| apps/studio/pages/api/platform/organizations/[slug]/resources/available.ts | Updates org available proxy to new org resource available endpoint. |
| apps/studio/pages/api/platform/organizations/[slug]/resources/allocations.ts | Adds org allocations proxy endpoint. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/types/typescript.ts | Uses branch-resolved pg-meta target and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/resources/limits.ts | Updates project limits proxy to new org/project resource limits endpoints; switches POST→PUT. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/resources/available.ts | Updates project available proxy to new org/project resource available endpoint. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/resources/allocations.ts | Adds project allocations proxy endpoint. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/run-lints/index.ts | Routes lints through branch-resolved pg-meta and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/views.ts | Routes pg-meta “views” via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/types.ts | Routes pg-meta “types” via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/triggers.ts | Routes pg-meta “triggers” via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/tables.ts | Routes pg-meta “tables” via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/query/index.ts | Routes pg-meta SQL queries via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/publications.ts | Routes pg-meta “publications” via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/policies.ts | Routes pg-meta “policies” via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/materialized-views.ts | Routes pg-meta “materialized-views” via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/foreign-tables.ts | Routes pg-meta “foreign-tables” via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/extensions.ts | Routes pg-meta “extensions” via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/meta/column-privileges.ts | Routes pg-meta “column-privileges” via branch-resolved URL and forwards encrypted connection header. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/api-keys/index.ts | Adds branch-scoped API keys proxy routes (GET/POST). |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/branches/[branch]/api-keys/[api_key_id]/index.ts | Adds branch-scoped API keys delete proxy route. |
| apps/studio/lib/api/platformQueryParams.ts | Extends recognized platform query params for API key IDs. |
| apps/studio/lib/api/getPgMetaUrl.ts | Makes pg-meta target resolution async and branch-aware; returns encrypted connection string. |
| apps/studio/data/vela/vela-schema.d.ts | Updates generated Vela OpenAPI schema/types (resources endpoints, API key fields, etc.). |
| apps/studio/data/resource-limits/project-limit-update-mutation.ts | Switches to PUT and sends Limits payload for project limits updates. |
| apps/studio/data/resource-limits/project-available-creation-resources-query.ts | Corrects available-resources query typing to Resources. |
| apps/studio/data/resource-limits/project-allocations-query.ts | Adds project allocations query. |
| apps/studio/data/resource-limits/organization-allocations-query.ts | Adds organization allocations query. |
| apps/studio/data/resource-limits/org-available-creation-resources-query.ts | Corrects org available-resources query typing to Resources. |
| apps/studio/data/resource-limits/keys.ts | Adds cache keys for new system/org/project allocations & available queries. |
| apps/studio/data/resource-limits/branch-slider-resource-limits.ts | Updates branch slider limits logic to new Limits shape and removes array-based limit lookup. |
| apps/studio/data/api-keys/api-keys-query.ts | Updates API keys query to branch-scoped endpoint. |
| apps/studio/data/api-keys/api-key-delete-mutation.ts | Updates API key deletion to branch-scoped endpoint and renames path params. |
| apps/studio/data/api-keys/api-key-create-mutation.ts | Updates API key creation to branch-scoped endpoint. |
| apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx | Refactors PgBouncer settings form and wiring. |
| apps/studio/components/interfaces/Project/ProjectResourcesPanel.tsx | Switches project allocation display from limits-derived to allocations endpoint. |
| apps/studio/components/interfaces/Project/ProjectResourcesBadge.tsx | Switches project allocation badge from limits-derived to allocations endpoint. |
| apps/studio/components/interfaces/Organization/OrganizationResourcesPanel.tsx | Switches org allocation display to allocations endpoint. |
| apps/studio/components/interfaces/Branch/ResizeBranchModal.tsx | Tweaks storage presence logic. |
| apps/studio/components/interfaces/Branch/NewBranchForm.tsx | Improves rounding/step snapping and hides storage controls when storage isn’t available. |
| apps/studio/components/interfaces/Branch/BranchResourceBadge.tsx | Hides resources with max=0 when used is null. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+66
to
+68
| clients = kc_request(f"{kc}/admin/realms/{realm}/clients?clientId=frontend", token) | ||
| client_uuid = clients[0]["id"] | ||
| client = kc_request(f"{kc}/admin/realms/{realm}/clients/{client_uuid}", token) |
Comment on lines
+70
to
+78
| redirect_uri = "http://localhost:3000/*" | ||
| web_origin = "http://localhost:3000" | ||
| if redirect_uri not in client.get("redirectUris", []): | ||
| client["redirectUris"] = sorted(set(client.get("redirectUris", []) + [redirect_uri])) | ||
| client["webOrigins"] = sorted(set(client.get("webOrigins", []) + [web_origin])) | ||
| kc_request(f"{kc}/admin/realms/{realm}/clients/{client_uuid}", token, "PUT", client) | ||
| print(f"Added {redirect_uri} to frontend client.", file=sys.stderr) | ||
| else: | ||
| print(f"{redirect_uri} already present, skipping.", file=sys.stderr) |
| key: 'default_pool_size', | ||
| label: 'Default Pool Size', | ||
| description: 'Number of server connections kept in each pool.', | ||
| docs: 'https://vela.run/docs/guides/database/connection-management#configuring-supavisors-pool-size"', |
Comment on lines
+261
to
+272
| {field.docs && | ||
| <p className="text-sm text-muted-foreground"> | ||
| {field.description} | ||
| <a | ||
| href={field.docs} | ||
| target="_blank" | ||
| rel="noreferrer" | ||
| className="underline" | ||
| > | ||
| Learn more | ||
| </a> | ||
| </p>} |
| path: { | ||
| slug: payload.branch.organization_id, | ||
| ref: payload.branch.project_id, | ||
| branch_id: payload.branch.id |
| path: { | ||
| slug: branch.organization_id, | ||
| ref: branch.project_id, | ||
| branch_id: branch.id |
| return data as ProjectAllocationsData | ||
| } | ||
|
|
||
| export type ProjectAllocationsData = VelaComponents['schemas']['ResourceLimitsPublic'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release PR vela-26.1