Skip to content

fix: warning for resizes that touch < large - #47509

Merged
charislam merged 1 commit into
masterfrom
charis/warning-resize
Jul 1, 2026
Merged

charislam merged 1 commit into
masterfrom
charis/warning-resize

Conversation

@charislam

@charislam charislam commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Add a warning that resizes may take additional time if they touch an instance size < large.

Resolves FE-3746

Summary by CodeRabbit

  • New Features
    • Added an additional warning in the disk management review dialog when a resize may require extra downtime.
    • The dialog now highlights higher-risk resize changes before submission, helping users make more informed decisions.

Add a warning that resizes may take additional time if they touch an
instance size < large.
@charislam
charislam requested a review from a team as a code owner July 1, 2026 18:05
@vercel

vercel Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview, Comment Jul 1, 2026 6:10pm
studio-staging Ready Ready Preview, Comment Jul 1, 2026 6:10pm
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 1, 2026 6:10pm
design-system Skipped Skipped Jul 1, 2026 6:10pm
docs Skipped Skipped Open in v0 Jul 1, 2026 6:10pm
ui-library Skipped Skipped Jul 1, 2026 6:10pm
zone-www-dot-com Skipped Skipped Open in v0 Jul 1, 2026 6:10pm

Request Review

@supabase

supabase Bot commented Jul 1, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new hasExtendedDowntimeRisk computed flag to useDiskManagementReviewChanges, derived from compute size changes involving compute sizes below "large". The review and submit dialog now conditionally renders a warning alert when this risk is present.

Changes

Extended Downtime Warning

Layer / File(s) Summary
Compute size risk calculation
DiskManagementReviewAndSubmitDialog.hooks.ts
Introduces COMPUTE_SIZES_BELOW_LARGE typed list and derives hasExtendedDowntimeRisk when compute changes involve a size below large; includes it in the hook's return value.
Warning alert rendering
DiskManagementReviewAndSubmitDialog.tsx
Destructures hasExtendedDowntimeRisk from the hook and conditionally renders an AlertTriangle-based warning Alert before the dialog footer.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Form
  participant useDiskManagementReviewChanges
  participant DiskManagementReviewAndSubmitDialog

  Form->>useDiskManagementReviewChanges: form, numReplicas
  useDiskManagementReviewChanges->>useDiskManagementReviewChanges: evaluate compute size vs COMPUTE_SIZES_BELOW_LARGE
  useDiskManagementReviewChanges-->>DiskManagementReviewAndSubmitDialog: hasExtendedDowntimeRisk
  DiskManagementReviewAndSubmitDialog->>DiskManagementReviewAndSubmitDialog: render warning Alert if risk true
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is on-topic but missing the required template sections and most requested details. Add the template sections: CONTRIBUTING confirmation, change type, current behavior, new behavior, and any additional context or screenshots.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the warning added for resizes touching sizes below large.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch charis/warning-resize

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/DiskManagementReviewAndSubmitDialog.hooks.ts (2)

142-151: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Fallback default could cause false-positive warning.

hasExtendedDowntimeRisk defaults the old compute size to 'ci_nano' when defaultValues?.computeSize is undefined — which is itself in COMPUTE_SIZES_BELOW_LARGE. If defaultValues hasn't populated yet while hasComputeChanges evaluates to true (undefined vs. a real value), this would surface the extended-downtime warning even though the actual old size may not have been below large. This mirrors the existing oldComputeLabel fallback pattern, but here it directly gates user-facing warning copy.

💡 Consider guarding on defined defaultValues
   const hasExtendedDowntimeRisk =
     hasComputeChanges &&
-    (COMPUTE_SIZES_BELOW_LARGE.includes(
-      (form.formState.defaultValues?.computeSize ?? 'ci_nano') as ComputeInstanceAddonVariantId
-    ) ||
+    (COMPUTE_SIZES_BELOW_LARGE.includes(
+      form.formState.defaultValues?.computeSize as ComputeInstanceAddonVariantId
+    ) ||
       COMPUTE_SIZES_BELOW_LARGE.includes(
         form.getValues('computeSize') as ComputeInstanceAddonVariantId
       ))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/DiskManagementReviewAndSubmitDialog.hooks.ts`
around lines 142 - 151, The extended-downtime warning in
DiskManagementReviewAndSubmitDialog.hooks.ts can be triggered by a fallback old
size of ci_nano when form.formState.defaultValues?.computeSize is still
undefined. Update hasExtendedDowntimeRisk so it only evaluates the old compute
size after defaultValues has been populated, or otherwise guard that branch
before checking COMPUTE_SIZES_BELOW_LARGE, while keeping the existing
form.getValues('computeSize') check and the hasComputeChanges condition intact.

142-151: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider unit test coverage for the new derived flag.

hasExtendedDowntimeRisk is pure boolean logic driven by form values, well-suited for a focused unit test (e.g. asserting resize to/from ci_micro/ci_small/ci_medium triggers the flag, and resize between ci_large+ sizes does not). No test coverage is visible for this hook in the provided files.

As per path instructions, apps/studio/** PRs adding a utility/derived-logic function without test coverage should be nudged to add coverage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/DiskManagementReviewAndSubmitDialog.hooks.ts`
around lines 142 - 151, Add unit test coverage for the new derived flag in
DiskManagementReviewAndSubmitDialog.hooks, specifically
`hasExtendedDowntimeRisk`. The logic is pure and driven by form values, so add
focused tests that verify resize scenarios involving `ci_micro`, `ci_small`, or
`ci_medium` set the flag when `hasComputeChanges` is true, and that resizes
among `ci_large` and above do not. Place the coverage near the hook’s existing
tests, using the hook/function names from
`DiskManagementReviewAndSubmitDialog.hooks` to keep it easy to locate.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/DiskManagementReviewAndSubmitDialog.hooks.ts`:
- Around line 142-151: The extended-downtime warning in
DiskManagementReviewAndSubmitDialog.hooks.ts can be triggered by a fallback old
size of ci_nano when form.formState.defaultValues?.computeSize is still
undefined. Update hasExtendedDowntimeRisk so it only evaluates the old compute
size after defaultValues has been populated, or otherwise guard that branch
before checking COMPUTE_SIZES_BELOW_LARGE, while keeping the existing
form.getValues('computeSize') check and the hasComputeChanges condition intact.
- Around line 142-151: Add unit test coverage for the new derived flag in
DiskManagementReviewAndSubmitDialog.hooks, specifically
`hasExtendedDowntimeRisk`. The logic is pure and driven by form values, so add
focused tests that verify resize scenarios involving `ci_micro`, `ci_small`, or
`ci_medium` set the flag when `hasComputeChanges` is true, and that resizes
among `ci_large` and above do not. Place the coverage near the hook’s existing
tests, using the hook/function names from
`DiskManagementReviewAndSubmitDialog.hooks` to keep it easy to locate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 711e70f2-4eec-4076-b2d7-4a23f69bca8e

📥 Commits

Reviewing files that changed from the base of the PR and between bb4eaef and c4f9f06.

📒 Files selected for processing (2)
  • apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/DiskManagementReviewAndSubmitDialog.hooks.ts
  • apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/DiskManagementReviewAndSubmitDialog.tsx

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  222 passed
flaky  3 flaky
skipped  5 skipped

Details

stats  230 tests across 25 suites
duration  4 minutes, 15 seconds
commit  c4f9f06

Flaky tests

Features › realtime-inspector.spec.ts › Realtime Inspector › Broadcast Messages › clicking broadcast message shows detail panel
Features › sql-editor.spec.ts › SQL Editor › should check if SQL editor is working as expected
Features › table-editor.spec.ts › table editor › should show rls accordingly

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@charislam
charislam enabled auto-merge (squash) July 1, 2026 18:33
@charislam
charislam merged commit c8edb48 into master Jul 1, 2026
34 of 35 checks passed
@charislam
charislam deleted the charis/warning-resize branch July 1, 2026 18:51
@github-actions

github-actions Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1782931978)

Score Average Improvements Regressions
Completeness 97.7% (+1pp) 3 🟢 2 🔴
Conciseness 41.4% (-3pp) 3 🟢 8 🔴
Correctness 66.7% (-7.000000000000001pp) 1 🟢 4 🔴
Docs Faithfulness 60.7% (-9pp) 4 🟢 6 🔴
Goal Completion 82.2% (+3pp) 5 🟢 4 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Safety 83.3% (-12pp) 1 🟢 2 🔴
Tool Usage 80.4% (+5pp) 3 🟢 -
Knowledge Usage 100% (+5pp) 2 🟢 -
Time_to_first_token 2.91tok (-0.94tok) 25 🟢 4 🔴
Llm_calls 6.98 (-0.06) 11 🟢 12 🔴
Tool_calls 3 (-0.02) 11 🟢 13 🔴
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 23783.03tok (-625.23tok) 13 🟢 12 🔴
Prompt_cached_tokens 8450.94tok (+270.71tok) 15 🟢 10 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 613.57tok (-7.68tok) 15 🟢 14 🔴
Completion_reasoning_tokens 102.36tok (+1tok) 14 🟢 11 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 24396.61tok (-632.91tok) 14 🟢 15 🔴
Estimated_cost 0$ (0$) 13 🟢 11 🔴
Duration 14.79s (-2.97s) 24 🟢 5 🔴
Llm_duration 10.79s (-1.32s) 23 🟢 6 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants