Files
Lukas BernertandClaude Fable 5 f38928ad90 fix(studio): resolve disk limits from the project's instance configuration (#52367)
## Problem

Studio validates disk IOPS/throughput against one minimum value per
compute size. Projects whose hardware supports more get blocked below
their actual limits, charts and banners can show the wrong baseline, and
burst charts are gated by a hardcoded size list that is wrong for some
configs.

Fixes PROD-674

## What changed

- New per-configuration limits table:
`packages/shared-data/instance-disk-limits.ts` (values from the AWS
EBS-optimized tables).
- The size-wide floors in `compute-disk-limits.ts` are now derived from
that table as per-size minimums. Published values are unchanged and
pinned in tests.
- New `useProjectDiskLimits()` resolves a project's limits from its
primary database, falling back to the floors.
- Disk form validates against the project's actual limits (floors when a
different compute size is selected). New inline hint when provisioning
between baseline and max.
- Burst charts/tiles/metrics show only if baseline is below max.
- Chart reference lines and the disk IO banner use the resolved values.

## How to test

1. Settings → Database → Disk on a Large+ project: IOPS/throughput
accept values up to the project's actual limits, error above them, and
show the burst hint between baseline and max.
2. Reports: burst metrics are offered only for projects whose disk IO
bursts; a saved burst chart on a non-bursting project renders an
"unavailable" placeholder instead.
3. `pnpm --filter studio vitest run
components/interfaces/DiskManagement/DiskManagement.test.ts
data/reports/database-charts.test.ts`

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-11-11 17:58:26 +01:00

62 lines
1.5 KiB
TypeScript

import {
COMPUTE_BASELINE_IOPS,
COMPUTE_BASELINE_THROUGHPUT,
COMPUTE_DISK,
COMPUTE_MAX_IOPS,
COMPUTE_MAX_THROUGHPUT,
computeInstanceAddonVariantIdSchema,
} from './compute-disk-limits'
import config from './config'
import { ERROR_CODE_DOCS_URLS, ERROR_CODES, HTTP_ERROR_CODES } from './error-codes'
import type { ErrorCodeDefinition, ErrorCodeService } from './error-codes'
import extensions from './extensions.json'
import {
getInstanceDiskLimits,
hasBurstableDiskIO,
INSTANCE_DISK_LIMITS,
} from './instance-disk-limits'
import type { InstanceDiskLimits } from './instance-disk-limits'
import logConstants from './log-constants'
import { plans, PricingInformation } from './plans'
import { pricing } from './pricing'
import { PRODUCT_MODULES, products } from './products'
import questions from './questions'
import type { AWS_REGIONS_KEYS, CloudProvider, Region } from './regions'
import { AWS_REGIONS } from './regions'
import tweets, { topTweets } from './tweets'
export {
AWS_REGIONS,
COMPUTE_BASELINE_IOPS,
COMPUTE_BASELINE_THROUGHPUT,
COMPUTE_DISK,
COMPUTE_MAX_IOPS,
COMPUTE_MAX_THROUGHPUT,
computeInstanceAddonVariantIdSchema,
config,
ERROR_CODE_DOCS_URLS,
ERROR_CODES,
HTTP_ERROR_CODES,
extensions,
getInstanceDiskLimits,
hasBurstableDiskIO,
INSTANCE_DISK_LIMITS,
logConstants,
plans,
pricing,
PRODUCT_MODULES,
products,
questions,
topTweets,
tweets,
}
export type {
AWS_REGIONS_KEYS,
CloudProvider,
ErrorCodeDefinition,
ErrorCodeService,
InstanceDiskLimits,
PricingInformation,
Region,
}