-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(admin): add unit formatting for emerge categories in admin provisioning #106941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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
5366a6b to
e9b67bf
Compare
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
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:
isEmergeCategory()andgetCategoryUnitSuffix()helper functions indataCategory.tsxshortenedUnitNamevalues: "upload" → "build", "distribution" → "install"Test plan
isEmergeCategory()andgetCategoryUnitSuffix()