Skip to content

Conversation

MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Oct 17, 2025

Description

Cherry-picks #36942 into main.

Fixes the following error in the validate-lavamoat-policies workflow:

[experimental] scripts:core:dist:disable-console: MetaMask build: Encountered an error while running task "scripts:core:dist:disable-console".
[experimental] TypeError: Tried to access a declared, but not defined environmental variable "APPLE_EXPERIMENTAL_CLIENT_ID"
[experimental] 	Why am I seeing this: "APPLE_EXPERIMENTAL_CLIENT_ID" is declared in builds.yml, but had no actual value when we tried loading it.
[experimental] 	How do I fix this: You could provide a default value for the variable in builds.yml under "env" property and commit to git. For example:
[experimental] 		env:
[experimental] 		 - APPLE_EXPERIMENTAL_CLIENT_ID: ''
[experimental]   at Variables.get (/home/runner/work/metamask-extension/metamask-extension/development/lib/variables.js:32:7)
[experimental]   at assertAndLoadEnvVar (/home/runner/work/metamask-extension/metamask-extension/development/build/set-environment-variables.js:134:33)
[experimental]   at getAppleClientId (/home/runner/work/metamask-extension/metamask-extension/development/build/set-environment-variables.js:266:12)
[experimental]   at setEnvironmentVariables (/home/runner/work/metamask-extension/metamask-extension/development/build/set-environment-variables.js:32:23)
[experimental]   at eval (/home/runner/work/metamask-extension/metamask-extension/development/build/scripts.js:903:5)
[experimental]   at async Object.eval [as scripts:core:dist:disable-console] (/home/runner/work/metamask-extension/metamask-extension/development/build/task.js:124:5)
[experimental]   at async runTask (/home/runner/work/metamask-extension/metamask-extension/development/build/task.js:31:5)
[experimental]   at async defineAndRunBuildTasks (/home/runner/work/metamask-extension/metamask-extension/development/build/index.js:312:3)
[experimental] MetaMask build: Encountered an error while running task "scripts:dist".
[experimental] Error: MetaMask build: runInChildProcess for task "scripts:core:dist:disable-console" encountered an error "1".
[experimental]   at ChildProcess.eval (/home/runner/work/metamask-extension/metamask-extension/development/build/task.js:108:13)
[experimental]   at Object.onceWrapper (node:events:633:26)
[experimental]   at ChildProcess.emit (node:events:518:28)
[experimental]   at ChildProcess._handle.onexit (node:internal/child_process:293:12)
[experimental] yarn build scripts:dist --policy-only --lint-fence-files=false --build-type=experimental exited with code 1
Policy generation failed. [
  {
    command: Command {
      close: [Subject],
      error: [Subject],
      stdout: [Subject],
      stderr: [Subject],
      timer: [Subject],
      killed: false,
      exited: true,
      index: 0,
      name: 'experimental',
      command: 'yarn build scripts:dist --policy-only --lint-fence-files=false --build-type=experimental',
      prefixColor: '',
      env: [Object],
      cwd: '',
      killProcess: [Function (anonymous)],
      spawn: [Function (anonymous)],
      spawnOpts: [Object],
      process: undefined,
      pid: 2203,
      stdin: [Socket]
    },
    index: 0,
    exitCode: 1,
    killed: false,
    timings: {
      startDate: 2025-10-17T09:54:47.212Z,
      endDate: 2025-10-17T09:56:34.494Z,
      durationSeconds: 107.281811431
    }
  }
]
Error: Process completed with exit code 1.

https://github.com/MetaMask/metamask-extension/actions/runs/18587897859/job/52999961365

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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

Declare per-environment Infura, Segment, and Google/Apple OAuth client ID env vars in builds.yml.

  • Build config (builds.yml):
    • Declare missing env vars:
      • Infura: INFURA_PROD_PROJECT_ID, INFURA_BETA_PROJECT_ID, INFURA_FLASK_PROJECT_ID, INFURA_EXPERIMENTAL_PROJECT_ID
      • Segment: SEGMENT_PROD_WRITE_KEY, SEGMENT_BETA_WRITE_KEY, SEGMENT_FLASK_WRITE_KEY, SEGMENT_EXPERIMENTAL_WRITE_KEY
      • OAuth IDs:
        • Google: GOOGLE_PROD_CLIENT_ID, GOOGLE_BETA_CLIENT_ID, GOOGLE_FLASK_CLIENT_ID, GOOGLE_EXPERIMENTAL_CLIENT_ID
        • Apple: APPLE_PROD_CLIENT_ID, APPLE_BETA_CLIENT_ID, APPLE_FLASK_CLIENT_ID, APPLE_EXPERIMENTAL_CLIENT_ID

Written by Cursor Bugbot for commit a145405. This will update automatically on new commits. Configure here.

Copy link
Contributor

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 Oct 17, 2025
@MajorLift MajorLift marked this pull request as ready for review October 17, 2025 11:56
@metamaskbot
Copy link
Collaborator

❌ test-e2e-chrome-api-specs failed. View the html report here.

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: a145405 | Date: 10/17/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±74ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 748ms (±85ms) 🟢 | historical mean value: 740ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±42ms) 🟢 | historical mean value: 79ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 74ms 1.01s 1.35s 1.30s 1.35s
domContentLoaded 748ms 85ms 702ms 1.30s 958ms 1.30s
firstPaint 83ms 42ms 64ms 496ms 96ms 496ms
firstContentfulPaint 83ms 42ms 64ms 496ms 96ms 496ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [a145405]
UI Startup Metrics (1223 ± 61 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1223110713746112531329
load105394911955510841166
domContentLoaded104794511915410781161
domInteractive17135271636
firstPaint63987119342310691120
backgroundConnect2512402757255265
firstReactRender25184552735
getState16579101935
initialActions51194714
loadScripts80170092951832913
setupStore1053141121
WebpackHomeuiStartup8527271143768661048
load64258998979642877
domContentLoaded63558497178637868
domInteractive15125271435
firstPaint184571009174190604
backgroundConnect22114762635
firstReactRender27176483235
getState931931114
initialActions308247
loadScripts63258296076635857
setupStore1052231214
FirefoxBrowserifyHomeuiStartup14791308177311215351707
load1260111815019313171450
domContentLoaded1260111715019313161449
domInteractive1193635661121296
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3723133174067
firstReactRender26226362735
getState943751016
initialActions41486413
loadScripts1234110214699112841421
setupStore126184191032
WebpackHomeuiStartup16151399208713216641939
load1366121317049314081544
domContentLoaded1366121217049314081543
domInteractive107325058098360
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect392392144471
firstReactRender352684103758
getState113149151021
initialActions518811417
loadScripts1341119716829113821525
setupStore166146211262
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

@MajorLift MajorLift marked this pull request as draft October 17, 2025 12:30
- PHISHING_WARNING_PAGE_URL: null
# Modified in <root>/development/build/scripts.js:@getInfuraProjectId
- INFURA_PROJECT_ID
- INFURA_PROD_PROJECT_ID
Copy link
Member

Choose a reason for hiding this comment

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

Why are these required? They were not required before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-S team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants