refactor(analytics): D5 migrate MetaMetrics.getInstance() to analytics.trackEvent in ramps-controller#28339
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 927511e1bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cbdc89e. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
This is an internal refactoring with no UI changes, no new features, and no changes to the ramps flow itself. The new The only risk is that the analytics events for on-ramp/off-ramp order status changes might not fire correctly if the new utility has different behavior. SmokeRamps is the appropriate tag to validate this. No other tags are needed as the change is isolated to the ramps analytics handler with no cross-cutting impact on other flows. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |




Description
Part of the ongoing analytics migration (#26686). This PR migrates the ramps-controller analytics event handler away from the legacy
MetaMetricssingleton.MetaMetrics.getInstance().trackEvent(...)withanalytics.trackEvent(...)MetricsEventBuilderwithAnalyticsEventBuilderfromutil/analyticsutil/analytics/analyticsinstead of theMetaMetricssingleton, usingjest.mocked()per project standardsThis is a prerequisite for deleting
MetaMetrics.tsin Phase E1.Changelog
CHANGELOG entry: null
Related issues
Fixes: #28324
Manual testing steps
N/A
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Refactor-only migration of a single ramps analytics emitter from the legacy MetaMetrics singleton to the new analytics wrapper; main risk is accidental event shape/name changes due to the builder swap, covered by unit tests.
Overview
Migrates ramps order status analytics emission from the legacy
MetaMetrics.getInstance().trackEvent(...)pathway toanalytics.trackEvent(...), switching the event builder fromMetricsEventBuildertoAnalyticsEventBuilder.Updates the associated unit test to mock
util/analytics/analytics(and wireanalytics.trackEventviajest.mocked()), while preserving the same event categories/properties expectations and error-logging behavior.Reviewed by Cursor Bugbot for commit 00baca2. Bugbot is set up for automated code reviews on this repo. Configure here.