Skip to content

feat(admin): add unit formatting for emerge categories in admin provisioning#106941

Merged
dashed merged 6 commits intomasterfrom
billing/BIL-1928
Feb 3, 2026
Merged

feat(admin): add unit formatting for emerge categories in admin provisioning#106941
dashed merged 6 commits intomasterfrom
billing/BIL-1928

Conversation

@dashed
Copy link
Copy Markdown
Member

@dashed dashed commented Jan 25, 2026

Closes https://linear.app/getsentry/issue/BIL-1928/add-formatting-for-admin-provisioning

Summary

Adds unit formatting for emerge data categories (SIZE_ANALYSIS, INSTALLABLE_BUILD) in the admin provisioning UI:

  • Add isEmergeCategory() and getCategoryUnitSuffix() helper functions in dataCategory.tsx
  • Fix shortenedUnitName values: "upload" → "build", "distribution" → "install"
  • Update provision subscription modal to use new helper for all category unit suffixes
  • Add emerge category handling in gift events modal with proper unit labels

Test plan

  • Unit tests added for isEmergeCategory() and getCategoryUnitSuffix()
  • Verify admin provisioning modal shows "(in builds)" suffix for SIZE_ANALYSIS
  • Verify admin provisioning modal shows "(in installs)" suffix for INSTALLABLE_BUILD
  • Verify gift events modal shows correct unit in label/help for emerge categories

@linear
Copy link
Copy Markdown

linear bot commented Jan 25, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 25, 2026
@dashed dashed self-assigned this Jan 26, 2026
@dashed dashed marked this pull request as ready for review January 26, 2026 22:28
@dashed dashed requested a review from a team as a code owner January 26, 2026 22:28
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Add utility functions for emerge data categories (SIZE_ANALYSIS,
INSTALLABLE_BUILD) to support unit formatting in admin UI.

- isEmergeCategory(): identifies emerge billing categories
- getCategoryUnitSuffix(): returns appropriate unit suffix for all
  category types (GB, hours, builds, installs)

Includes comprehensive tests for both functions.

BIL-1928
Fix naming inconsistencies in BILLED_DATA_CATEGORY_INFO:
- SIZE_ANALYSIS: "upload" → "build"
- INSTALLABLE_BUILD: "distribution" → "install"

BIL-1928
Replace inline isByteCategory check with getCategoryUnitSuffix helper
to support unit suffixes for all category types including emerge
categories (builds, installs).

BIL-1928
Add unit formatting support for emerge categories in the gift events
admin modal:
- Add isEmergeCategory check in getLabel() for proper labeling
- Add SIZE_ANALYSIS handling with "build/builds" suffix
- Add INSTALLABLE_BUILD handling with "install/installs" suffix

BIL-1928
Revert to only adding "(in GB)" suffix for byte categories in the
provision subscription modal. The previous change to use
getCategoryUnitSuffix() added redundant suffixes for categories
whose display names already include the unit (e.g., "Continuous
Profile Hours (in hours)", "Size Analysis Builds (in builds)").
Remove the getCategoryUnitSuffix function and its tests. This helper
was added but its usage was reverted in c91934e because it caused
redundant suffixes (e.g., "Size Analysis Builds (in builds)") when
category display names already include the unit.

The isEmergeCategory helper is kept as it's actively used in
addGiftEventsAction.tsx.
Copy link
Copy Markdown
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

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

lgtm

@dashed dashed merged commit ed57879 into master Feb 3, 2026
57 checks passed
@dashed dashed deleted the billing/BIL-1928 branch February 3, 2026 19:59
jaydgoss pushed a commit that referenced this pull request Feb 12, 2026
…sioning (#106941)

Closes
https://linear.app/getsentry/issue/BIL-1928/add-formatting-for-admin-provisioning

## Summary

Adds unit formatting for emerge data categories (SIZE_ANALYSIS,
INSTALLABLE_BUILD) in the admin provisioning UI:

- Add `isEmergeCategory()` and `getCategoryUnitSuffix()` helper
functions in `dataCategory.tsx`
- Fix `shortenedUnitName` values: "upload" → "build", "distribution" →
"install"
- Update provision subscription modal to use new helper for all category
unit suffixes
- Add emerge category handling in gift events modal with proper unit
labels

## Test plan

- [x] Unit tests added for `isEmergeCategory()` and
`getCategoryUnitSuffix()`
- [ ] Verify admin provisioning modal shows "(in builds)" suffix for
SIZE_ANALYSIS
- [ ] Verify admin provisioning modal shows "(in installs)" suffix for
INSTALLABLE_BUILD
- [ ] Verify gift events modal shows correct unit in label/help for
emerge categories
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2026
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