feat(ramp): opt-in RAMPS debug dashboard tooling#28110
Conversation
…OWNERS Made-with: Cursor
|
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. |
- Env-gated dynamic import (RAMPS_DEBUG_DASHBOARD) and optional WS URL - Document setup in app/components/UI/Ramp/debug/README.md - Vendor ramps-debug-dashboard server; CODEOWNERS for Money Movement Made-with: Cursor
Made-with: Cursor
…scan - Add isRampsDebugDashboardEnabled / getRampsDebugDashboardWebSocketUrl in environment - Wire RampsDebugBridge and ramps-controller-init to helpers; extend unit tests - Ignore ramps-debug-dashboard/ in MetaMask security-code-scanner paths_ignored Made-with: Cursor
- Type RampsDebugBridge registerWidgetCallback stub (lint:tsc) - Ignore ramps-debug-dashboard/ in PR max-lines count - Exclude app/components/UI/Ramp/debug from Sonar analysis and coverage - Root yarn ramps:debug-dashboard scripts + README quick start Made-with: Cursor
- Move host tooling from repo root to scripts/money-movement/debug-dashboard - Own scripts/money-movement/ in CODEOWNERS; update scanner paths and docs - Fix setup/start/teardown repo-root resolution for nested path Made-with: Cursor
… scripts - CODEOWNERS: only add scripts/money-movement/ for @MetaMask/ramp (match main) - Remove setup/start/teardown (obsolete bridge copy + skip-worktree flow; bridge is in-repo) - Simplify debug-dashboard package.json scripts; align README wording Made-with: Cursor
- Add run.sh: npm ci if needed then server; yarn ramps:debug-dashboard only - Enable RampsDebugBridge in __DEV__ without RAMPS_DEBUG_* env vars - Hardcode ws://localhost:8099 in bridge; document adb reverse for Android - Remove env helpers/tests and .js.env.example RAMPS_DEBUG lines Made-with: Cursor
- Use require under __DEV__ so Jest can mock RampsDebugBridge (dynamic import fails without vm modules) - Exclude ramps-controller-init from test env inlining for __DEV__ toggling - Add __DEV__ test asserting initRampsDebugBridge wiring - Place eslint-disable-next-line on require line for no-require-imports Made-with: Cursor
- Require RAMPS_DEBUG_DASHBOARD=true with __DEV__ to load bridge (no reconnect for most devs) - Document .js.env and example; extend tests for env gate and bridge loading Made-with: Cursor
Mitigates DOM XSS findings (CodeQL) when rendering controller state from WebSocket. Made-with: Cursor
… rejections - Serve DOMPurify from vendor/purify.min.js (no nested yarn install) - Ignore vendor bundle in ESLint - Harden dashboard HTML sanitization paths for CodeQL - RampsDebugBridge: only onFulfilled handler on instrumented promises Made-with: Cursor
…init test - Drop vendored purify.min.js and /purify route; load pinned DOMPurify from jsDelivr - Revert root .eslintignore vendor entry - Ignore scripts/money-movement/debug-dashboard in MetaMask security code scanner - Build initial RampsController test state from getDefaultRampsControllerState() Made-with: Cursor
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.
Made-with: Cursor
Made-with: Cursor
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Since the ramps-controller-init.ts is a CRITICAL file (app/core/Engine/ path) and it was modified, running SmokeRamps provides a safety net to verify the ramps controller initialization still works correctly in a real E2E scenario. However, the actual risk is very low since the changes are purely additive dev-only code that cannot execute in production/E2E builds. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #28110 +/- ##
==========================================
- Coverage 82.63% 82.54% -0.10%
==========================================
Files 4854 4860 +6
Lines 125092 125561 +469
Branches 27919 28114 +195
==========================================
+ Hits 103376 103640 +264
- Misses 14600 14760 +160
- Partials 7116 7161 +45 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|




Description
Adds opt-in developer tooling so Money Movement / RAMPS engineers can stream
RampsControllerstate and calls to a local browser dashboard without loading the bridge for every dev build.RAMPS_DEBUG_DASHBOARD=truein.js.env+ Metro restart enables the bridge;RAMPS_DEBUG_DASHBOARD_URLoverrides the WebSocket URL (devices/emulators).import()fromramps-controller-init.tsso the bridge (including fetch instrumentation) is omitted from the bundle unless enabled.app/components/UI/Ramp/debug/README.md— setup,adb reverse, env vars.ramps-debug-dashboard/— self-contained Node server (npm ci+node server.mjs); session logs gitignored.@MetaMask/money-movement) andramps-debug-dashboard/entry.Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Ramps Debug Dashboard - Watch Video
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Dev-only code now conditionally patches
fetchand wrapsRampsControllermethods whenRAMPS_DEBUG_DASHBOARD=true, which could affect local debugging behavior if enabled. Production behavior should remain unchanged due to__DEV__gating and optionalrequire.Overview
Adds an opt-in,
__DEV__-only “RAMPS debug dashboard” that streamsRampsControllerstate changes, method calls (with timing/cache-hit heuristics), and selected ramps-relatedfetchtraffic tows://localhost:8099.Introduces a self-contained host dashboard under
scripts/money-movement/debug-dashboard/(Node HTTP+WebSocket server, JSONL session logging, andyarn ramps:debug-dashboardrunner) plus new docs and env var guidance in.js.env.example.Updates
ramps-controller-initto conditionallyrequireand initialize the bridge whenRAMPS_DEBUG_DASHBOARD=true, adds Jest coverage for that gating, and excludes the new debug tooling from Sonar coverage and the security code scanner.Written by Cursor Bugbot for commit b8ed425. This will update automatically on new commits. Configure here.