Skip to content

feat: database storage#3829

Merged
astandrik merged 32 commits intomainfrom
astandrik.3779-2
May 8, 2026
Merged

feat: database storage#3829
astandrik merged 32 commits intomainfrom
astandrik.3779-2

Conversation

@astandrik
Copy link
Copy Markdown
Collaborator

@astandrik astandrik commented Apr 21, 2026

Closes #3779

Stand

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
672 667 0 2 3
Test Changes Summary ✨13

✨ New Tests (13)

  1. renders the new storage layout in light theme (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  2. renders grouped summary sections for multiple storage types in light theme (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  3. renders the new storage layout in dark theme (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  4. renders grouped summary sections for multiple storage types in dark theme (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  5. shows quota missing helpmark for a single-media user data summary without quota (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  6. shows quota missing helpmark only for multi-media rows without quota (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  7. keeps legacy dedicated storage layout when experiment is disabled (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  8. highlights hovered storage segment and shows rich tooltip in light theme (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  9. shows tooltip on legend hover and clears state after click in light theme (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  10. highlights hovered storage segment and shows rich tooltip in dark theme (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  11. shows tooltip on legend hover and clears state after click in dark theme (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  12. keeps legacy dedicated storage layout when storage_stats capability is unavailable (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)
  13. keeps legacy serverless storage layout when experiment is enabled (tenant/diagnostics/tabs/tenantOverviewStorage.test.ts)

Bundle Size: 🔺

Current: 63.75 MB | Main: 63.56 MB
Diff: +0.19 MB (0.30%)

⚠️ Bundle size increased. Please review.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

Copilot AI review requested due to automatic review settings April 21, 2026 17:56
Comment thread src/store/reducers/tenantOverview/storage/tenantOverviewStorage.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af8b54f226

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/store/reducers/tenantOverview/storage/tenantOverviewStorage.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements a new “Storage” tab layout for Tenant Overview (behind an experiment flag and gated by /viewer/storage_stats capability), including data fetching/normalization for storage stats and top space consumers.

Changes:

  • Added new tenant storage raw-data RTK Query endpoint (storage stats + .sys/partition_stats query + schema lookups) and client-side normalization utilities.
  • Introduced a new Storage UI (TenantStorageNew) with per-media summaries, segmented breakdowns, and a “Top 10 by space usage” table, plus a mode switch to keep the legacy layout when needed.
  • Updated API/types and normalization helpers (media type normalization, tenant storage/quota fields), and added unit + Playwright coverage.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/suites/tenant/diagnostics/tabs/tenantOverviewStorage.test.ts Playwright coverage for new/legacy storage layout switching and key UI assertions
src/utils/disks/normalizeMediaType.ts Normalize media kinds to uppercase and stabilize Unknown handling
src/types/api/tenant.ts Adds DatabaseStorage and quota fields (storage_quotas, SoftQuota, HardQuota) to tenant API types
src/types/api/storage.ts Makes StorageStatsRequestParams.path optional (supports tablet-type aggregation calls)
src/store/reducers/tenants/utils.ts Uses DatabaseStorage / TablesStorage and per-type quotas to compute tenant storage stats
src/store/reducers/tenantOverview/storage/tenantOverviewStorage.ts New RTK Query endpoint to fetch raw storage data (tablet stats, top objects, schema metadata)
src/store/reducers/storageUsage/test/storageUsage.test.ts Adds test for lowercase media kind normalization (ssdSSD)
src/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json Adds i18n strings for the new storage UI
src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.ts Builds view-model for new storage UI (summaries, segments, media sections, top rows)
src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/useTenantStorageNewData.ts Hook that fetches raw storage data and memoizes normalized view-model
src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/types.ts Shared prop/metrics types for storage components
src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/test/utils.test.ts Unit tests for storage view-model builders and helpers
src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorageNew.tsx New Storage tab UI implementation (summaries + top-usage table)
src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorageNew.scss Styles for the new storage UI
src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorageMode.tsx Switches between legacy and new storage UIs based on flags/capabilities/type
src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.tsx Refactors legacy storage component to reuse shared prop/types
src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx Wires TenantStorageMode into the Storage tab and passes required props
src/containers/Tenant/Diagnostics/TenantOverview/MetricsTabs/MetricsTabs.tsx Adjusts which storage stats set is used for aggregates (prefers stats with limits)
src/containers/Cluster/ClusterOverview/utils.tsx Hardens diagram fill calculation against invalid/zero capacities

Comment thread src/store/reducers/tenants/utils.ts Outdated
Comment thread src/store/reducers/tenants/utils.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6fcc447e21

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b59088916

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/store/reducers/tenants/utils.ts Outdated
Comment thread src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eeee446ca0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.ts Outdated
Comment thread src/store/reducers/tenants/utils.ts Outdated
@astandrik astandrik force-pushed the astandrik.3779-2 branch from eeee446 to 2c72d94 Compare May 4, 2026 09:06
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c72d94648

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/suites/tenant/diagnostics/tabs/tenantOverviewStorage.test.ts Outdated
@astandrik astandrik requested a review from kkdras as a code owner May 6, 2026 14:53
@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

if (segments || systemDetails || !allowAggregateFallback || mediaKey === EType.None) {
return {segments, systemDetails};

P2 Badge Merge aggregate tablet breakdown with per-media data

When a single-media database gets tablet-type rows where some rows include Media (for example DataShard on SSD) but older/system tablet rows only provide row-level StorageSize, the aggregate system rows are stored under EType.None while the SSD row makes segments truthy here. Fresh evidence in the current code is that this guard returns immediately as soon as segments exists, so the aggregate system segment/details are not used and the physical card reports that storage as unknown instead of system usage.


const userStats =
tabletStatsByType.get(mediaType) ??
(mediaTypes.length === 1 ? tabletStatsByType.get(EType.None) : undefined);

P2 Badge Avoid zeroing aggregate user stats in media groups

On clusters where blob stats are split by media (SSD/HDD) but tablet/user stats are only aggregate under EType.None, this lookup intentionally falls back only for a single media section. With multiple media sections, userStats is undefined for every row, so the grouped User data card renders 0 used/quota for each media even though aggregate tablet usage exists; this misreports user storage rather than showing an aggregate/unknown split.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66f40d1a67

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc4077c9a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/store/reducers/tenantOverview/storage/tenantOverviewStorage.ts Outdated
Comment thread src/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json Outdated
Comment thread src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/utils.ts Outdated
@astandrik
Copy link
Copy Markdown
Collaborator Author

@Raubzeug fixes issues

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cc2acb2dde

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/utils/utils.ts
Raubzeug
Raubzeug previously approved these changes May 7, 2026
@astandrik astandrik added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit 258635b May 8, 2026
20 checks passed
@astandrik astandrik deleted the astandrik.3779-2 branch May 8, 2026 10:32
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.

feat: database storage

3 participants