Follow-up improvements for usage events simulation tool
Overview
This issue tracks follow-up improvements for the usage events simulation tool introduced in !14761.
Open Points
1. Add placeholder text for unique_instance_id field
Reference: https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/14761#note_3111929368
For consistency with the root namespace ID field which has a "Required for SaaS realm" placeholder, consider adding a similar placeholder for the unique_instance_id field:
= text_field_tag :unique_instance_id, nil, class: 'form-control', placeholder: 'Required for Self-Managed realm, e.g. a1b2c3d4-e5f6-7890-abcd-ef1234567890'
This would improve UX by clearly indicating when this field is required.
2. Consider DRYing up event type extraction logic
Reference: https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/14761#note_3111928003
The event type extraction logic in the simulation tool currently mirrors the logic used in consumption (ConsumptionCoordinatorJob). Both use .map to extract event types from the schema.
While this duplication ensures consistency, there's a risk that these two implementations could diverge over time. Consider:
- Extracting this logic to a shared module/service
- Adding documentation about keeping these in sync
- Or accepting the duplication with clear comments explaining the relationship
3. Consider if extracting CATEGORY_MAPPING would be useful
Reference: https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/14761#note_3111726274
Related
- !14761 - Original MR introducing the simulation tool