Skip to content

usage capability percent#249

Merged
Polliog merged 2 commits into
developfrom
feat/usage-capability-percent
Jun 13, 2026
Merged

usage capability percent#249
Polliog merged 2 commits into
developfrom
feat/usage-capability-percent

Conversation

@Polliog

@Polliog Polliog commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces a new "Plan limits" section to the usage page, providing visibility into live capability usage versus plan limits for organizations. It includes a new backend API endpoint to aggregate and serve this data, frontend integration to display progress bars for each measurable capability, and comprehensive tests. The changes touch both backend (API, logic, and tests) and frontend (API integration and UI).

Backend: Capability usage aggregation and API

  • Added a new backend module (capability-usage.ts) that aggregates current usage and configured caps for all measurable capabilities (resource limits and consumption quotas), excluding boolean gates and config ceilings like audit.retention_days. Usage is computed using existing logic for resource counts and quota consumption, and unlimited caps are represented as null.
  • Exposed a new GET /api/v1/usage/capabilities endpoint that returns the per-capability usage and limit for the authenticated organization, with validation and membership checks. [1] [2] [3]
  • Added backend tests to ensure only measurable capabilities are returned, unlimited caps are handled correctly, and usage/limits are accurately reported.

Frontend: Usage page enhancements

  • Added API methods and types to fetch and represent capability usage data from the new endpoint.
  • Updated the settings usage page to fetch and display capability usage vs plan limits as a new "Plan limits" section. This includes progress bars color-coded by usage percentage, user-friendly labels, units (counts or bytes), and special handling for unlimited caps. [1] [2] [3] [4] [5] [6]

Documentation

  • Updated the CHANGELOG.md with a detailed entry describing the new capability usage feature, its backend and frontend behavior, and its exclusions.

@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.12871% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/backend/src/modules/metering/routes.ts 31.57% 13 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Polliog Polliog merged commit 5306d14 into develop Jun 13, 2026
7 checks passed
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.

1 participant