feat: STORIF-330: refactored handling of Quotas. Introduced a service defin…#13557
feat: STORIF-330: refactored handling of Quotas. Introduced a service defin…#13557skulpok-akamai wants to merge 6 commits intolinode:developfrom
Conversation
bb970f4 to
758d7b8
Compare
1aa9b45 to
eae49c6
Compare
eb5386e to
f57a454
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a service selector on the Quotas page and refactors quota fetching/rendering to support multiple quota “services” with configurable scopes (e.g., per Object Storage endpoint), enabling faster addition of new quota-backed services.
Changes:
- Added a quotas “service” abstraction (
QuotaService+ scopes) and a service selector UI on/quotas. - Refactored quota queries/hooks to fetch quotas + usage in parallel and render rows as soon as usage is ready.
- Updated mocks/tests/cypress flows and API types to support the new quota service model.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/queries/src/quotas/requests.ts | Renames quota request params to align with new service/collection naming. |
| packages/queries/src/quotas/quotas.ts | Refactors quota hooks; introduces useQuotaUsageQueries for parallel usage fetches. |
| packages/queries/src/quotas/keys.ts | Updates query key factory to use QuotaServiceType + apiCollection. |
| packages/manager/src/routes/quotas/index.ts | Adds typed service search param for the quotas route. |
| packages/manager/src/mocks/serverHandlers.ts | Updates quota mock factory usage for Object Storage quotas. |
| packages/manager/src/mocks/presets/crud/handlers/quotas.ts | Updates CRUD mock handlers to new quota factories and filter behavior. |
| packages/manager/src/features/ObjectStorage/SummaryLanding/SummaryLanding.tsx | Updates “View Quotas” link to preselect Object Storage service. |
| packages/manager/src/features/ObjectStorage/SummaryLanding/Partials/EndpointSummaryRow.tsx | Switches endpoint quota summary to new quotas+usage hook/service definition. |
| packages/manager/src/features/ObjectStorage/SummaryLanding/Partials/EndpointSummaryRow.test.tsx | Updates tests to use new factories and new “Data not available” behavior. |
| packages/manager/src/features/ObjectStorage/QuotasInfoNotice.tsx | Updates “View Quotas” link to preselect Object Storage service. |
| packages/manager/src/features/Account/Quotas/utils.ts | Refactors quota utilities for new service/scope model and new resource metric typing. |
| packages/manager/src/features/Account/Quotas/utils.test.tsx | Removes tests for deleted utilities and updates metric conversion tests. |
| packages/manager/src/features/Account/Quotas/quotaServices.ts | Adds quota service + scope definitions (Object Storage implemented; others stubbed). |
| packages/manager/src/features/Account/Quotas/hooks/useQuotasWithUsageQuery.ts | New hook combining quotas list + per-quota usage queries into QuotaWithUsage. |
| packages/manager/src/features/Account/Quotas/hooks/useQuotaServices.ts | New hook to determine which quota services are available to the user. |
| packages/manager/src/features/Account/Quotas/hooks/useGetQuotas.ts | Removes legacy hook in favor of the new quotas+usage model. |
| packages/manager/src/features/Account/Quotas/QuotasPanel/ScopeValueSelect.tsx | New scope-value selector supporting region or object-storage endpoint selection. |
| packages/manager/src/features/Account/Quotas/QuotasPanel/ScopeValueSelect.test.tsx | Adds tests for region/endpoint selection behavior. |
| packages/manager/src/features/Account/Quotas/QuotasPanel/QuotasTableRow.tsx | Updates quota row rendering to use QuotaWithUsage and new error display. |
| packages/manager/src/features/Account/Quotas/QuotasPanel/QuotasTable.tsx | Updates table to use new hook, scopes, and updated empty/error states. |
| packages/manager/src/features/Account/Quotas/QuotasPanel/QuotasTable.test.tsx | Updates table tests to new service/scope model and factories. |
| packages/manager/src/features/Account/Quotas/QuotasPanel/QuotasPanel.tsx | New panel wrapper per scope (global/region/endpoint) including selector + table. |
| packages/manager/src/features/Account/Quotas/QuotasPanel/QuotasPanel.test.tsx | Adds tests for panel behavior (selector visibility and scopeValue reset). |
| packages/manager/src/features/Account/Quotas/QuotasPanel/QuotasIncreaseForm.tsx | Updates support ticket form to include service/scope context in the message. |
| packages/manager/src/features/Account/Quotas/QuotasPanel/QuotasIncreaseForm.test.tsx | Updates tests for increase form defaults and message content. |
| packages/manager/src/features/Account/Quotas/Quotas.tsx | Replaces old single-service quotas page with service selector + per-scope panels. |
| packages/manager/src/features/Account/Quotas/Quotas.test.tsx | Updates quotas page tests for new service-selector-driven rendering. |
| packages/manager/src/features/Account/Quotas/QuotaServicePanel.tsx | New service selection panel (with object-storage specific info notice). |
| packages/manager/src/factories/quotas.ts | Splits quota factories into service-specific quota factories. |
| packages/manager/src/components/QuotaUsageBar/QuotaUsageBar.tsx | Updates prop typing to new Quota['resource_metric'] union. |
| packages/manager/src/components/QuotaUsageBar/QuotaUsageBar.test.tsx | Updates tests to use string literal resource metrics. |
| packages/manager/cypress/e2e/core/objectStorage/object-storage-summary-page.spec.ts | Updates object storage summary test to new quota factories and usage intercepts. |
| packages/manager/cypress/e2e/core/account/quotas-storage.spec.ts | Updates quota workflow test to new /quotas?service=... path and selectors. |
| packages/api-v4/src/quotas/types.ts | Refactors quota types into service-specific unions and renames service type. |
| packages/api-v4/src/quotas/quotas.ts | Updates API client functions to use QuotaServiceType naming and param names. |
Comments suppressed due to low confidence (1)
packages/manager/src/features/Account/Quotas/QuotasPanel/QuotasTable.tsx:69
- The error state JSX includes stray whitespace nodes and a literal semicolon (
;) after<ErrorState />, which will render an extra character in the UI and is likely unintended. Remove the{' '}wrappers and the semicolon so the error state only renders theErrorState(and any desired container).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…hat allows to quickly introduce new services. Added service selector.
…hat allows to quickly introduce new services. Added service selector.
cad288d to
ed3fc1f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 35 out of 35 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
packages/manager/src/features/Account/Quotas/QuotasPanel/QuotasTable.tsx:69
- This error-state JSX is rendering stray whitespace and a literal semicolon (
<ErrorState ... />;) inside the Stack. That will show up in the UI and is easy to miss in snapshots. Remove the extra{' '}nodes and the semicolon so only theErrorStateis rendered.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Changesets needs to be added for api-v4, manager and queries. |
tanushree-akamai
left a comment
There was a problem hiding this comment.
Changesets needs to be added for api-v4, manager and queries.
|
@tanushree-akamai I added the changesets. |
Cloud Manager UI test results🔺 3 failing tests on test run #44 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/parentChild/account-switching.spec.ts,cypress/e2e/core/objectStorage/access-key.e2e.spec.ts,cypress/e2e/core/objectStorage/object-storage.e2e.spec.ts" |
|||||||||||||||||||||||
|
Please verify the failing integration tests are related to this PR or not before merging. If related, they need to be fixed or QA needs to be informed. |
|
@tanushree-akamai They are not related. OBJ tests are unfortunately unstable at the moment. |
…ition that allows to quickly introduce new services. Added service selector.
Description 📝
This PR adds a service selector to the Quotas page. It also drastically refactors Quota components in preparation of adding a new service for Volume quotas. Due to the fact that the quota endpoint don't follow a shared pattern, services are highly configurable now, which should make adding new services much less painfull.
Changes 🔄
List any change(s) relevant to the reviewer.
Scope 🚢
Upon production release, changes in this PR will be visible to:
Target release date 🗓️
4/29
Preview 📷
Include a screenshot
<img src="" />or video<video src="" />of the change.🔒 Use the Mask Sensitive Data setting for security.
💡 For changes requiring multiple steps to validate, prefer a video for clarity.
|


|
|
How to test 🧪
Prerequisites
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅