Skip to content

feat: STORIF-330: refactored handling of Quotas. Introduced a service defin…#13557

Open
skulpok-akamai wants to merge 6 commits intolinode:developfrom
skulpok-akamai:feature/storif-330
Open

feat: STORIF-330: refactored handling of Quotas. Introduced a service defin…#13557
skulpok-akamai wants to merge 6 commits intolinode:developfrom
skulpok-akamai:feature/storif-330

Conversation

@skulpok-akamai
Copy link
Copy Markdown
Contributor

@skulpok-akamai skulpok-akamai commented Apr 3, 2026

…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.

  • added a service selector
  • refactored quota components
  • improved quota table rendering (quota data is being rendered as soon as it's ready).

Scope 🚢

Upon production release, changes in this PR will be visible to:

  • All customers
  • Some customers (e.g. in Beta or Limited Availability)
  • No customers / Not applicable

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.

Before After

|
image
|
image
|

How to test 🧪

Prerequisites

  1. Enable object storage (create bucket or an access key)
  2. Navigate to Administration -> Quotas
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


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All tests and CI checks are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@skulpok-akamai skulpok-akamai force-pushed the feature/storif-330 branch 18 times, most recently from bb970f4 to 758d7b8 Compare April 7, 2026 15:50
@skulpok-akamai skulpok-akamai marked this pull request as ready for review April 7, 2026 15:50
@skulpok-akamai skulpok-akamai requested review from a team as code owners April 7, 2026 15:50
@skulpok-akamai skulpok-akamai requested review from jdamore-linode and removed request for a team April 7, 2026 15:50
@skulpok-akamai skulpok-akamai force-pushed the feature/storif-330 branch 5 times, most recently from 1aa9b45 to eae49c6 Compare April 8, 2026 09:45
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

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 the ErrorState (and any desired container).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/manager/src/mocks/presets/crud/handlers/quotas.ts Outdated
Comment thread packages/manager/src/features/Account/Quotas/hooks/useQuotasWithUsageQuery.ts Outdated
Comment thread packages/queries/src/quotas/quotas.ts Outdated
Comment thread packages/manager/src/features/Account/Quotas/QuotasPanel/ScopeValueSelect.tsx Outdated
Comment thread packages/manager/src/features/Account/Quotas/QuotasPanel/ScopeValueSelect.tsx 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

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 the ErrorState is rendered.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/manager/src/features/Account/Quotas/quotaServices.ts Outdated
@tanushree-akamai
Copy link
Copy Markdown
Contributor

Changesets needs to be added for api-v4, manager and queries.

Copy link
Copy Markdown
Contributor

@tanushree-akamai tanushree-akamai left a comment

Choose a reason for hiding this comment

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

Changesets needs to be added for api-v4, manager and queries.

@github-project-automation github-project-automation bot moved this from Review to Changes Requested in Cloud Manager Apr 15, 2026
@skulpok-akamai
Copy link
Copy Markdown
Contributor Author

@tanushree-akamai I added the changesets.

@linode-gh-bot
Copy link
Copy Markdown

Cloud Manager UI test results

🔺 3 failing tests on test run #44 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
3 Failing912 Passing11 Skipped42m 53s

Details

Failing Tests
SpecTest
account-switching.spec.tsCloud Manager Cypress Tests→Parent/Child account switching→From Parent to Child » can search child accounts
access-key.e2e.spec.tsCloud Manager Cypress Tests→object storage access key end-to-end tests » can create an access key with limited access - e2e
object-storage.e2e.spec.tsCloud Manager Cypress Tests→object storage end-to-end tests » can update bucket access

Troubleshooting

Use 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"

@tanushree-akamai
Copy link
Copy Markdown
Contributor

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.

@skulpok-akamai
Copy link
Copy Markdown
Contributor Author

@tanushree-akamai They are not related. OBJ tests are unfortunately unstable at the moment.

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

Labels

None yet

Projects

Status: Changes Requested

Development

Successfully merging this pull request may close these issues.

4 participants