Skip to content

test(firefox): extract xpi cache helper#41453

Merged
itsyoboieltr merged 26 commits intomainfrom
codex/firefox-xpi-comment-metadata-spike
Apr 9, 2026
Merged

test(firefox): extract xpi cache helper#41453
itsyoboieltr merged 26 commits intomainfrom
codex/firefox-xpi-comment-metadata-spike

Conversation

@davidmurdoch
Copy link
Copy Markdown
Contributor

@davidmurdoch davidmurdoch commented Apr 2, 2026

Description

This extracts the Firefox XPI cache/build logic into test/e2e/helpers/xpi.ts, updates the Firefox WebDriver path to use that helper, and refreshes the benchmark so the optimized scenarios exercise getOrBuildXpi(...) through the realistic filesystem flow. We no longer use the linux zip utility, and instead use only JavaScript (making use of Node.js modules).

Behavior note: the previous Firefox cache logic rebuilt when manifest.json content changed or when any non-manifest file had an mtime newer than the cached XPI. The new helper no longer scans mtimes. It reuses on exact manifest-hash match, patches only when the manifest hash changed but build_id stayed the same, and fully rebuilds when the manifest hash changed and build_id differs or is missing.

I ran some Benchmarks:

TL;DR:

Cold start is about 13% faster than before (~767ms faster), warm start is slightly faster (~60ms faster), warm start with a manifest change is about 25% faster (~1353ms faster).

Run: https://github.com/MetaMask/metamask-extension/actions/runs/24053569816

Refs:

  • main: c6abb14bf8734f99503767a58ebbf676a704f3be
  • candidate: be5469700ca92278d8254ea4009d37e14b855fa6

Iterations: 15

Summary

Scenario Metric main candidate delta
cold total mean 5782.2 ms 5015.4 ms -766.8 ms
cold total median 5367.1 ms 4592.6 ms -774.5 ms
cold total p95 11689.7 ms 10858.1 ms -831.6 ms
warmUnchanged total mean 4061.6 ms 4001.3 ms -60.3 ms
warmUnchanged total median 4046.1 ms 4007.0 ms -39.1 ms
warmUnchanged total p95 4240.7 ms 4137.0 ms -103.7 ms
warmManifestUpdate total mean 5366.0 ms 4012.6 ms -1353.4 ms
warmManifestUpdate total median 5367.2 ms 4017.8 ms -1349.4 ms
warmManifestUpdate total p95 5465.5 ms 4057.7 ms -1407.8 ms

Breakdown

Cold

Phase main mean candidate mean delta main median candidate median delta main p95 candidate p95 delta
builder.build 430.2 ms 426.1 ms -4.1 ms 10.3 ms 12.1 ms +1.8 ms 6308.3 ms 6221.1 ms -87.1 ms
addonSetup 1310.1 ms 2203.0 ms +892.9 ms 1308.3 ms 2204.2 ms +895.9 ms 1318.5 ms 2275.6 ms +957.1 ms
installExtension 3629.3 ms 1970.8 ms -1658.4 ms 3633.9 ms 1958.8 ms -1675.1 ms 3695.7 ms 2068.3 ms -1627.4 ms
getInternalId 412.6 ms 415.4 ms +2.9 ms 418.1 ms 422.5 ms +4.3 ms 441.2 ms 437.5 ms -3.8 ms
total 5782.2 ms 5015.4 ms -766.8 ms 5367.1 ms 4592.6 ms -774.5 ms 11689.7 ms 10858.1 ms -831.6 ms

Warm Unchanged

Phase main mean candidate mean delta main median candidate median delta main p95 candidate p95 delta
builder.build 10.5 ms 13.9 ms +3.4 ms 10.3 ms 13.9 ms +3.6 ms 11.5 ms 14.0 ms +2.5 ms
addonSetup 10.9 ms 10.5 ms -0.4 ms 10.9 ms 10.6 ms -0.3 ms 13.7 ms 11.2 ms -2.4 ms
installExtension 3631.6 ms 3575.7 ms -56.0 ms 3629.5 ms 3569.9 ms -59.5 ms 3793.7 ms 3685.7 ms -108.0 ms
getInternalId 408.5 ms 401.2 ms -7.3 ms 415.0 ms 390.2 ms -24.8 ms 428.5 ms 432.0 ms +3.5 ms
total 4061.6 ms 4001.3 ms -60.3 ms 4046.1 ms 4007.0 ms -39.1 ms 4240.7 ms 4137.0 ms -103.7 ms

Warm Manifest Update

Phase main mean candidate mean delta main median candidate median delta main p95 candidate p95 delta
builder.build 10.5 ms 14.0 ms +3.6 ms 10.3 ms 14.0 ms +3.7 ms 11.6 ms 14.8 ms +3.3 ms
addonSetup 1326.0 ms 11.3 ms -1314.6 ms 1323.7 ms 11.3 ms -1312.4 ms 1338.1 ms 12.3 ms -1325.7 ms
installExtension 3624.7 ms 3576.4 ms -48.3 ms 3619.8 ms 3564.3 ms -55.5 ms 3707.3 ms 3631.6 ms -75.7 ms
getInternalId 404.9 ms 410.9 ms +6.0 ms 416.8 ms 420.0 ms +3.1 ms 436.2 ms 431.2 ms -5.0 ms
total 5366.0 ms 4012.6 ms -1353.4 ms 5367.2 ms 4017.8 ms -1349.4 ms 5465.5 ms 4057.7 ms -1407.8 ms

Notes

  • Candidate is faster in all three scenarios in this rerun.
  • warmUnchanged is no longer a regression; installExtension is about 56 ms faster on average.
  • warmManifestUpdate still shows the biggest gain, at about 1353 ms faster on average.
  • In this benchmark, warmManifestUpdate means a manifest-only change where build_id stays the same. Real runtime bundle changes now force a full XPI rebuild instead of an in-place patch.
  • Cold builder.build on main still has a huge outlier, so medians are more trustworthy than means for that phase.

Changelog

CHANGELOG entry: null

Manual testing steps

  1. Clear any existing cached Firefox XPI and build the Firefox test bundle:
    rm -f /tmp/metamask-e2e-*.xpi
    yarn build:test:mv2
  2. Run a Firefox E2E spec once to exercise the cold-cache path:
    yarn test:e2e:single test/e2e/tests/onboarding/onboarding.spec.ts --browser=firefox --debug
    Confirm the terminal prints [Firefox E2E] Cache missing or invalid, building XPI once and Firefox installs the extension successfully.
  3. Run the same command again to exercise the warm unchanged path. Confirm Firefox still launches successfully and the cold-cache log does not appear on the second run.
  4. Run a Firefox E2E spec that sets manifest flags:
    yarn test:e2e:single test/e2e/tests/network/linea-discover-button.spec.ts --browser=firefox --debug
    Confirm Firefox launches successfully again and the cold-cache log still does not appear, showing the cached XPI was reused while the manifest changed.

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Build/test tooling now emits a build_id into manifests for test/watch builds and uses it to drive Firefox XPI caching/patching; mistakes could cause flaky watch rebuilds or broken Firefox addon installs in CI/local e2e runs.

Overview
Adds optional manifest build IDs for test builds. ManifestPlugin gains a setBuildId option (schema/types/config) that injects build_id (from compilation.fullHash) into emitted manifest.json without mutating the in-memory manifest, with new/updated unit tests and watch-mode coverage.

Revamps Firefox e2e XPI caching to be pure Node and build-id aware. Introduces test/e2e/helpers/xpi.ts to build/cache XPIs via yazl and to patch only the manifest in-place when the manifest hash changes but build_id is stable; test/e2e/webdriver/firefox.js now uses this helper and drops the previous zip-binary/mtime-based logic.

Updates gulp manifest tasks for tests. development/build/manifest.js can now assign a random build_id for test/testDev tasks and, for testDev, re-apply manifest updates on dist changes via gulp-watch.

Reviewed by Cursor Bugbot for commit f1cf4a7. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

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.

@metamaskbot metamaskbot added the team-extension-platform Extension Platform team label Apr 2, 2026
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Apr 2, 2026

Builds ready [ce49951]
⚡ Performance Benchmarks (Total: 🟢 18 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 68fd19c | Date: 5/9/58222 | Pipeline: 23913749705 | Baseline logs

Interaction Benchmarks
Benchmarkchrome-browserify
loadNewAccount🟢 [Show logs]
confirmTx🟢 [Show logs]
bridgeUserActions🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • bridgeUserActions/bridge_load_asset_picker: -14%
Startup Benchmarks
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]
startupPowerUserHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/initialActions: +43%
  • startupPowerUserHome/backgroundConnect: +36%
  • startupPowerUserHome/firstReactRender: +11%
  • startupPowerUserHome/setupStore: +17%
  • startupPowerUserHome/numNetworkReqs: -44%
  • startupStandardHome/firstPaint: +12%
  • startupStandardHome/backgroundConnect: -11%
  • startupPowerUserHome/domInteractive: -11%
  • startupPowerUserHome/numNetworkReqs: +37%
  • startupStandardHome/domInteractive: -42%
  • startupStandardHome/initialActions: -17%
  • startupPowerUserHome/domInteractive: +15%
  • startupStandardHome/domInteractive: -45%
  • startupStandardHome/initialActions: -38%
  • startupStandardHome/setupStore: +31%
  • startupPowerUserHome/backgroundConnect: -15%
  • startupPowerUserHome/firstReactRender: +11%
  • startupPowerUserHome/setupStore: -11%
User Journey Benchmarks
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟢 [Show logs]
solanaAssetDetails🟢 [Show logs]
importSrpHome🟢 [Show logs]
sendTransactions🟢 [Show logs]
swap🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/metricsToWalletReadyScreen: -23%
  • onboardingImportWallet/doneButtonToHomeScreen: -76%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +57%
  • onboardingImportWallet/total: -35%
  • onboardingNewWallet/skipBackupToMetricsScreen: +12%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: +65%
  • onboardingNewWallet/doneButtonToAssetList: -23%
  • onboardingNewWallet/total: -18%
  • assetDetails/assetClickToPriceChart: -67%
  • assetDetails/total: -67%
  • solanaAssetDetails/assetClickToPriceChart: -59%
  • solanaAssetDetails/total: -59%
  • importSrpHome/loginToHomeScreen: +19%
  • importSrpHome/openAccountMenuAfterLogin: -17%
  • importSrpHome/homeAfterImportWithNewWallet: -25%
  • importSrpHome/total: -21%
  • sendTransactions/openSendPageFromHome: +14%
  • sendTransactions/selectTokenToSendFormLoaded: +22%
  • sendTransactions/reviewTransactionToConfirmationPage: +19%
  • sendTransactions/total: +19%
  • swap/openSwapPageFromHome: -85%
  • swap/fetchAndDisplaySwapQuotes: +26%
🌐 Dapp Page Load Benchmarks

Current Commit: ce49951 | Date: 4/2/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±40ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 734ms (±36ms) 🟢 | historical mean value: 719ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 87ms (±12ms) 🟢 | historical mean value: 85ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 40ms 1.02s 1.35s 1.08s 1.35s
domContentLoaded 734ms 36ms 709ms 1.00s 773ms 1.00s
firstPaint 87ms 12ms 72ms 184ms 96ms 184ms
firstContentfulPaint 87ms 12ms 72ms 184ms 96ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 20 Bytes (0%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Apr 2, 2026

Builds ready [3a117b0]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 1 warn · 🔴 0 fail)

Baseline (latest main): 5cc482e | Date: 6/24/58222 | Pipeline: 23917108963 | Baseline logs

Interaction Benchmarks
Benchmarkchrome-browserify
loadNewAccount
🟡 load_new_account
[Show logs]
confirmTx🟢 [Show logs]
bridgeUserActions🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: +26%
  • loadNewAccount/total: +26%
  • bridgeUserActions/bridge_load_page: +13%
  • bridgeUserActions/bridge_load_asset_picker: -13%
Startup Benchmarks
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]
startupPowerUserHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/domInteractive: +11%
  • startupStandardHome/firstPaint: +13%
  • startupStandardHome/initialActions: +11%
  • startupStandardHome/setupStore: +13%
  • startupPowerUserHome/uiStartup: +13%
  • startupPowerUserHome/domInteractive: -19%
  • startupPowerUserHome/backgroundConnect: +60%
  • startupPowerUserHome/setupStore: -11%
  • startupPowerUserHome/numNetworkReqs: -48%
  • startupStandardHome/firstPaint: +13%
  • startupStandardHome/setupStore: +12%
  • startupPowerUserHome/backgroundConnect: +14%
  • startupPowerUserHome/setupStore: +10%
  • startupPowerUserHome/numNetworkReqs: +57%
  • startupStandardHome/domInteractive: -15%
  • startupStandardHome/initialActions: +67%
  • startupPowerUserHome/load: +12%
  • startupPowerUserHome/domContentLoaded: +12%
  • startupPowerUserHome/domInteractive: +21%
  • startupPowerUserHome/backgroundConnect: -15%
  • startupPowerUserHome/loadScripts: +14%
  • startupPowerUserHome/setupStore: +11%
  • startupStandardHome/backgroundConnect: -10%
  • startupStandardHome/initialActions: -44%
  • startupStandardHome/setupStore: -42%
  • startupPowerUserHome/domInteractive: +14%
  • startupPowerUserHome/setupStore: -12%
User Journey Benchmarks
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟢 [Show logs]
solanaAssetDetails🟢 [Show logs]
importSrpHome🟢 [Show logs]
sendTransactions🟢 [Show logs]
swap🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/metricsToWalletReadyScreen: -23%
  • onboardingImportWallet/doneButtonToHomeScreen: -72%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +43%
  • onboardingImportWallet/total: -34%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: -19%
  • onboardingNewWallet/doneButtonToAssetList: -28%
  • onboardingNewWallet/total: -23%
  • assetDetails/assetClickToPriceChart: -74%
  • assetDetails/total: -74%
  • solanaAssetDetails/assetClickToPriceChart: -47%
  • solanaAssetDetails/total: -47%
  • importSrpHome/openAccountMenuAfterLogin: -19%
  • importSrpHome/homeAfterImportWithNewWallet: -35%
  • importSrpHome/total: -30%
  • sendTransactions/openSendPageFromHome: +40%
  • sendTransactions/reviewTransactionToConfirmationPage: +18%
  • sendTransactions/total: +18%
  • swap/openSwapPageFromHome: -82%
  • swap/fetchAndDisplaySwapQuotes: +24%
🌐 Dapp Page Load Benchmarks

Current Commit: 3a117b0 | Date: 4/2/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±39ms) 🟡 | historical mean value: 1.02s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 722ms (±36ms) 🟢 | historical mean value: 717ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 84ms (±9ms) 🟢 | historical mean value: 85ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 39ms 1.00s 1.32s 1.05s 1.32s
domContentLoaded 722ms 36ms 701ms 1.01s 745ms 1.01s
firstPaint 84ms 9ms 72ms 152ms 92ms 152ms
firstContentfulPaint 84ms 9ms 72ms 152ms 92ms 152ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 503 Bytes (0.01%)
  • ui: -11.54 KiB (-0.14%)
  • common: 15.67 KiB (0.12%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Apr 3, 2026

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/extension-platform (8 files, +253 -38)
  • 📁 development/
    • 📁 build/
      • 📄 manifest.js +61 -26
    • 📁 webpack/
      • 📁 test/
        • 📄 helpers.ts +1 -0
        • 📄 plugins.ManifestPlugin.test.ts +39 -10
        • 📄 webpack.config.test.ts +130 -1
      • 📁 utils/
        • 📁 plugins/
          • 📁 ManifestPlugin/
            • 📄 index.ts +6 -1
            • 📄 schema.ts +5 -0
            • 📄 types.ts +7 -0
        • 📄 webpack.config.ts +4 -0

👨‍🔧 @itsyoboieltr (8 files, +253 -38)
  • 📁 development/
    • 📁 build/
      • 📄 manifest.js +61 -26
    • 📁 webpack/
      • 📁 test/
        • 📄 helpers.ts +1 -0
        • 📄 plugins.ManifestPlugin.test.ts +39 -10
        • 📄 webpack.config.test.ts +130 -1
      • 📁 utils/
        • 📁 plugins/
          • 📁 ManifestPlugin/
            • 📄 index.ts +6 -1
            • 📄 schema.ts +5 -0
            • 📄 types.ts +7 -0
        • 📄 webpack.config.ts +4 -0

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Apr 3, 2026

Builds ready [701e1c9]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 12 warn · 🔴 0 fail)

Baseline (latest main): f34f804 | Date: 9/10/58222 | Pipeline: 23927823249 | Baseline logs

Interaction Benchmarks
Benchmarkchrome-browserify
loadNewAccount🟡 [Show logs]
confirmTx🟡 [Show logs]
bridgeUserActions🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -13%
  • loadNewAccount/total: -13%
  • bridgeUserActions/bridge_load_asset_picker: -12%
  • bridgeUserActions/bridge_search_token: -16%
  • bridgeUserActions/total: -20%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.4s
  • 🟡 confirmTx/FCP: p75 2.5s
  • 🟡 bridgeUserActions/FCP: p75 2.4s
Startup Benchmarks
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]
startupPowerUserHome🟡 [Show logs]🟡 [Show logs]🟡 [Show logs]🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/load: -10%
  • startupStandardHome/domContentLoaded: -12%
  • startupStandardHome/domInteractive: +10%
  • startupStandardHome/backgroundConnect: +15%
  • startupStandardHome/initialActions: -38%
  • startupStandardHome/loadScripts: -15%
  • startupPowerUserHome/uiStartup: -11%
  • startupPowerUserHome/domInteractive: -11%
  • startupPowerUserHome/backgroundConnect: +75%
  • startupPowerUserHome/numNetworkReqs: -13%
  • startupStandardHome/uiStartup: -15%
  • startupStandardHome/load: -15%
  • startupStandardHome/domContentLoaded: -14%
  • startupStandardHome/backgroundConnect: -36%
  • startupStandardHome/firstReactRender: -28%
  • startupStandardHome/loadScripts: -14%
  • startupStandardHome/setupStore: -14%
  • startupStandardHome/numNetworkReqs: -29%
  • startupPowerUserHome/domInteractive: -19%
  • startupPowerUserHome/numNetworkReqs: -23%
  • startupStandardHome/domInteractive: -57%
  • startupStandardHome/initialActions: -38%
  • startupStandardHome/setupStore: +14%
  • startupStandardHome/numNetworkReqs: -18%
  • startupPowerUserHome/uiStartup: -11%
  • startupPowerUserHome/backgroundConnect: -34%
  • startupStandardHome/domInteractive: -35%
  • startupStandardHome/backgroundConnect: -17%
  • startupStandardHome/initialActions: -44%
  • startupStandardHome/setupStore: -60%
  • startupStandardHome/numNetworkReqs: -16%
  • startupPowerUserHome/uiStartup: -10%
  • startupPowerUserHome/backgroundConnect: -33%
  • startupPowerUserHome/setupStore: +17%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 792ms
  • 🔴 startupPowerUserHome/INP: p75 744ms
  • 🟡 startupPowerUserHome/INP: p75 208ms
  • 🟡 startupPowerUserHome/LCP: p75 3.6s
  • 🟡 startupPowerUserHome/LCP: p75 3.5s
User Journey Benchmarks
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟡 [Show logs]
solanaAssetDetails🟡 [Show logs]
importSrpHome🟡 [Show logs]
sendTransactions🟡 [Show logs]
swap🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/metricsToWalletReadyScreen: -31%
  • onboardingImportWallet/doneButtonToHomeScreen: -74%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +32%
  • onboardingImportWallet/total: -40%
  • onboardingNewWallet/skipBackupToMetricsScreen: -16%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: +10%
  • onboardingNewWallet/doneButtonToAssetList: -35%
  • onboardingNewWallet/total: -28%
  • assetDetails/assetClickToPriceChart: -62%
  • assetDetails/total: -62%
  • solanaAssetDetails/assetClickToPriceChart: -60%
  • solanaAssetDetails/total: -60%
  • importSrpHome/loginToHomeScreen: +14%
  • importSrpHome/openAccountMenuAfterLogin: -74%
  • importSrpHome/homeAfterImportWithNewWallet: -38%
  • importSrpHome/total: -31%
  • sendTransactions/openSendPageFromHome: +73%
  • sendTransactions/selectTokenToSendFormLoaded: -10%
  • swap/openSwapPageFromHome: -86%
  • swap/fetchAndDisplaySwapQuotes: +31%
  • swap/total: +14%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/INP: p75 232ms
  • 🟡 assetDetails/FCP: p75 2.5s
  • 🟡 solanaAssetDetails/FCP: p75 2.5s
  • 🟡 importSrpHome/INP: p75 216ms
  • 🟡 importSrpHome/FCP: p75 2.5s
  • 🟡 sendTransactions/INP: p75 224ms
  • 🟡 sendTransactions/FCP: p75 2.5s
  • 🟡 swap/FCP: p75 2.5s
🌐 Dapp Page Load Benchmarks

Current Commit: 701e1c9 | Date: 4/3/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±44ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 725ms (±42ms) 🟢 | historical mean value: 724ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 85ms (±12ms) 🟢 | historical mean value: 86ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 44ms 1.00s 1.38s 1.06s 1.38s
domContentLoaded 725ms 42ms 700ms 1.06s 750ms 1.06s
firstPaint 85ms 12ms 68ms 188ms 96ms 188ms
firstContentfulPaint 85ms 12ms 68ms 188ms 96ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 503 Bytes (0.01%)
  • ui: 4.69 KiB (0.06%)
  • common: 15.7 KiB (0.12%)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Firefox E2E XPI build/cache logic into a shared helper and updates the build pipeline to optionally embed a build identifier into emitted extension manifests for test builds.

Changes:

  • Extracted Firefox XPI caching/build logic into test/e2e/helpers/xpi.ts and updated the Firefox WebDriver to use it.
  • Added an optional setBuildId flag to ManifestPlugin and enabled it for --test webpack builds to emit build_id in the manifest.
  • Expanded webpack tests to cover setBuildId behavior and verify build_id stability across no-op watch rebuilds.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/e2e/webdriver/firefox.js Switches Firefox driver setup to use the new XPI helper.
test/e2e/helpers/xpi.ts New helper implementing cached XPI creation and manifest patching.
development/webpack/webpack.config.ts Enables manifest build_id emission for --test builds.
development/webpack/utils/plugins/ManifestPlugin/types.ts Adds setBuildId option type definition.
development/webpack/utils/plugins/ManifestPlugin/schema.ts Adds setBuildId to plugin option schema.
development/webpack/utils/plugins/ManifestPlugin/index.ts Emits build_id into the manifest when enabled.
development/webpack/test/webpack.config.test.ts Adds tests for --test enabling build IDs + watch rebuild stability.
development/webpack/test/plugins.ManifestPlugin.test.ts Adds coverage for build_id emission and refines watch rebuild tests.
development/webpack/test/helpers.ts Updates mock webpack compiler shape for modifiedFiles.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@davidmurdoch davidmurdoch requested a review from a team as a code owner April 7, 2026 22:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@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.

Fix All in Cursor

❌ 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 ddeadaf. Configure here.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Apr 8, 2026

Builds ready [ddeadaf]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)

Baseline (latest main): f34f804 | Date: 9/10/58222 | Pipeline: 24146984843 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-browserify
loadNewAccount
🟡 load_new_account
[Show logs]
confirmTx🟡 [Show logs]
bridgeUserActions🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: +18%
  • loadNewAccount/total: +18%
  • bridgeUserActions/bridge_load_asset_picker: -34%
  • bridgeUserActions/bridge_search_token: +36%
  • bridgeUserActions/total: +15%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.5s
  • 🟡 confirmTx/FCP: p75 2.5s
  • 🟡 bridgeUserActions/FCP: p75 2.5s
Startup Benchmarks · Samples: 100
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]
startupPowerUserHome🟡 [Show logs]🟡 [Show logs]🟡 [Show logs]🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/domInteractive: +15%
  • startupStandardHome/backgroundConnect: +19%
  • startupStandardHome/initialActions: -38%
  • startupStandardHome/loadScripts: -12%
  • startupPowerUserHome/backgroundConnect: +74%
  • startupPowerUserHome/setupStore: +22%
  • startupPowerUserHome/numNetworkReqs: -53%
  • startupStandardHome/uiStartup: -15%
  • startupStandardHome/load: -14%
  • startupStandardHome/domContentLoaded: -13%
  • startupStandardHome/firstPaint: -18%
  • startupStandardHome/backgroundConnect: -32%
  • startupStandardHome/firstReactRender: -24%
  • startupStandardHome/loadScripts: -13%
  • startupStandardHome/setupStore: -14%
  • startupStandardHome/numNetworkReqs: -29%
  • startupPowerUserHome/domInteractive: -14%
  • startupPowerUserHome/numNetworkReqs: -45%
  • startupStandardHome/domInteractive: -11%
  • startupStandardHome/backgroundConnect: +11%
  • startupStandardHome/firstReactRender: +17%
  • startupStandardHome/initialActions: +25%
  • startupStandardHome/setupStore: +14%
  • startupPowerUserHome/backgroundConnect: -31%
  • startupStandardHome/domInteractive: -30%
  • startupStandardHome/backgroundConnect: -17%
  • startupStandardHome/initialActions: -44%
  • startupStandardHome/setupStore: -60%
  • startupStandardHome/numNetworkReqs: -13%
  • startupPowerUserHome/backgroundConnect: -26%
  • startupPowerUserHome/setupStore: -19%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 760ms
  • 🔴 startupPowerUserHome/INP: p75 736ms
  • 🟡 startupPowerUserHome/LCP: p75 3.5s
  • 🟡 startupPowerUserHome/LCP: p75 3.7s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟡 [Show logs]
solanaAssetDetails🟡 [Show logs]
importSrpHome🟡 [Show logs]
sendTransactions🟡 [Show logs]
swap🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -84%
  • onboardingImportWallet/metricsToWalletReadyScreen: -29%
  • onboardingImportWallet/doneButtonToHomeScreen: -73%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +25%
  • onboardingImportWallet/total: -40%
  • onboardingNewWallet/srpButtonToPwForm: -78%
  • onboardingNewWallet/skipBackupToMetricsScreen: -69%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: -28%
  • onboardingNewWallet/doneButtonToAssetList: -39%
  • onboardingNewWallet/total: -38%
  • assetDetails/assetClickToPriceChart: -47%
  • assetDetails/total: -47%
  • solanaAssetDetails/assetClickToPriceChart: -69%
  • solanaAssetDetails/total: -69%
  • importSrpHome/openAccountMenuAfterLogin: -73%
  • importSrpHome/homeAfterImportWithNewWallet: -70%
  • importSrpHome/total: -60%
  • sendTransactions/selectTokenToSendFormLoaded: -28%
  • sendTransactions/reviewTransactionToConfirmationPage: +34%
  • sendTransactions/total: +31%
  • swap/openSwapPageFromHome: -96%
  • swap/fetchAndDisplaySwapQuotes: +31%
  • swap/total: +11%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/INP: p75 224ms
  • 🟡 assetDetails/FCP: p75 2.5s
  • 🟡 solanaAssetDetails/FCP: p75 2.5s
  • 🟡 importSrpHome/FCP: p75 2.5s
  • 🟡 sendTransactions/INP: p75 232ms
  • 🟡 sendTransactions/FCP: p75 2.5s
  • 🟡 swap/FCP: p75 2.5s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-browserify
dappPageLoad🟢 [Show logs]
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 20 Bytes (0%)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
19.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Apr 8, 2026

Builds ready [f1cf4a7]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)

Baseline (latest main): f34f804 | Date: 9/10/58222 | Pipeline: 24157773801 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-browserify
loadNewAccount🟡 [Show logs]
confirmTx🟡 [Show logs]
bridgeUserActions🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -16%
  • loadNewAccount/total: -16%
  • bridgeUserActions/bridge_load_asset_picker: -34%
  • bridgeUserActions/bridge_search_token: +39%
  • bridgeUserActions/total: +13%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.5s
  • 🟡 confirmTx/FCP: p75 2.5s
  • 🟡 bridgeUserActions/FCP: p75 2.5s
Startup Benchmarks · Samples: 100
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]
startupPowerUserHome🟡 [Show logs]🟡 [Show logs]🟡 [Show logs]🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/load: -12%
  • startupStandardHome/domContentLoaded: -14%
  • startupStandardHome/backgroundConnect: +12%
  • startupStandardHome/initialActions: -38%
  • startupStandardHome/loadScripts: -16%
  • startupStandardHome/numNetworkReqs: -21%
  • startupPowerUserHome/backgroundConnect: +109%
  • startupPowerUserHome/setupStore: +11%
  • startupPowerUserHome/numNetworkReqs: -55%
  • startupStandardHome/uiStartup: -15%
  • startupStandardHome/load: -13%
  • startupStandardHome/domContentLoaded: -13%
  • startupStandardHome/backgroundConnect: -33%
  • startupStandardHome/firstReactRender: -24%
  • startupStandardHome/loadScripts: -12%
  • startupStandardHome/numNetworkReqs: -29%
  • startupPowerUserHome/domInteractive: -22%
  • startupStandardHome/domInteractive: -46%
  • startupStandardHome/initialActions: +25%
  • startupStandardHome/setupStore: +14%
  • startupStandardHome/numNetworkReqs: -18%
  • startupPowerUserHome/backgroundConnect: -33%
  • startupPowerUserHome/setupStore: +35%
  • startupStandardHome/uiStartup: -10%
  • startupStandardHome/domInteractive: -39%
  • startupStandardHome/backgroundConnect: -19%
  • startupStandardHome/initialActions: -44%
  • startupStandardHome/setupStore: -57%
  • startupStandardHome/numNetworkReqs: -18%
  • startupPowerUserHome/uiStartup: -13%
  • startupPowerUserHome/load: -12%
  • startupPowerUserHome/domContentLoaded: -12%
  • startupPowerUserHome/domInteractive: -30%
  • startupPowerUserHome/backgroundConnect: -28%
  • startupPowerUserHome/firstReactRender: -15%
  • startupPowerUserHome/loadScripts: -12%
  • startupPowerUserHome/setupStore: +19%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 728ms
  • 🔴 startupPowerUserHome/INP: p75 696ms
  • 🟡 startupPowerUserHome/LCP: p75 3.5s
  • 🟡 startupPowerUserHome/INP: p75 232ms
  • 🟡 startupPowerUserHome/LCP: p75 3.4s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟡 [Show logs]
solanaAssetDetails🟡 [Show logs]
importSrpHome🟡 [Show logs]
sendTransactions🟡 [Show logs]
swap🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -85%
  • onboardingImportWallet/metricsToWalletReadyScreen: -45%
  • onboardingImportWallet/doneButtonToHomeScreen: -75%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +32%
  • onboardingImportWallet/total: -42%
  • onboardingNewWallet/srpButtonToPwForm: -77%
  • onboardingNewWallet/skipBackupToMetricsScreen: -65%
  • onboardingNewWallet/doneButtonToAssetList: -35%
  • onboardingNewWallet/total: -34%
  • assetDetails/assetClickToPriceChart: -40%
  • assetDetails/total: -40%
  • solanaAssetDetails/assetClickToPriceChart: -68%
  • solanaAssetDetails/total: -68%
  • importSrpHome/loginToHomeScreen: +24%
  • importSrpHome/openAccountMenuAfterLogin: -61%
  • importSrpHome/homeAfterImportWithNewWallet: -68%
  • importSrpHome/total: -56%
  • sendTransactions/openSendPageFromHome: -19%
  • sendTransactions/selectTokenToSendFormLoaded: -37%
  • sendTransactions/reviewTransactionToConfirmationPage: +38%
  • sendTransactions/total: +34%
  • swap/openSwapPageFromHome: -96%
  • swap/fetchAndDisplaySwapQuotes: +31%
  • swap/total: +12%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/FCP: p75 2.4s
  • 🟡 solanaAssetDetails/FCP: p75 2.5s
  • 🟡 importSrpHome/INP: p75 232ms
  • 🟡 importSrpHome/FCP: p75 2.9s
  • 🟡 sendTransactions/FCP: p75 2.4s
  • 🟡 swap/FCP: p75 2.4s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-browserify
dappPageLoad🟢 [Show logs]
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 20 Bytes (0%)

Copy link
Copy Markdown
Member

@seaona seaona left a comment

Choose a reason for hiding this comment

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

nice optimitzation 🔥 overall LGTM! Just added a non-blocking question


const MANIFEST_FILE_NAME = 'manifest.json';
const XPI_TEMPLATE_VERSION = 1;
const MANIFEST_SIZE = 64 * 1024;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just wondering what could happen if the manifest file grows or some changes can break these consts values 🤔 I'm unsure how many often we could have changes impacting this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We're currently at 4KB, and this is enough space for a 64KB manifest file.

If the manifest.json file becomes too large the tests will fail with Manifest file is too large (${MANIFEST_SIZE} bytes max).

* @throws Will throw an error if the manifest file cannot be read or is too large
*/
async function getManifest(absExtDir: string) {
await using fd = await open(join(absExtDir, MANIFEST_FILE_NAME));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you mean, using using

@itsyoboieltr itsyoboieltr added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit f6516bb Apr 9, 2026
213 of 214 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.27.0 Issue or pull request that will be included in release 13.27.0 size-L team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants