Skip to content

Conversation

@dashed
Copy link
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
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 25, 2026
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
@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
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.

hadCustomDynamicSampling: isAm3Ds,
});
const suffix = isByteCategory(category) ? ' (in GB)' : '';
const suffix = getCategoryUnitSuffix(category);
Copy link
Contributor

Choose a reason for hiding this comment

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

Redundant unit suffixes for categories with units in name

Low Severity

The switch from isByteCategory(category) ? ' (in GB)' : '' to getCategoryUnitSuffix(category) now adds redundant suffixes to categories whose display names already contain the unit. For continuous profiling categories (display name "Continuous Profile Hours") this produces "Reserved Continuous Profile Hours (in hours)". Similarly, SIZE_ANALYSIS ("Size Analysis Builds") becomes "Reserved Size Analysis Builds (in builds)". The old code correctly omitted suffixes for non-byte categories.

Additional Locations (1)

Fix in Cursor Fix in Web

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

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

2 participants