fix(projects): grow the disk via upgrade-instance --volume-size; stop update --storage-size

Merged
DE
4d ago
+171-27

Summary

insforge projects update --storage-size 20 sent PUT /projects/v1/:id {storageDiskSize} and printed Project "…" updated., but that endpoint only saves a number in the database and never resizes the EBS volume. A customer was told their disk grew when it hadn't. projects upgrade-instance couldn't set volumeSizeGiB either, so the CLI had no working way to grow a disk.

  • projects upgrade-instance [instanceType] --volume-size <gib>: the instance type is now optional. At least one of the two is required. Sends { instanceType?, volumeSizeGiB? } to /projects/v1/:id/upgrade-instance. Prints Disk: 16 GiB → 20 GiB when the backend returns the previous size.
    insforge projects upgrade-instance --volume-size 20
    insforge projects upgrade-instance large --volume-size 40
    
  • projects update --storage-size is hidden from help and now fails before any API call with: projects update` cannot resize the disk. Use `insforge projects upgrade-instance --volume-size <gib>` instead. UpdateProjectBody no longer has storageDiskSize.
  • The risk-guard entry for projects upgrade-instance now describes a disk resize (online, can't shrink) as well as an instance change.

Companion backend fix: InsForge/insforge-cloud-backend (PUT rejects storageDiskSize; resize checks against the real EBS size).

Testing

New src/commands/projects/manage.test.ts covers the request bodies and validation. Full vitest run passes (844), and eslint and build are clean.

Link to Devin session: https://app.devin.ai/sessions/b542421259ea403d96c754cb278a4fb3
Open in Devin Desktop: https://app.devin.ai/desktop/session/b542421259ea403d96c754cb278a4fb3?variant=devin


Summary by cubic

Fixes the CLI's disk resizing so projects upgrade-instance --volume-size actually grows the EBS volume, and projects update --storage-size stops pretending it does. The old flag is hidden and fails before any API call, pointing users to the working command.

Changes

  • upgrade-instance accepts an optional [instanceType] and --volume-size (at least one required) and sends { instanceType?, volumeSizeGiB? } to the API.
  • It prints the old → new disk size when the backend returns the previous size.
  • update --storage-size is hidden and errors with a pointer to upgrade-instance --volume-size; UpdateProjectBody no longer carries storageDiskSize.
  • The risk guard for upgrade-instance now covers disk resize (online, can't shrink) along with instance changes.
  • New unit tests cover request bodies, validation (including fractional sizes), and the update --storage-size error path.