Skip to content

Show actual disk size instead of size spec in resize command#51

Merged
ret2libc merged 2 commits intotrailofbits:mainfrom
VariousForks:fix-resize-show-actual-disk
Mar 24, 2026
Merged

Show actual disk size instead of size spec in resize command#51
ret2libc merged 2 commits intotrailofbits:mainfrom
VariousForks:fix-resize-show-actual-disk

Conversation

@gwpl
Copy link
Contributor

@gwpl gwpl commented Mar 23, 2026

Summary

AI Agent with Greg: We resized a droplet with --no-disk to keep the option to scale back down, then ran dropkit resize again and saw "Disk: 80 GB" — which made us briefly question our own sanity. Turns out the resize display was reading the size spec instead of the actual disk. Reality check restored. 🔍💾

The bug: After a --no-disk resize (e.g., s-1vcpu-1gbs-2vcpu-4gb), the resize command showed disk from droplet["size"]["disk"] (80 GB — what the size tier offers) instead of droplet["disk"] (25 GB — what the droplet actually has).

The fix: Read from droplet["disk"] (actual allocation). When actual disk differs from size spec, show an inline hint so the situation is immediately clear:

Current Size: s-2vcpu-4gb
  vCPUs:     2
  Memory:    4096 MB
  Disk:      25 GB (size spec: 80 GB, disk was not resized)
  Price:     $24.00/month

vs. previously misleading:

Current Size: s-2vcpu-4gb
  vCPUs:     2
  Memory:    4096 MB
  Disk:      80 GB   ← wrong! actual disk is 25 GB
  Price:     $24.00/month

This matters most for users doing temporary CPU/RAM scale-ups who need to confirm their disk is still at the original size before scaling back down.

Test plan

  • uv run ruff check dropkit/main.py — passed
  • uv run ruff format --check dropkit/main.py — passed
  • uv run ty check dropkit/main.py — passed
  • uv run pytest tests/ -v — 288 passed (1 pre-existing failure in test_rename unrelated to this change)
  • Manual test: dropkit resize <name> after a --no-disk resize — verify actual disk shown with hint
  • Manual test: dropkit resize <name> on a droplet where disk matches spec — verify no hint shown

🤖 Generated with Claude Code — your friendly AI that believes in showing users the truth, the whole truth, and nothing but the disk truth

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

After a --no-disk resize, `dropkit resize` showed the size spec's disk
(e.g. 80 GB for s-2vcpu-4gb) instead of the droplet's actual disk
(25 GB).  This is confusing for users planning temporary scale-ups —
they need to see their real disk to know if they can scale back down.

Read disk from `droplet["disk"]` (actual allocation) instead of
`droplet["size"]["disk"]` (what the size tier offers).  When the two
differ, show an inline hint: "25 GB (size spec: 80 GB, disk was not
resized)" so the situation is immediately clear.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gwpl gwpl requested a review from ret2libc as a code owner March 23, 2026 22:35
@gwpl
Copy link
Contributor Author

gwpl commented Mar 24, 2026

AI Assistant:
👋 Hi! This one comes from the Claude + Greg debugging duo. We stared at a disk size that was lying to our face after a no-disk resize, and decided that was unacceptable — dropkit should report what the disk actually is, not what the size spec wishes it were. Trust but verify, especially your storage layer. Feedback welcome!

Copy link
Collaborator

@ret2libc ret2libc left a comment

Choose a reason for hiding this comment

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

Nice!

Read all three resource fields from the droplet object directly
(droplet["vcpus"], droplet["memory"], droplet["disk"]) instead of
from the size spec (droplet["size"]["vcpus"], etc.).  After a
--no-disk resize these can diverge — the size spec reflects the
new tier while the droplet retains its original resources.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ret2libc ret2libc merged commit 44cb274 into trailofbits:main Mar 24, 2026
4 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