chore: disk size config entitlement by ignaciodob ¡ Pull Request #43301 ¡ supabase/supabase

No actionable comments were generated in the recent review. 🎉

â„šī¸ Recent review info

Configuration used: Central YAML (base), Repository UI (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Cache: Disabled due to Reviews > Disable Cache setting

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

đŸ“Ĩ Commits

Reviewing files that changed from the base of the PR and between 023c082 and 61dacb3.

📒 Files selected for processing (1)
  • apps/studio/components/interfaces/Settings/Database/DiskSizeConfigurationModal.tsx

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Disk size controls now use entitlement-based gating rather than plan-only checks.
    • UI messaging, alerts, button labels and navigation targets updated to reflect entitlement access and combined loading states.
    • Conditional display of the resize form and informational prompts adjusted so the correct next action (upgrade or disable spend cap) is shown based on entitlement status.

Walkthrough

The pull request replaces plan-based access control with entitlement-based access control for disk size configuration. The DiskSizeConfiguration and DiskSizeConfigurationModal components now use useCheckEntitlements('instances.disk_modifications') to determine access (and include its loading state) instead of checking organization?.plan?.id === 'free'. Conditional rendering, alert messages, button labels, and billing/navigation targets were updated to reference the entitlement state; modal visibility and the disk resize mutation flow remain unchanged.

Sequence Diagram(s)

sequenceDiagram
participant User
participant UI as DiskSizeConfig UI
participant Ent as Entitlement Service
participant Sub as Subscription/SpendCap Service
participant API as Backend API

User->>UI: Open Disk Size Configuration
UI->>Ent: useCheckEntitlements('instances.disk_modifications')
Ent-->>UI: hasAccess / isLoading
UI->>Sub: fetch subscription & spend-cap state (parallel)
Sub-->>UI: subscription/spend-cap info

alt hasAccess == true and subscription valid
  UI->>User: Show resize form
  User->>UI: Submit new disk size
  UI->>API: Send disk resize mutation
  API-->>UI: Mutation success
  UI->>User: Show success
else hasAccess == false OR subscription invalid
  UI->>User: Show informational alert with billing link
  alt entitlement missing
    UI->>User: Link -> Billing (upgrade subscription)
  else spend-cap blocking
    UI->>User: Link -> Cost control (disable spend cap)
  end
end
Loading

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

Comment @coderabbitai help to get the list of available commands and usage tips.