Skip to content

Commit 916a5b4

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/tat-3086-fix-limit-order-margin
2 parents bac12b5 + 4b4292d commit 916a5b4

694 files changed

Lines changed: 15927 additions & 19789 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.depcheckrc.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,18 @@ ignores:
139139

140140
# Used in Yarn plugin for preview builds
141141
- '@yarnpkg/core'
142+
143+
# Babel plugins referenced in babel.config.js by their short name (without
144+
# the `babel-plugin-` prefix). Babel resolves them correctly at build time
145+
# but depcheck doesn't recognize the indirect reference. See babel.config.js
146+
# line 65 comment for details.
147+
- 'babel-plugin-react-compiler' # used as 'react-compiler' (line 68)
148+
- 'babel-plugin-transform-inline-environment-variables' # used as 'transform-inline-environment-variables' (line 81)
149+
- 'babel-plugin-transform-remove-console' # used as 'transform-remove-console' (line 166, production env)
150+
151+
# Listed as a direct dep in package.json but no longer referenced in
152+
# babel.config.js (we use babel-preset-expo) or anywhere in our source.
153+
# It's still available transitively via babel-preset-expo + Metro, so
154+
# removing the direct declaration should be a no-op — left for a follow-up
155+
# cleanup once the RN 0.81 upgrade has settled to avoid surprises.
156+
- '@react-native/babel-preset'

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ app/components/UI/TemplateRenderer @MetaMask/confirmations @MetaMask/core-plat
158158
app/components/UI/Stake @MetaMask/earn
159159
app/core/Engine/controllers/earn-controller @MetaMask/earn
160160
app/core/Engine/messengers/earn-controller-messenger @MetaMask/earn
161+
app/core/Engine/controllers/chomp-api-service-init* @MetaMask/earn
162+
app/core/Engine/controllers/money-account-upgrade-controller-init* @MetaMask/earn
163+
app/core/Engine/messengers/chomp-api-service-messenger* @MetaMask/earn
164+
app/core/Engine/messengers/money-account-upgrade-controller-messenger* @MetaMask/earn
161165
app/selectors/earnController @MetaMask/earn
166+
app/selectors/featureFlagController/chompApi/ @MetaMask/earn
162167
**/Earn/** @MetaMask/earn
163168
**/earn/** @MetaMask/earn
164169
**/Money/** @MetaMask/earn
@@ -358,6 +363,7 @@ tests/websocket/ @MetaMask/qa
358363
.github/workflows/run-performance-e2e.yml @MetaMask/qa
359364
.github/workflows/run-performance-e2e-experimental.yml @MetaMask/qa
360365
.github/workflows/run-performance-e2e-release.yml @MetaMask/qa
366+
.github/workflows/run-system-tests.yml @MetaMask/qa
361367
.github/scripts/e2e-*.mjs @MetaMask/qa
362368
.github/scripts/collect-qa-stats.mjs @MetaMask/qa
363369
.github/scripts/generate-regression-slack-summary.mjs @MetaMask/qa

.github/workflows/build-android-e2e.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ on:
3434
jobs:
3535
build-android-apks:
3636
name: Build Android E2E APKs
37-
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-android-build' || 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg' }} # Optimized for lg runner (48GB) with conservative memory settings
37+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-android-build' || (startsWith(github.base_ref, 'release/') && fromJSON('["ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg"]') || fromJSON('["ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg", "low-priority"]')) }} # Optimized for lg runner (48GB) with conservative memory settings
3838
timeout-minutes: 40
3939
env:
4040
GRADLE_USER_HOME: ${{ inputs.runner_provider == 'namespace' && '/home/runner/_work/.gradle' || '/home/admin/_work/.gradle' }}
@@ -117,6 +117,13 @@ jobs:
117117
exit 1
118118
fi
119119
120+
# TEMPORARY: `${{ github.run_id }}` makes every key unique per workflow
121+
# run so we always get a fresh build during the RN 0.81 upgrade — the
122+
# `yarn fingerprint:generate` heuristic doesn't track every native input
123+
# being changed (yarn patches, MainApplication, Podfile shims, etc.) so
124+
# the branch cache can serve a stale .apk and only the JS gets repacked.
125+
# Remove the trailing `-${{ github.run_id }}` from each `key:` below
126+
# once the upgrade is settled and fingerprint covers the touched paths.
120127
- name: Restore APKs matching fingerprint from branch cache
121128
if: ${{ inputs.runner_provider != 'namespace' }}
122129
id: apk-cache-restore
@@ -132,7 +139,7 @@ jobs:
132139
# - "Restore APKs matching fingerprint from main cache"
133140
# - "Restore Gradle dependencies from branch cache"
134141
# - "Restore Gradle dependencies from main cache"
135-
key: android-apk-${{ github.ref_name }}-${{ inputs.build_type }}-${{ env.CACHE_GENERATION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
142+
key: android-apk-${{ github.ref_name }}-${{ inputs.build_type }}-${{ env.CACHE_GENERATION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ github.run_id }}
136143

137144
- name: Restore APKs matching fingerprint from main cache
138145
if: ${{ inputs.runner_provider != 'namespace' && steps.apk-cache-restore.outputs.cache-hit != 'true' && github.ref_name != 'main' }}
@@ -149,7 +156,7 @@ jobs:
149156
# - "Restore APKs matching fingerprint from main cache"
150157
# - "Restore Gradle dependencies from branch cache"
151158
# - "Restore Gradle dependencies from main cache"
152-
key: android-apk-main-${{ inputs.build_type }}-${{ env.CACHE_GENERATION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
159+
key: android-apk-main-${{ inputs.build_type }}-${{ env.CACHE_GENERATION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ github.run_id }}
153160

154161
- name: Restore Gradle dependencies from branch cache
155162
id: gradle-cache-restore
@@ -168,7 +175,7 @@ jobs:
168175
# - "Restore APKs matching fingerprint from main cache"
169176
# - "Restore Gradle dependencies from branch cache"
170177
# - "Restore Gradle dependencies from main cache"
171-
key: gradle-${{ github.ref_name }}-${{ env.GRADLE_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
178+
key: gradle-${{ github.ref_name }}-${{ env.GRADLE_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ github.run_id }}
172179

173180
- name: Restore Gradle dependencies from main cache
174181
# This will only restore the cache, not update it
@@ -186,7 +193,7 @@ jobs:
186193
# - "Restore APKs matching fingerprint from main cache"
187194
# - "Restore Gradle dependencies from branch cache"
188195
# - "Restore Gradle dependencies from main cache"
189-
key: gradle-main-${{ env.GRADLE_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
196+
key: gradle-main-${{ env.GRADLE_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ github.run_id }}
190197

191198
- name: Build Android E2E APKs
192199
if: ${{ inputs.runner_provider == 'namespace' || (steps.apk-cache-restore.outputs.cache-hit != 'true' && steps.apk-cache-restore-main.outputs.cache-hit != 'true') }}
@@ -208,6 +215,12 @@ jobs:
208215
NODE_OPTIONS: '--max-old-space-size=4096'
209216
# Limit Metro workers to prevent OOM (each worker uses ~3GB)
210217
METRO_MAX_WORKERS: '4'
218+
# React Native 0.81's ReactAndroid/build.gradle.kts requests CMake 3.30.5
219+
# via `System.getenv("CMAKE_VERSION") ?: "3.30.5"`. The self-hosted runner
220+
# only ships CMake 3.22.1 in /opt/android-sdk/cmake/ and AGP cannot auto-
221+
# download missing components, causing CXX1300. RN's CMakeLists.txt files
222+
# only require >= 3.13, so 3.22.1 is fully sufficient.
223+
CMAKE_VERSION: '3.22.1'
211224
BRIDGE_USE_DEV_APIS: 'true'
212225
RAMP_INTERNAL_BUILD: 'true'
213226
SEEDLESS_ONBOARDING_ENABLED: 'true'

.github/workflows/build-ios-e2e.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ permissions:
3030
jobs:
3131
build-ios-apps:
3232
name: Build iOS E2E Apps
33-
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ios-build' || 'ghcr.io/cirruslabs/macos-runner:tahoe-xl' }}
33+
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ios-build' || (startsWith(github.base_ref, 'release/') && fromJSON('["ghcr.io/cirruslabs/macos-runner:tahoe-xl"]') || fromJSON('["ghcr.io/cirruslabs/macos-runner:tahoe-xl", "low-priority"]')) }}
3434
outputs:
3535
artifacts-url: ${{ steps.set-artifacts-url.outputs.artifacts-url }}
3636
app-uploaded: ${{ steps.upload-app.outcome == 'success' }}
3737
sourcemap-uploaded: ${{ steps.upload-sourcemap.outcome == 'success' }}
3838
env:
3939
# Bump these to bust the respective caches and force a full rebuild
40-
XCODE_CACHE_VERSION: 1
41-
IOS_APP_CACHE_VERSION: 2
40+
XCODE_CACHE_VERSION: 4
41+
IOS_APP_CACHE_VERSION: 5
4242
RCT_NO_LAUNCH_PACKAGER: 1
4343
XCODE_BUILD_SETTINGS: 'COMPILER_INDEX_STORE_ENABLE=NO'
4444
GITHUB_CI: 'true' # This ensures it's available during pod install
@@ -75,6 +75,13 @@ jobs:
7575
- name: Checkout repo
7676
uses: actions/checkout@v6
7777

78+
# TEMPORARY: `${{ github.run_id }}` makes every key unique per workflow
79+
# run so we always get a fresh build during the RN 0.81 upgrade — the
80+
# `yarn fingerprint:generate` heuristic doesn't track every native input
81+
# being changed (yarn patches, AppDelegate, Podfile shims, etc.) so the
82+
# branch cache can serve a stale .app and only the JS gets repacked.
83+
# Remove the trailing `-${{ github.run_id }}` from each `key:` below
84+
# once the upgrade is settled and fingerprint covers the touched paths.
7885
- name: Restore Xcode derived data from branch cache
7986
id: xcode-restore-cache
8087
# This action automatically updates the cache at the end of the workflow
@@ -83,7 +90,7 @@ jobs:
8390
path: |
8491
~/Library/Developer/Xcode/DerivedData
8592
ios/build
86-
key: ${{ runner.os }}-xcode-${{ github.ref_name }}-${{ env.XCODE_CACHE_VERSION }}-${{ hashFiles('ios/**/*.{h,m,mm,swift}', 'ios/**/Podfile.lock', 'yarn.lock') }}
93+
key: ${{ runner.os }}-xcode-${{ github.ref_name }}-${{ env.XCODE_CACHE_VERSION }}-${{ hashFiles('ios/**/*.{h,m,mm,swift}', 'ios/**/Podfile.lock', 'yarn.lock') }}-${{ github.run_id }}
8794

8895
- name: Restore Xcode derived data from main cache
8996
if: ${{ steps.xcode-restore-cache.outputs.cache-hit != 'true' && github.ref_name != 'main' }}
@@ -94,7 +101,7 @@ jobs:
94101
path: |
95102
~/Library/Developer/Xcode/DerivedData
96103
ios/build
97-
key: ${{ runner.os }}-xcode-main-${{ env.XCODE_CACHE_VERSION }}-${{ hashFiles('ios/**/*.{h,m,mm,swift}', 'ios/**/Podfile.lock', 'yarn.lock') }}
104+
key: ${{ runner.os }}-xcode-main-${{ env.XCODE_CACHE_VERSION }}-${{ hashFiles('ios/**/*.{h,m,mm,swift}', 'ios/**/Podfile.lock', 'yarn.lock') }}-${{ github.run_id }}
98105

99106
- name: Restore .metamask folder (Foundry download cache for install:foundryup)
100107
uses: actions/cache@v4
@@ -154,7 +161,7 @@ jobs:
154161
with:
155162
path: |
156163
ios/build/Build/Products/Release-iphonesimulator/MetaMask.app
157-
key: ios-app-${{ github.ref_name }}-v${{ env.IOS_APP_CACHE_VERSION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}
164+
key: ios-app-${{ github.ref_name }}-v${{ env.IOS_APP_CACHE_VERSION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ github.run_id }}
158165

159166
- name: Restore iOS app matching fingerprint from main cache
160167
if: ${{ steps.cache-restore.outputs.cache-hit != 'true' && github.ref_name != 'main' }}
@@ -164,7 +171,7 @@ jobs:
164171
with:
165172
path: |
166173
ios/build/Build/Products/Release-iphonesimulator/MetaMask.app
167-
key: ios-app-main-v${{ env.IOS_APP_CACHE_VERSION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}
174+
key: ios-app-main-v${{ env.IOS_APP_CACHE_VERSION }}-${{ steps.generate-fingerprint.outputs.fingerprint }}-${{ github.run_id }}
168175

169176
# Build the iOS E2E app for simulator
170177
- name: Build iOS E2E App

.github/workflows/build.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ jobs:
130130
steps:
131131
- uses: actions/checkout@v4
132132
with:
133+
fetch-depth: 1
133134
ref: ${{ !inputs.skip_version_bump && needs.update-build-version.outputs.commit-hash || (inputs.source_branch || github.ref_name) }}
134135
- name: Setup Node.js
135136
uses: actions/setup-node@v4
@@ -169,7 +170,7 @@ jobs:
169170
uses: ./.github/workflows/setup-node-modules.yml
170171
with:
171172
ref: ${{ needs.prepare.outputs.checkout_ref_for_setup }}
172-
fetch-depth: 0
173+
fetch-depth: 1
173174
checkout-submodules: true
174175
platform: ${{ matrix.platform }}
175176
build_name: ${{ inputs.build_name }}
@@ -190,6 +191,9 @@ jobs:
190191
# Android: Cirrus lg (large) runner for 8GB Gradle heap; iOS: Cirrus macOS Tahoe (has Xcode 26.x)
191192
runs-on: ${{ inputs.runner_provider == 'namespace' && (matrix.platform == 'ios' && 'namespace-profile-metamask-ios-build' || 'namespace-profile-metamask-android-build') || (matrix.platform == 'ios' && 'ghcr.io/cirruslabs/macos-runner:tahoe-xl' || 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg') }}
192193
environment: ${{ needs.prepare.outputs.github_environment }}
194+
env:
195+
GRADLE_USER_HOME: /home/admin/_work/.gradle
196+
CACHE_GENERATION: v1
193197
steps:
194198
- name: Validate version-bump commit
195199
if: ${{ !inputs.skip_version_bump }}
@@ -375,6 +379,29 @@ jobs:
375379
java-version: '17'
376380
distribution: 'temurin'
377381

382+
- name: Apply release Gradle config (Android)
383+
if: matrix.platform == 'android'
384+
run: cp android/gradle.properties.release android/gradle.properties
385+
386+
- name: Restore Gradle dependencies from branch cache (Android)
387+
if: matrix.platform == 'android'
388+
id: gradle-cache-restore
389+
uses: cirruslabs/cache@bba69c6578b863ad0398ad40567bd2ef70290fe0 # v4
390+
with:
391+
path: |
392+
~/_work/.gradle/caches
393+
~/_work/.gradle/wrapper
394+
key: gradle-release-${{ github.ref_name }}-${{ env.CACHE_GENERATION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
395+
396+
- name: Restore Gradle dependencies from main cache (Android)
397+
if: matrix.platform == 'android' && steps.gradle-cache-restore.outputs.cache-hit != 'true' && github.ref_name != 'main'
398+
uses: cirruslabs/cache/restore@bba69c6578b863ad0398ad40567bd2ef70290fe0 # v4
399+
with:
400+
path: |
401+
~/_work/.gradle/caches
402+
~/_work/.gradle/wrapper
403+
key: gradle-release-main-${{ env.CACHE_GENERATION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
404+
378405
# iOS: Clean up any existing keychains from previous runs
379406
- name: Clean up existing keychains
380407
if: matrix.platform == 'ios' && needs.prepare.outputs.signing_aws_role != ''
@@ -425,6 +452,12 @@ jobs:
425452
timeout-minutes: 115
426453
env:
427454
GIT_BRANCH: ${{ inputs.source_branch || github.ref_name }}
455+
# React Native 0.81's ReactAndroid/build.gradle.kts requests CMake 3.30.5
456+
# via `System.getenv("CMAKE_VERSION") ?: "3.30.5"`. The self-hosted runner
457+
# only ships CMake 3.22.1 in /opt/android-sdk/cmake/ and AGP cannot auto-
458+
# download missing components, causing CXX1300. RN's CMakeLists.txt files
459+
# only require >= 3.13, so 3.22.1 is fully sufficient.
460+
CMAKE_VERSION: '3.22.1'
428461
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
429462
with:
430463
timeout_minutes: 55
@@ -541,6 +574,7 @@ jobs:
541574
steps:
542575
- uses: actions/checkout@v4
543576
with:
577+
fetch-depth: 1
544578
ref: ${{ needs.prepare.outputs.checkout_ref_for_setup }}
545579

546580
- name: Setup Node.js

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
- name: Clean state and following up dependencies installation with retry
7373
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
7474
with:
75-
timeout_minutes: 10
75+
timeout_minutes: 20
7676
max_attempts: 3
7777
retry_wait_seconds: 30
7878
command: yarn setup:github-ci

.github/workflows/create-build-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v4
2929
with:
30-
fetch-depth: 0
30+
fetch-depth: 1
3131
ref: ${{ inputs.source_branch }}
3232
token: ${{ secrets.PR_TOKEN || github.token }}
3333
- name: Create temporary build branch
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Crowdin Download Approved RC Translations
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
find-rc-branches:
8+
name: Find release candidate branches
9+
if: ${{ github.ref_name == 'main' }}
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: read
13+
outputs:
14+
branches: ${{ steps.find-branches.outputs.branches }}
15+
steps:
16+
- name: Find release candidate branches
17+
id: find-branches
18+
uses: actions/github-script@v9
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
script: |
22+
const { data: prs } = await github.rest.pulls.list({
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
base: 'stable',
26+
state: 'open',
27+
});
28+
29+
const releaseBranchRegex = /^release\/[0-9]+\.[0-9]+\.[0-9]+$/;
30+
31+
const branches = prs
32+
.map((pr) => pr.head.ref)
33+
.filter((branchName) => releaseBranchRegex.test(branchName));
34+
35+
core.info(`Found release branches: ${branches.join(',')}`);
36+
core.setOutput('branches', JSON.stringify(branches));
37+
38+
39+
download-translations:
40+
name: Download translations
41+
# Use `!cancelled()` to ensure this runs even when `find-rc-branches` is skipped
42+
if: ${{ !cancelled() }}
43+
needs: [find-rc-branches]
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 3
46+
47+
strategy:
48+
matrix:
49+
# If run on `main`, we download translations for all RCs
50+
# If run on a non-default branch, we just download translations for that individual branch
51+
branch: >-
52+
${{
53+
github.ref_name == 'main' &&
54+
fromJson(needs.find-rc-branches.outputs.branches) ||
55+
fromJson(format('[{0}]', github.ref_name))
56+
}}
57+
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v3
61+
with:
62+
ref: ${{ matrix.branch }}
63+
# Use PAT to ensure that the commit later can trigger status check workflows
64+
token: ${{ secrets.METAMASKBOT_CROWDIN_TOKEN }}
65+
66+
- name: crowdin download approved translations
67+
uses: crowdin/github-action@a3160b9e5a9e00739392c23da5e580c6cabe526d
68+
with:
69+
upload_sources: false
70+
upload_translations: false # disabled to prevent translations overwriting Blends translations
71+
download_translations: true # created separate action to pull down completed translations
72+
export_only_approved: true
73+
74+
crowdin_branch_name: ${{ matrix.branch }}
75+
pull_request_base_branch_name: ${{ matrix.branch }}
76+
localization_branch_name: l10n_crowdin_translations_${{ matrix.branch }}
77+
pull_request_title: 'chore: New Crowdin Translations for ${{ matrix.branch }}'
78+
skip_ref_checkout: true
79+
# This will be in dry-run mode until after we've tested this on `main`
80+
dryrun_action: true
81+
82+
github_user_name: metamaskbot
83+
github_user_email: metamaskbot@users.noreply.github.com
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.METAMASKBOT_CROWDIN_TOKEN }}
86+
GITHUB_ACTOR: metamaskbot
87+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
88+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

0 commit comments

Comments
 (0)