Skip to content

fix(projects): take --volume-size back out of upgrade-instance - #316

Merged
Fermionic-Lyu merged 1 commit into
mainfrom
fix/disk-resize-admin-only
Oct 24, 2026
Merged

Fermionic-Lyu merged 1 commit into
mainfrom
fix/disk-resize-admin-only

Conversation

@Fermionic-Lyu

@Fermionic-Lyu Fermionic-Lyu commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Disk resizes are admin-only. Provisioned disk is not billed, so customers can't grow it themselves. This reverts the --volume-size part of PR 315, which is merged but has not been released (npm latest is 0.2.8).

  • projects upgrade-instance <instanceType> is back to taking only an instance type. risk-registry.ts and UpgradeInstanceBody match the code from before 315.
  • projects update --storage-size stays hidden and fails before login or any API call with "Disk size changes go through InsForge support." Released versions shipped this flag, and it only saved a number.
  • UpgradeInstanceResult drops previous/newVolumeSizeGiB. The customer endpoint no longer returns them.

Companion backend PR: the customer upgrade-instance route rejects volumeSizeGiB and silent.

Testing

manage.test.ts checks that update --storage-size 20 exits before requireAuth and updateProject, and that the error names support. Removing the early throw turns it red. Full vitest run passes (839), and eslint and build are clean.

🤖 Generated with Claude Code


Summary by cubic

Reverts the unreleased --volume-size disk resize support, since provisioned disk is not billed and disk resizes go through InsForge support.

  • projects upgrade-instance <instanceType> takes only an instance type again; --volume-size is removed and the result no longer includes volume sizes.
  • projects update --storage-size still errors, but now fails before authentication with "Disk size changes go through InsForge support."

Written for commit 08ff842. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • Updates
    • Instance upgrades now change the instance type only. The command requires an instance type and confirms that the change may restart the instance and affect billing.
    • Disk-size changes are no longer available through the project update or instance upgrade commands. The project update command directs you to contact InsForge support for disk-size changes.

Disk resizes are admin-only: provisioned disk is not billed, so customers
cannot grow it themselves. update --storage-size now points at support.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cbfc875b-77df-46fa-b22e-8be7460c31e8
Commits

Reviewing files that changed from the base of the PR and between d44a05b and 08ff842.

Files selected for processing: 4
  • src/commands/projects/manage.test.ts
  • src/commands/projects/manage.ts
  • src/lib/guard/risk-registry.ts
  • src/types.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The project CLI now directs disk-size changes to InsForge support. The upgrade-instance command accepts an instance type only. Its request and result types, risk assessment, and tests reflect the removal of disk-resizing behavior.

Changes

Project Instance Upgrade

Layer / File(s) Summary
Instance-type-only upgrade
src/types.ts, src/commands/projects/manage.ts, src/lib/guard/risk-registry.ts, src/commands/projects/manage.test.ts
The upgrade request now requires an instance type, and the command validates and confirms only that change. Disk-size validation, API and analytics data, and resizing output were removed. The risk assessment and tests no longer describe disk resizing. The projects update --storage-size error now refers users to InsForge support.

Priority: Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: carmendou, jwfing

Merge Risk: Minimal · up to 08ff8

Disk-size changes are directed to support, while instance upgrades remain available by instance type. No identified issue blocks merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: removing --volume-size from upgrade-instance.
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 unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the instance type,
And finds the disk-size path is gone.
“Ask InsForge,” the prompt now says,
The type change gets a restart note.
The bunny hops through tests at dawn.

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

@agent-zhang-beihai agent-zhang-beihai 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.

Reviewed by Wang Miao

I've finished reading the diff and its callers, and I'm writing up the review.

This reverts the --volume-size option that the base commit added to projects upgrade-instance. upgrade-instance goes back to taking a required instance type. The guard risk entry, UpgradeInstanceBody/UpgradeInstanceResult and the confirmation prompt shrink to match, and the hidden projects update --storage-size flag now refuses, before login, with a message pointing at InsForge support. The revert is complete and nothing ships broken, so I'd approve it.

I found no problems.

  • Leftovers: nothing in src/, README.md or docs still mentions volumeSize, volume-size or previousVolumeSizeGiB.
  • Instance type: it is now a required positional argument, so the ctx.args[0] ?? '?' fallback in the risk registry is never hit.
  • No released users affected: --volume-size never went out in a release. v0.2.8 is the latest tag, and none of the tags contain 16a7a83, the commit that introduced it.

I couldn't run the tests or tsc because dependencies aren't installed in this checkout.

@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect the bounded project upgrade workflow.

The PR appears safe to merge, with a non-blocking gap in tests for the changed upgrade command.

Findings

  1. P2 Instance upgrades lack tests ▶

Summary

This PR removes customer disk resizing from projects upgrade-instance.

  • Project upgrades change instance type, while disk changes go through support.

Reviews (1) · Last reviewed commit: "fix(projects): take --volume-size back o..." · Reviewed by Greptile

describe('projects disk resizing', () => {
let exitSpy: ReturnType<typeof vi.spyOn>;
let logSpy: ReturnType<typeof vi.spyOn>;
describe('projects update --storage-size', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Instance upgrades lack tests

Removing every upgrade-instance test leaves the main change in this PR unchecked. Add replacement tests that verify upgrade-instance large sends only { instanceType: 'large' }, and that the removed --volume-size flag and a missing instance type fail without calling upgradeInstance. These checks would catch disk resizing being accidentally restored or instance upgrades being broken.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Declining. After this PR, upgrade-instance is byte-identical to main before PR 315, which had no tests for it, so these would be new tests for behaviour this PR does not add. Commander already rejects an unknown --volume-size or a missing positional. The control that stops customers resizing the disk is server-side, in InsForge/insforge-cloud-backend PR 1000, and it has its own test.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That’s fair. Since this restores the pre-315 CLI contract, Commander already rejects --volume-size and a missing instance type, and the actual disk-resize restriction is enforced and tested in the backend, my request for replacement upgrade-instance tests was a coverage preference—not a defect in this PR. I’m withdrawing the comment.

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

@agent-zhang-beihai agent-zhang-beihai 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.

Reviewed by Yang Dong

This removes customer-facing disk resizing from projects upgrade-instance, restores the required instance-type argument, and keeps the legacy storage flag as a support redirect. The rollback is internally consistent, so I would approve it.

No findings.

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/commands/projects/manage.test.ts">

<violation number="1" location="src/commands/projects/manage.test.ts:36">
P2: Add replacement `upgrade-instance` tests for the instance-type request, rejection of `--volume-size`, and missing-type failure; this change removes the command’s existing coverage without testing its new behavior.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

describe('projects disk resizing', () => {
let exitSpy: ReturnType<typeof vi.spyOn>;
let logSpy: ReturnType<typeof vi.spyOn>;
describe('projects update --storage-size', () => {

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.

P2: Add replacement upgrade-instance tests for the instance-type request, rejection of --volume-size, and missing-type failure; this change removes the command’s existing coverage without testing its new behavior.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/commands/projects/manage.test.ts, line 36:

<comment>Add replacement `upgrade-instance` tests for the instance-type request, rejection of `--volume-size`, and missing-type failure; this change removes the command’s existing coverage without testing its new behavior.</comment>

<file context>
@@ -30,89 +26,39 @@ vi.mock('../../lib/analytics.js', () => ({
-describe('projects disk resizing', () => {
-  let exitSpy: ReturnType<typeof vi.spyOn>;
-  let logSpy: ReturnType<typeof vi.spyOn>;
+describe('projects update --storage-size', () => {
   let errors: string[];
-  let errorSpy: ReturnType<typeof vi.spyOn>;
</file context>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same as the thread above: declined. The command is restored to its tested-by-nothing pre-315 form, and the server-side control is tested in insforge-cloud-backend PR 1000.

@jwfing jwfing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM - approved.

@Fermionic-Lyu
Fermionic-Lyu merged commit 40182fd into main Oct 24, 2026
5 checks passed
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