Skip to content

Commit 35d46a3

Browse files
committed
Merge branch 'main' into mikesposito/deps/smart-transactions-controller
2 parents eafb6b6 + f112e5d commit 35d46a3

File tree

604 files changed

+53710
-31970
lines changed

Some content is hidden

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

604 files changed

+53710
-31970
lines changed

.depcheckrc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ ignores:
2929
# Appium drivers are used by Appwright for mobile automation
3030
- 'appium-uiautomator2-driver'
3131
- 'appium-xcuitest-driver'
32-
32+
# Used in scripts/repack for CI optimization
33+
- '@expo/repack-app'
3334
# Note: Everything below this line should be removed after investigation
3435
# TODO: Investigate each dependency to see whether it's used
3536

.github/CODEOWNERS

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ app/core/Encryptor/ @MetaMask/accounts-e
8282
app/core/Engine/controllers/accounts-controller @MetaMask/accounts-engineers
8383
app/core/Engine/messengers/accounts-controller-messenger @MetaMask/accounts-engineers
8484
app/core/SnapKeyring @MetaMask/accounts-engineers
85+
**/Identity/** @MetaMask/accounts-engineers
86+
**/identity/** @MetaMask/accounts-engineers
8587

8688
# Co-owned by accounts and mobile-core-ux
8789
app/components/Views/AccountSelector @MetaMask/accounts-engineers @MetaMask/mobile-core-ux
@@ -104,10 +106,6 @@ app/components/Views/Settings/NotificationsSettings @MetaMask/notifications
104106
**/notifications/** @MetaMask/notifications
105107
**/notification/** @MetaMask/notifications
106108

107-
# Identity Team
108-
**/Identity/** @MetaMask/identity
109-
**/identity/** @MetaMask/identity
110-
111109
# LavaMoat Team
112110
ses.cjs @MetaMask/supply-chain
113111
patches/react-native+0.*.patch @MetaMask/supply-chain

.github/actionlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ self-hosted-runner:
22
# Labels of self-hosted runner in array of strings.
33
labels:
44
- "gha-mmsdk-scale-set-ubuntu-22.04-amd64-xl"
5+
- "gha-mmsdk-scale-set-ubuntu-22.04-amd64-xxl"
6+
- "gha-mmsdk-scale-set-ubuntu-22.04-amd64-l-kvm"
57
- "gha-mmsdk-scale-set-ubuntu-22.04-amd64-large"
68
- "gha-mm-scale-set-ubuntu-22.04-amd64-large"
79
- "gha-mm-scale-set-ubuntu-22.04-amd64-small"
810
- "gha-mm-scale-set-ubuntu-22.04-amd64-med"
911
- "macos-15"
1012
- "ghcr.io/cirruslabs/macos-runner:sequoia"
1113
- "ghcr.io/cirruslabs/macos-runner:sequoia-xl"
14+
- "ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg"
15+
- "ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-xl"
1216
- "low-priority"
1317

1418
# Configuration variables in array of strings defined in your repository or
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
import fs from 'node:fs';
2+
3+
/**
4+
* Convert a string to a boolean. Created to make sure the variables are
5+
* evaluated properly by checking if the trimmed, lowercased
6+
* string is equal to 'true'.
7+
* @param {string} value - The string to convert
8+
* @returns {boolean} - The boolean value
9+
*/
10+
function isTrue(value) {
11+
return String(value).trim().toLowerCase() === 'true';
12+
}
13+
14+
/**
15+
* These variables are set in the workflow file
16+
* @type {boolean}
17+
*/
18+
const hasAndroidChanges = isTrue(process.env.ANDROID);
19+
const hasIosChanges = isTrue(process.env.IOS);
20+
const hasSharedFilesChanges = isTrue(process.env.SHARED);
21+
const hasIgnoreFiles = process.env.IGNORE_FILES || '';
22+
const catchAllFiles = process.env.CATCH_ALL_FILES || '';
23+
const shouldSkipE2E = isTrue(process.env.SHOULD_SKIP_E2E);
24+
const githubEventName = process.env.GITHUB_EVENT_NAME;
25+
26+
function writeOutputs({ message, willBuildAndroid, willBuildIos, changedFiles }) {
27+
const willBuild = willBuildAndroid || willBuildIos ? 'true' : 'false';
28+
console.log(message);
29+
30+
// Write simple, single-line outputs
31+
const basicOutputs = [
32+
`android_final=${willBuildAndroid}`,
33+
`ios_final=${willBuildIos}`,
34+
`builds=${willBuild}`,
35+
].join('\n') + '\n';
36+
fs.appendFileSync(process.env.GITHUB_OUTPUT, basicOutputs);
37+
38+
// Write changed_files as a multiline output using a safe heredoc delimiter
39+
const value = changedFiles ?? '';
40+
if (!value) {
41+
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'changed_files=\n');
42+
} else {
43+
const delimiter = 'GH_EOF';
44+
const multiLine = `changed_files<<${delimiter}\n${value}\n${delimiter}\n`;
45+
fs.appendFileSync(process.env.GITHUB_OUTPUT, multiLine);
46+
}
47+
}
48+
49+
async function main() {
50+
/**
51+
* These variables are used to store the build outputs
52+
* @type {boolean}
53+
*/
54+
let willBuildAndroid = false;
55+
let willBuildIos = false;
56+
let changedFiles = '';
57+
let message = '';
58+
59+
// Guard: explicit skip
60+
if (shouldSkipE2E) {
61+
writeOutputs({
62+
message: 'Skipping E2E builds',
63+
willBuildAndroid: false,
64+
willBuildIos: false,
65+
changedFiles: '',
66+
});
67+
return;
68+
}
69+
70+
// Determine the build outputs
71+
const hasChanges = Boolean(catchAllFiles && String(catchAllFiles).trim().length > 0);
72+
const isPureIgnore = Boolean(hasIgnoreFiles && hasIgnoreFiles === catchAllFiles);
73+
74+
if (hasSharedFilesChanges) {
75+
message = 'Building both platforms (shared files changes)';
76+
willBuildAndroid = true;
77+
willBuildIos = true;
78+
changedFiles = catchAllFiles;
79+
} else if (!hasChanges) {
80+
message = 'Ignoring - no changes detected';
81+
changedFiles = '';
82+
} else if (isPureIgnore) {
83+
message = 'Ignoring - no mobile-impacting changes (pure ignore)';
84+
changedFiles = '';
85+
} else if (hasAndroidChanges || hasIosChanges) {
86+
if (hasAndroidChanges && hasIosChanges) {
87+
message = 'Building both platforms (mixed changes)';
88+
willBuildAndroid = true;
89+
willBuildIos = true;
90+
} else if (hasAndroidChanges) {
91+
message = 'Building Android only (mixed changes)';
92+
willBuildAndroid = true;
93+
willBuildIos = false;
94+
} else {
95+
message = 'Building iOS only (mixed changes)';
96+
willBuildAndroid = false;
97+
willBuildIos = true;
98+
}
99+
changedFiles = catchAllFiles;
100+
} else {
101+
// Conservative fallback: unclassified but non-ignored changes
102+
message = 'Building both platforms (unclassified changes)';
103+
willBuildAndroid = true;
104+
willBuildIos = true;
105+
changedFiles = catchAllFiles;
106+
}
107+
108+
// On scheduled runs, do not emit changed files to avoid large payloads
109+
if (githubEventName === 'schedule') {
110+
changedFiles = '';
111+
}
112+
113+
writeOutputs({
114+
message,
115+
willBuildAndroid,
116+
willBuildIos,
117+
changedFiles,
118+
});
119+
}
120+
121+
main().catch((error) => {
122+
console.error('\n❌ Unexpected error:', error);
123+
process.exit(1);
124+
});

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

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
jobs:
2020
build-android-apks:
2121
name: Build Android E2E APKs
22-
runs-on: gha-mmsdk-scale-set-ubuntu-22.04-amd64-xl
22+
runs-on: gha-mmsdk-scale-set-ubuntu-22.04-amd64-xxl
2323
env:
2424
GRADLE_USER_HOME: /home/runner/_work/.gradle
2525
outputs:
@@ -60,7 +60,29 @@ jobs:
6060
echo "🚀 Setting up project..."
6161
yarn setup:github-ci --no-build-ios
6262
63+
# Generate fingerprint AFTER setup but BEFORE any build modifications
64+
- name: Generate current fingerprint
65+
id: generate-fingerprint
66+
run: |
67+
FINGERPRINT=$(yarn fingerprint:generate)
68+
echo "fingerprint=$FINGERPRINT" >> "$GITHUB_OUTPUT"
69+
echo "Current fingerprint: ${FINGERPRINT}"
70+
71+
- name: Check and restore cached APKs if Fingerprint is found
72+
id: cache-restore
73+
uses: actions/cache@v4
74+
with:
75+
path: |
76+
android/app/build/outputs/apk/prod/release/app-prod-release.apk
77+
android/app/build/outputs/apk/androidTest/prod/release/app-prod-release-androidTest.apk
78+
android/app/build/outputs/bundle/prodRelease/app-prod-release.aab
79+
key: android-apk-${{ steps.generate-fingerprint.outputs.fingerprint }}
80+
restore-keys: |
81+
android-apk-${{ steps.generate-fingerprint.outputs.fingerprint }}
82+
android-apk-
83+
6384
- name: Build Android E2E APKs
85+
if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }}
6486
run: |
6587
echo "🏗 Building Android E2E APKs..."
6688
export NODE_OPTIONS="--max-old-space-size=8192"
@@ -103,6 +125,60 @@ jobs:
103125
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
104126
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}
105127

128+
- name: Repack APK with JS updates using @expo/repack-app
129+
if: ${{ steps.cache-restore.outputs.cache-hit == 'true' }}
130+
run: |
131+
echo "📦 Repacking APK with updated JavaScript bundle using @expo/repack-app..."
132+
# Use the optimized repack script which uses @expo/repack-app
133+
yarn build:repack
134+
echo "📦 Final APK size: $(du -h "android/app/build/outputs/apk/prod/release/app-prod-release.apk" | cut -f1)"
135+
env:
136+
PLATFORM: android
137+
METAMASK_ENVIRONMENT: qa
138+
METAMASK_BUILD_TYPE: main
139+
IS_TEST: true
140+
E2E: 'true'
141+
IGNORE_BOXLOGS_DEVELOPMENT: true
142+
GITHUB_CI: 'true'
143+
CI: 'true'
144+
NODE_OPTIONS: '--max-old-space-size=8192'
145+
MM_UNIFIED_SWAPS_ENABLED: 'true'
146+
MM_BRIDGE_ENABLED: 'true'
147+
BRIDGE_USE_DEV_APIS: 'true'
148+
RAMP_INTERNAL_BUILD: 'true'
149+
SEEDLESS_ONBOARDING_ENABLED: 'true'
150+
MM_NOTIFICATIONS_UI_ENABLED: 'true'
151+
MM_SECURITY_ALERTS_API_ENABLED: 'true'
152+
MM_REMOVE_GLOBAL_NETWORK_SELECTOR: 'true'
153+
BLOCKAID_FILE_CDN: 'static.cx.metamask.io/api/v1/confirmations/ppom'
154+
FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN: ${{ secrets.FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN }}
155+
FEATURES_ANNOUNCEMENTS_SPACE_ID: ${{ secrets.FEATURES_ANNOUNCEMENTS_SPACE_ID }}
156+
SEGMENT_WRITE_KEY_QA: ${{ secrets.SEGMENT_WRITE_KEY_QA }}
157+
SEGMENT_PROXY_URL_QA: ${{ secrets.SEGMENT_PROXY_URL_QA }}
158+
SEGMENT_DELETE_API_SOURCE_ID_QA: ${{ secrets.SEGMENT_DELETE_API_SOURCE_ID_QA }}
159+
SEGMENT_REGULATIONS_ENDPOINT_QA: ${{ secrets.SEGMENT_REGULATIONS_ENDPOINT_QA }}
160+
MM_SENTRY_DSN_TEST: ${{ secrets.MM_SENTRY_DSN_TEST }}
161+
MM_SENTRY_AUTH_TOKEN: ${{ secrets.MM_SENTRY_AUTH_TOKEN }}
162+
MAIN_IOS_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_IOS_GOOGLE_CLIENT_ID_UAT }}
163+
MAIN_IOS_GOOGLE_REDIRECT_URI_UAT: ${{ secrets.MAIN_IOS_GOOGLE_REDIRECT_URI_UAT }}
164+
MAIN_ANDROID_APPLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_APPLE_CLIENT_ID_UAT }}
165+
MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_CLIENT_ID_UAT }}
166+
MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT: ${{ secrets.MAIN_ANDROID_GOOGLE_SERVER_CLIENT_ID_UAT }}
167+
GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }}
168+
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
169+
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}
170+
171+
# Cache build artifacts with the pre-build fingerprint
172+
- name: Cache build artifacts
173+
if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }}
174+
uses: actions/cache@v4
175+
with:
176+
path: |
177+
android/app/build/outputs/apk/prod/release/app-prod-release.apk
178+
android/app/build/outputs/apk/androidTest/prod/release/app-prod-release-androidTest.apk
179+
android/app/build/outputs/bundle/prodRelease/app-prod-release.aab
180+
key: android-apk-${{ steps.generate-fingerprint.outputs.fingerprint }}
181+
106182
- name: Upload Android APK
107183
id: upload-apk
108184
uses: actions/upload-artifact@v4

.github/workflows/build-android-upload-to-browserstack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
7272
build-android-dual:
7373
name: Build Android Dual Versions
74-
runs-on: gha-mmsdk-scale-set-ubuntu-22.04-amd64-xl
74+
runs-on: gha-mmsdk-scale-set-ubuntu-22.04-amd64-xxl
7575
needs: [check-builds-needed]
7676
env:
7777
GRADLE_USER_HOME: /home/runner/_work/.gradle

0 commit comments

Comments
 (0)