Skip to content

feat(billing): Add formatting configuration to DATA_CATEGORY_INFO formatting#104025

Merged
dashed merged 2 commits intomasterfrom
BIL-952/chart-functions-2
Dec 10, 2025
Merged

feat(billing): Add formatting configuration to DATA_CATEGORY_INFO formatting#104025
dashed merged 2 commits intomasterfrom
BIL-952/chart-functions-2

Conversation

@dashed
Copy link
Copy Markdown
Member

@dashed dashed commented Nov 25, 2025

Closes https://linear.app/getsentry/issue/BIL-1812/stack-2-migrate-chart-functions-to-use-formatting-config
Continues from #104023

  • Update mapReservedToChart to use formatting.reservedMultiplier instead of isByteCategory() check with GIGABYTE constant
  • Update formatProjected to use formatting.projectedAbbreviated instead of hardcoded category !== DataCategory.ATTACHMENTS check
  • Export mapReservedToChart and add unit tests for multiplier logic

@dashed dashed self-assigned this Nov 25, 2025
@dashed dashed requested a review from a team as a code owner November 25, 2025 22:14
@linear
Copy link
Copy Markdown

linear bot commented Nov 25, 2025

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 25, 2025
@dashed dashed force-pushed the BIL-952/foundation-1 branch from 11c4c9c to 0af1efd Compare December 9, 2025 22:04
@dashed dashed force-pushed the BIL-952/chart-functions-2 branch from 3cd51e3 to a7512c0 Compare December 9, 2025 22:04
@dashed dashed force-pushed the BIL-952/chart-functions-2 branch from a7512c0 to 15bd4a0 Compare December 10, 2025 02:26
Base automatically changed from BIL-952/foundation-1 to master December 10, 2025 18:03
…atting

- Update mapReservedToChart to use formatting.reservedMultiplier
  instead of isByteCategory() check with GIGABYTE constant
- Update formatProjected to use formatting.projectedAbbreviated
  instead of hardcoded DataCategory.ATTACHMENTS check
- Export mapReservedToChart and add unit tests for multiplier logic

Part of BIL-952: Move formatting functions to DATA_CATEGORY_INFO
});

describe('mapReservedToChart', () => {
it('should apply GIGABYTE multiplier for byte categories (attachments)', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: you could just cut down the tests to three for byte categories, duration categories, and count categories (plus the two edges cases for unlimited and null) since there isn't actually any differentiation between individual categories within those subsets

Remove duplicate tests for categories that share the same multiplier logic.
Each multiplier type (byte, duration, count) now has a single representative test.
@dashed dashed merged commit d08ad42 into master Dec 10, 2025
47 checks passed
@dashed dashed deleted the BIL-952/chart-functions-2 branch December 10, 2025 19:48
dashed added a commit that referenced this pull request Dec 12, 2025
…atting (#104688)

Closes
https://linear.app/getsentry/issue/BIL-1813/stack-3-migrate-format-functions-to-use-formatting-config

Continues from #104025


- Update formatReservedWithUnits to use formatting.unitType instead of
isByteCategory() check
- Update formatUsageWithUnits to use formatting.unitType instead of
isByteCategory() and isContinuousProfiling() checks
- Update convertUsageToReservedUnit to use formatting.unitType
- Remove unused imports of isByteCategory and isContinuousProfiling
@github-actions github-actions bot locked and limited conversation to collaborators Dec 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants