Skip to content

ui: label instance volume sizes as GiB - #13831

Open
Dogface2k wants to merge 2 commits into
apache:4.22from
Dogface2k:fix/issue-13820-volume-size-unit
Open

ui: label instance volume sizes as GiB#13831
Dogface2k wants to merge 2 commits into
apache:4.22from
Dogface2k:fix/issue-13820-volume-size-unit

Conversation

@Dogface2k

@Dogface2k Dogface2k commented Aug 8, 2026

Copy link
Copy Markdown

Fixes #13820.

Summary

Use the correct GiB unit for byte-derived volume sizes across the affected UI paths:

  • Instance Volumes tab.
  • Instance summary card (GiB Storage).
  • Backup volume details.

This keeps the displayed unit consistent anywhere these API byte counts are rendered.

Root cause

These paths divide byte counts by 1024³, which is a binary conversion to gibibytes. The old labels said GB, implying decimal gigabytes. The numeric conversion and API behaviour are unchanged.

Tests

  • Added focused render tests for the Volumes tab, VM summary card, and backup volume details. Each test rejects the old GB output and expects GiB.
  • Sensitivity was proven against the unfixed behavior: each focused test failed on the old label before the matching production change.

Validation

  • Focused UI tests: 3 passed.
  • Full UI unit suite: 178 passed.
  • UI lint: passed with no errors.
  • Production UI build: completed successfully with Node 16.20.2. Existing bundle-size and Browserslist warnings remain unchanged.
  • QA-JID-977 rebuilt exact head c2c6fe8a29fb47bfb224bb99360f6571b51126c3. Firefox verified the instance Volumes tab row for ROOT-1369 renders 0.00 GiB; no GB label appeared in that row.
  • The QA simulator VM payload had no volumes collection, so the summary-card branch was not rendered there. It exposed no backup detail fixture, so that branch was not rendered there. Both remain covered by focused unit tests and the production build.

Scope

Only existing labels and focused component tests changed. No API, numeric conversion, provisioning, or CloudStack resource behavior changed.

@Dogface2k

Copy link
Copy Markdown
Author

@blueorangutan ui

Please build the exact PR head for QA validation: 7b0cb91e74b704f76103159981c0eb715e3d32dd.

@blueorangutan

Copy link
Copy Markdown

@Dogface2k a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/13831 (QA-JID-976)

@Dogface2k

Copy link
Copy Markdown
Author

QA validation completed against exact PR head 7b0cb91e74b704f76103159981c0eb715e3d32dd on QA-JID-976.

  • Authenticated Firefox UI flow opened test-normal-user-vm1 and its selected Volumes tab.
  • Attached volume ROOT-1369 rendered 0.00 GiB; no GB label was present.
  • No VM or QA resource was created or changed.
  • Focused screenshot retained locally at /tmp/pr13831-evidence/pr-13831-volume-size-focused.png (SHA-256 74aad5475f93c69ad564dbabb5fd20aac67273fe72eab75e3818a5d6b1abe73b).

Local gates recorded in the PR description remain passing: focused regression, full UI unit suite, lint, and production build.

@Dogface2k
Dogface2k marked this pull request as ready for review August 8, 2026 23:19
@Dogface2k

Dogface2k commented Aug 8, 2026

Copy link
Copy Markdown
Author

Unit check: issue #13820 asks for a consistent and correct label. Both views divide the API byte count by 1024^3, which is a binary conversion and therefore renders GiB (gibibytes), not GB (decimal gigabytes). The Storage > Volumes view already uses GiB; this PR makes the Instances > Volumes tab match it without changing the numeric conversion or API behavior. pr-13831-volume-size-focused

@Dogface2k

Copy link
Copy Markdown
Author

@blueorangutan ui

Please rebuild the exact new PR head for QA validation: c2c6fe8a29fb47bfb224bb99360f6571b51126c3. This is an additive commit on the existing branch; do not use the prior QA build.

@blueorangutan

Copy link
Copy Markdown

@Dogface2k a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/13831 (QA-JID-977)

@Dogface2k

Copy link
Copy Markdown
Author

QA validation for exact head c2c6fe8a29fb47bfb224bb99360f6571b51126c3 completed on QA-JID-977: https://qa.cloudstack.cloud/simulator/pr/13831

  • One persistent Firefox session opened test-normal-user-vm1, selected its Volumes tab, and verified ROOT-1369 renders 0.00 GiB in the row; no GB label appeared in that row.
  • The refreshed QA asset is app.b451d592.js.
  • The simulator VM payload did not include the volumes collection, so the VM summary-card branch was not rendered in QA.
  • The simulator exposed no backup detail fixture, so the backup-details branch was not rendered in QA. Those branches are covered by focused unit tests and the production build.
  • No CloudStack resources were created or changed.
  • Original screenshot: /tmp/pr13831-evidence-r2/pr-13831-instance-gib-firefox.png (SHA-256 906de2a6e4fc8fca66a1a133969bad2c8ed37eec2dc1e82a059c6da59a53a79d).
  • Focused deterministic crop: /tmp/pr13831-evidence-r2/pr-13831-instance-gib-focused.png (SHA-256 ab3ac1ca2ad614d4891ef9086fda50cd8af27caa7cf8cbeeea490dadc0d6111a).

Local validation on this exact head: 178 UI unit tests passed, lint passed, and the production build completed successfully.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants