Repository navigation
Conversation
fix legacy api keys screen and pg bouncer patch update
commented out a description on project create screen
There was a problem hiding this comment.
Pull request overview
Release PR for Vela 26.2, updating Studio + API types to support new resource-limit semantics (project branch maxima), PITR branch creation flag, and API key display sourcing.
Changes:
- Add “project branch maxima” endpoint/types and new React Query hook, and update branch resize UI logic to use it.
- Update resource allocation typing to use
Resourcesand adjust resource-limit query keys accordingly (removing old effective-branch-limits query). - Add non-prod “point-in-time recovery” flag to branch creation and switch Project Settings API key display to use the API keys query.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/api-types/types/platform.d.ts | Adds /resources/branch-maxima platform path + operation typing. |
| apps/studio/pages/new/[slug]/index.tsx | Comments out billing/usage notice block in new project flow. |
| apps/studio/pages/api/platform/organizations/[slug]/projects/[ref]/resources/branch-maxima.ts | Adds API route proxying to Vela branch-maxima endpoint. |
| apps/studio/data/vela/vela-schema.d.ts | Adds Vela OpenAPI schema entries for branch-maxima operation. |
| apps/studio/data/resource-limits/project-allocations-query.ts | Updates allocations type to Resources. |
| apps/studio/data/resource-limits/keys.ts | Replaces branch-effective-limits key with projectBranchMaxima key. |
| apps/studio/data/resource-limits/effective-branch-limits-query.ts | Removes old effective branch limits query hook. |
| apps/studio/data/resource-limits/branch-maxima-query.ts | Adds React Query hook for project branch maxima. |
| apps/studio/data/branches/branch-create-mutation.ts | Adds pitr_enabled support (non-prod gated). |
| apps/studio/data/api-keys/api-keys-query.ts | Exports APIKey type for reuse. |
| apps/studio/components/ui/ProjectSettings/DisplayApiSettings.utils.ts | Updates “last used API keys” logic to use name and dayjs duration plugin. |
| apps/studio/components/ui/ProjectSettings/DisplayApiSettings.tsx | Switches API key display to use useAPIKeysQuery as source of truth. |
| apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx | Adjusts RHF number input wiring + docs link rendering. |
| apps/studio/components/interfaces/Branch/ResizeBranchModal.tsx | Replaces effective-branch-limits with branch-maxima + project available resources for slider ceilings. |
| apps/studio/components/interfaces/Branch/NewBranchForm.tsx | Adds non-prod PITR checkbox + passes through to branch creation mutation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!s) return false | ||
| return getEffectiveMax(rk as ResourceType, s) < s.max | ||
| }) | ||
| }, [sliderSpecs, branchMaxima, projectAvailable]) |
There was a problem hiding this comment.
hasEffectiveLimits uses getEffectiveMax, which reads branchMax to compute the project quota ceiling. Since branchMax is not included in this useMemo dependency array, the warning state can be incorrect after branch size changes. Include branchMax (and any other captured values) in the dependency list so the memo recomputes correctly.
| }, [sliderSpecs, branchMaxima, projectAvailable]) | |
| }, [specs, sliderSpecs, branchMax, branchMaxima, projectAvailable]) |
| @@ -994,7 +994,7 @@ const CreateProjectPage: NextPageWithLayout = () => { | |||
| </Link> | |||
| . | |||
| </p> | |||
| </div> | |||
| </div> */} | |||
There was a problem hiding this comment.
This billing/usage notice block has been commented out rather than removed or feature-flagged. Leaving large commented JSX in the main page path makes the code harder to maintain and can lead to accidental reintroduction. Prefer deleting it (if no longer needed) or gating it behind an explicit flag/condition with a brief comment explaining why it’s hidden.
| const ramInfo = useMemo(() => { | ||
| const s = sliderSpecs.ram | ||
| if (!s) return null | ||
| const usageDisplay = ramUsageBytes ? ramUsageBytes / s.divider : undefined | ||
| const minDisplay = getEffectiveMin('ram', s) | ||
| const maxDisplay = getEffectiveMax('ram', s) | ||
| return { | ||
| usageDisplay, | ||
| minDisplay, | ||
| maxDisplay, | ||
| unit: s.unit, | ||
| } | ||
| }, [sliderSpecs, ramUsageBytes, effectiveBranchLimits]) | ||
| }, [sliderSpecs, ramUsageBytes, branchMaxima, projectAvailable]) |
There was a problem hiding this comment.
The ramInfo memo depends on getEffectiveMax/getEffectiveMin, which in turn uses branchMax (via the quota ceiling calculation). branchMax is not included in this useMemo dependency list, so ramInfo.maxDisplay can become stale when the branch’s current resources change. Add branchMax (and any other referenced values) to the dependency array, or refactor the calculation to avoid capturing external state.
Release PR Vela-26.2