Skip to content

Commit df0d668

Browse files
Merge branch 'main' into refactor/headerstandard-titles-ramp
2 parents c48b4ff + c35327c commit df0d668

638 files changed

Lines changed: 35740 additions & 9879 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.

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# Windows files should use crlf line endings
22
# https://help.github.com/articles/dealing-with-line-endings/
33
*.bat text eol=crlf
4+
5+
# Shell scripts must keep LF so they run in WSL on Windows.
6+
*.sh text eol=lf

.github/CODEOWNERS

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,16 @@ app/core/Engine/controllers/bridge-controller @MetaMask/swaps-enginee
146146
app/core/Engine/controllers/bridge-status-controller @MetaMask/swaps-engineers
147147

148148
# Notifications Team
149-
app/components/Views/Notifications @MetaMask/notifications
150-
app/components/Views/Settings/NotificationsSettings @MetaMask/notifications
151-
**/Notifications/** @MetaMask/notifications
152-
**/Notification/** @MetaMask/notifications
153-
**/notifications/** @MetaMask/notifications
154-
**/notification/** @MetaMask/notifications
149+
**/*Braze*/ @MetaMask/engagement
150+
**/*Braze* @MetaMask/engagement
151+
**/*braze*/ @MetaMask/engagement
152+
**/*braze* @MetaMask/engagement
153+
app/components/Views/Notifications @MetaMask/engagement
154+
app/components/Views/Settings/NotificationsSettings @MetaMask/engagement
155+
**/Notifications/** @MetaMask/engagement
156+
**/Notification/** @MetaMask/engagement
157+
**/notifications/** @MetaMask/engagement
158+
**/notification/** @MetaMask/engagement
155159

156160
# LavaMoat Team
157161
ses.cjs @MetaMask/supply-chain
@@ -206,7 +210,7 @@ app/components/Views/Homepage/Sections/Perpetuals/ @MetaMask/perps
206210
# Social & AI Team
207211
app/components/Views/SocialLeaderboard/ @MetaMask/social-ai
208212
app/components/UI/MarketInsights/ @MetaMask/social-ai
209-
app/components/Views/Homepage/Sections/WhatsHappening/ @MetaMask/social-ai
213+
app/components/UI/WhatsHappening/ @MetaMask/social-ai
210214
app/components/Views/Homepage/Sections/TopTraders/ @MetaMask/social-ai
211215
app/core/Engine/controllers/social-controller-init* @MetaMask/social-ai
212216
app/core/Engine/controllers/social-service-init* @MetaMask/social-ai

.github/actions/setup-e2e-env/action.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ inputs:
9191
description: 'Runner provider forwarded from the caller workflow chain. When set to "namespace", toolchain-install steps short-circuit if the pinned version is already on the image. Default "current" preserves byte-identical behaviour on existing GitHub-hosted / Cirrus runners.'
9292
required: false
9393
default: 'current'
94+
js-retry-timeout-minutes:
95+
description: >-
96+
Per-attempt timeout (minutes) for Corepack and yarn install retry steps.
97+
Namespace E2E matrix jobs often need more headroom (INFRA-3596).
98+
required: false
99+
default: '15'
100+
pod-install-timeout-minutes:
101+
description: >-
102+
Per-attempt timeout (minutes) for the CocoaPods install retry step (iOS only).
103+
required: false
104+
default: '15'
94105

95106
runs:
96107
using: 'composite'
@@ -161,9 +172,9 @@ runs:
161172
sudo chown -R "$(id -u):$(id -g)" "$CACHE_PATH" /opt/android-sdk/.temp
162173
shell: bash
163174

164-
# Restore exact system image from cache
175+
# Restore exact system image from cache (GitHub only — Namespace uses nscloud-cache-action in callers)
165176
- name: Restore Android system image from cache
166-
if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }}
177+
if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' && inputs.runner_provider != 'namespace' }}
167178
id: android-system-image-cache
168179
uses: actions/cache/restore@v4
169180
with:
@@ -215,6 +226,7 @@ runs:
215226
${{
216227
inputs.platform == 'android' &&
217228
inputs.setup-simulator == 'true' &&
229+
inputs.runner_provider != 'namespace' &&
218230
steps.android-system-image-cache.outputs.cache-hit != 'true' &&
219231
github.event_name != 'pull_request' &&
220232
github.event_name != 'pull_request_target' &&
@@ -289,12 +301,13 @@ runs:
289301
id: corepack
290302
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
291303
with:
292-
timeout_minutes: 15
304+
timeout_minutes: ${{ fromJSON(inputs.js-retry-timeout-minutes) }}
293305
max_attempts: 3
294306
retry_wait_seconds: 30
295307
command: ${{ steps.get-corepack-command.outputs.COREPACK_COMMAND }}
296308

297309
- name: Restore Yarn cache
310+
if: ${{ inputs.runner_provider != 'namespace' }}
298311
uses: actions/cache@v4
299312
with:
300313
path: |
@@ -309,7 +322,7 @@ runs:
309322
id: yarn-install
310323
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
311324
with:
312-
timeout_minutes: 15
325+
timeout_minutes: ${{ fromJSON(inputs.js-retry-timeout-minutes) }}
313326
max_attempts: 3
314327
retry_wait_seconds: 30
315328
on_retry_command: echo "⚠️ yarn install failed — likely a transient network issue on the self-hosted runner. Retrying..."
@@ -342,7 +355,7 @@ runs:
342355
shell: bash
343356

344357
- name: Restore Bundler cache
345-
if: ${{ inputs.platform == 'ios' }}
358+
if: ${{ inputs.platform == 'ios' && inputs.runner_provider != 'namespace' }}
346359
uses: actions/cache@v4
347360
with:
348361
path: ios/vendor/bundle
@@ -399,7 +412,7 @@ runs:
399412
shell: bash
400413

401414
- name: Restore CocoaPods specs cache
402-
if: ${{ inputs.platform == 'ios' }}
415+
if: ${{ inputs.platform == 'ios' && inputs.runner_provider != 'namespace' }}
403416
id: cocoapods-specs-cache
404417
uses: actions/cache@v4
405418
with:
@@ -413,7 +426,7 @@ runs:
413426
if: ${{ inputs.platform == 'ios'}}
414427
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
415428
with:
416-
timeout_minutes: 15
429+
timeout_minutes: ${{ fromJSON(inputs.pod-install-timeout-minutes) }}
417430
max_attempts: 3
418431
retry_wait_seconds: 60
419432
on_retry_command: |

.github/scripts/known-feature-flag-constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const FILE_SOURCES: Array<{ key: string; file: string; exportName: string }> = [
2020
{ key: 'FULL_PAGE_ACCOUNT_LIST_FLAG_NAME', file: sel('fullPageAccountList'), exportName: 'FULL_PAGE_ACCOUNT_LIST_FLAG_NAME' },
2121
{ key: 'IMPORT_SRP_WORD_SUGGESTION_FLAG_NAME', file: sel('importSrpWordSuggestion'), exportName: 'IMPORT_SRP_WORD_SUGGESTION_FLAG_NAME' },
2222
{ key: 'ASSETS_UNIFY_STATE_FLAG', file: sel('assetsUnifyState'), exportName: 'ASSETS_UNIFY_STATE_FLAG' },
23+
{ key: 'BRAZE_BANNER_HOME_FLAG_KEY', file: sel('brazeBannerHome'), exportName: 'BRAZE_BANNER_HOME_FLAG_KEY' },
24+
{ key: 'TOKEN_DETAILS_OHLCV_WS_INTEGRATION_FLAG_KEY', file: sel('tokenDetailsOhlcvWsIntegration'), exportName: 'TOKEN_DETAILS_OHLCV_WS_INTEGRATION_FLAG_KEY' },
2325
];
2426

2527
function resolveConstantFromFile(filePath: string, constantName: string): string | undefined {

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

Lines changed: 98 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ jobs:
5151
artifact_name: ${{ steps.determine-target-paths.outputs.artifact_name }}
5252

5353
steps:
54+
- name: Checkout repo (Namespace)
55+
uses: namespacelabs/nscloud-checkout-action@938f5d2d403d6224d9a0c0dc559b1dae09c2ede4 # v8.1.1
56+
if: ${{ inputs.runner_provider == 'namespace' }}
5457
- name: Checkout repo
5558
uses: actions/checkout@v6
59+
if: ${{ inputs.runner_provider != 'namespace' }}
5660

5761
- name: Check force-builds override
5862
id: force-builds
@@ -64,13 +68,29 @@ jobs:
6468
if: ${{ inputs.runner_provider == 'namespace' }}
6569
uses: namespacelabs/nscloud-cache-action@15799a6b54e5765f85b2aac25b3f0df43ed571c0 # v1
6670
with:
71+
cache: |
72+
gradle
73+
maven
6774
path: |
6875
~/.cache/yarn
6976
.metamask
7077
node_modules
7178
.yarn/cache
7279
${{ env.GRADLE_USER_HOME }}/caches
7380
${{ env.GRADLE_USER_HOME }}/wrapper
81+
${{ env.GRADLE_USER_HOME }}/apk-cache
82+
83+
- name: Configure Gradle remote build cache
84+
if: ${{ inputs.runner_provider == 'namespace' }}
85+
run: |
86+
mkdir -p "$GRADLE_USER_HOME/init.d"
87+
REF="${GITHUB_REF_NAME}"
88+
PUSH=true
89+
if [[ "$REF" != "main" && "$REF" != release/* && "$REF" != stable/* ]]; then
90+
PUSH=false
91+
fi
92+
nsc cache gradle setup --push="$PUSH" --init-gradle "$GRADLE_USER_HOME/init.d/namespace-cache.init.gradle"
93+
echo "Gradle remote build cache configured (push=$PUSH) at $GRADLE_USER_HOME/init.d/namespace-cache.init.gradle"
7494
7595
- name: Report source fingerprint
7696
run: |
@@ -102,6 +122,50 @@ jobs:
102122
exit 1
103123
fi
104124
125+
- name: Check Namespace E2E APK cache
126+
id: namespace-apk-cache
127+
if: ${{ inputs.runner_provider == 'namespace' && steps.force-builds.outputs.force != 'true' && inputs.source-fingerprint != '' }}
128+
shell: bash
129+
env:
130+
APK_TARGET: ${{ steps.determine-target-paths.outputs.apk-target-path }}
131+
TEST_APK_TARGET: ${{ steps.determine-target-paths.outputs.test-apk-target-path }}
132+
ARTIFACT_NAME: ${{ steps.determine-target-paths.outputs.artifact_name }}
133+
FINGERPRINT: ${{ inputs.source-fingerprint }}
134+
CACHE_GENERATION: ${{ env.CACHE_GENERATION }}
135+
GRADLE_FILES_HASH: ${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
136+
REF_NAME: ${{ github.ref_name }}
137+
BUILD_TYPE: ${{ inputs.build_type }}
138+
run: |
139+
MARKER="${GRADLE_USER_HOME}/apk-cache/.e2e-apk-cache-marker"
140+
APK_CACHED="${GRADLE_USER_HOME}/apk-cache/${ARTIFACT_NAME}.apk"
141+
TEST_APK_CACHED="${GRADLE_USER_HOME}/apk-cache/${ARTIFACT_NAME}-androidTest.apk"
142+
EXPECTED="${REF_NAME}"$'\n'"${BUILD_TYPE}"$'\n'"${CACHE_GENERATION}"$'\n'"${FINGERPRINT}"$'\n'"${GRADLE_FILES_HASH}"
143+
echo "--- Debug: APK cache marker diagnostics ---"
144+
echo "MARKER=$MARKER"
145+
echo "APK_CACHED=$APK_CACHED"
146+
echo "TEST_APK_CACHED=$TEST_APK_CACHED"
147+
echo "marker exists: $([[ -f "${MARKER}" ]] && echo yes || echo NO)"
148+
echo "apk exists: $([[ -f "${APK_CACHED}" ]] && echo yes || echo NO)"
149+
echo "test-apk exists: $([[ -f "${TEST_APK_CACHED}" ]] && echo yes || echo NO)"
150+
ls -la "${GRADLE_USER_HOME}/apk-cache/" 2>&1 || echo "apk-cache dir not found"
151+
if [[ -f "${MARKER}" ]]; then
152+
echo "--- marker contents ---"
153+
cat "${MARKER}"
154+
echo "--- expected ---"
155+
echo "${EXPECTED}"
156+
echo "--- match: $([[ "$(<"${MARKER}")" == "${EXPECTED}" ]] && echo YES || echo NO) ---"
157+
fi
158+
if [[ -f "${MARKER}" ]] && [[ -f "${APK_CACHED}" ]] && [[ -f "${TEST_APK_CACHED}" ]] && [[ "$(<"${MARKER}")" == "${EXPECTED}" ]]; then
159+
echo "cache-hit=true" >> "${GITHUB_OUTPUT}"
160+
echo "Namespace APK cache hit — restoring APKs to build output dirs."
161+
mkdir -p "${APK_TARGET}" "${TEST_APK_TARGET}"
162+
cp "${APK_CACHED}" "${APK_TARGET}/"
163+
cp "${TEST_APK_CACHED}" "${TEST_APK_TARGET}/"
164+
else
165+
echo "cache-hit=false" >> "${GITHUB_OUTPUT}"
166+
echo "Namespace APK cache miss — full build required."
167+
fi
168+
105169
- name: Find reusable build from prior run
106170
id: find-reusable-build
107171
if: ${{ inputs.runner_provider != 'namespace' && steps.force-builds.outputs.force != 'true' && inputs.source-fingerprint != '' }}
@@ -167,7 +231,10 @@ jobs:
167231
- name: Compute native-build gate
168232
id: gate
169233
run: |
170-
if [[ "${{ steps.find-reusable-build.outputs.found }}" == "true" \
234+
if [[ "${{ steps.namespace-apk-cache.outputs.cache-hit }}" == "true" ]]; then
235+
echo "needs-native-build=false" >> "$GITHUB_OUTPUT"
236+
echo "Namespace APK cache hit; heavy Android setup + Gradle restore will be skipped."
237+
elif [[ "${{ steps.find-reusable-build.outputs.found }}" == "true" \
171238
&& "${{ steps.download-reusable-apk.outcome }}" == "success" \
172239
&& "${{ steps.download-reusable-test-apk.outcome }}" == "success" ]]; then
173240
echo "needs-native-build=false" >> "$GITHUB_OUTPUT"
@@ -266,6 +333,14 @@ jobs:
266333
# sibling "Restore Gradle dependencies from branch cache" step above.
267334
key: gradle-main-${{ env.GRADLE_CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
268335

336+
- name: Configure Namespace Gradle remote cache
337+
id: namespace-gradle-cache
338+
if: ${{ inputs.runner_provider == 'namespace' && steps.gate.outputs.needs-native-build == 'true' }}
339+
run: |
340+
nsc cache gradle setup --init-gradle "$RUNNER_TEMP/namespace-gradle-init.gradle"
341+
echo "init-script=$RUNNER_TEMP/namespace-gradle-init.gradle" >> "$GITHUB_OUTPUT"
342+
shell: bash
343+
269344
- name: Build Android E2E APKs
270345
if: ${{ steps.gate.outputs.needs-native-build == 'true' }}
271346
run: |
@@ -283,6 +358,7 @@ jobs:
283358
IGNORE_BOXLOGS_DEVELOPMENT: true
284359
GITHUB_CI: 'true'
285360
CI: 'true'
361+
GRADLE_INIT_SCRIPT: ${{ steps.namespace-gradle-cache.outputs.init-script }}
286362
NODE_OPTIONS: '--max-old-space-size=4096'
287363
# Limit Metro workers to prevent OOM (each worker uses ~3GB)
288364
METRO_MAX_WORKERS: '4'
@@ -315,6 +391,27 @@ jobs:
315391
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}
316392
MM_PREDICT_GTM_MODAL_ENABLED: 'false'
317393

394+
- name: Record Namespace E2E APK cache marker
395+
if: ${{ inputs.runner_provider == 'namespace' && steps.gate.outputs.needs-native-build == 'true' && inputs.source-fingerprint != '' }}
396+
shell: bash
397+
env:
398+
APK_SOURCE: ${{ steps.determine-target-paths.outputs.apk-target-path }}/${{ steps.determine-target-paths.outputs.artifact_name }}.apk
399+
TEST_APK_SOURCE: ${{ steps.determine-target-paths.outputs.test-apk-target-path }}/${{ steps.determine-target-paths.outputs.artifact_name }}-androidTest.apk
400+
ARTIFACT_NAME: ${{ steps.determine-target-paths.outputs.artifact_name }}
401+
FINGERPRINT: ${{ inputs.source-fingerprint }}
402+
CACHE_GENERATION: ${{ env.CACHE_GENERATION }}
403+
GRADLE_FILES_HASH: ${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
404+
REF_NAME: ${{ github.ref_name }}
405+
BUILD_TYPE: ${{ inputs.build_type }}
406+
run: |
407+
CACHE_DIR="${GRADLE_USER_HOME}/apk-cache"
408+
mkdir -p "${CACHE_DIR}"
409+
cp "${APK_SOURCE}" "${CACHE_DIR}/${ARTIFACT_NAME}.apk"
410+
cp "${TEST_APK_SOURCE}" "${CACHE_DIR}/${ARTIFACT_NAME}-androidTest.apk"
411+
EXPECTED="${REF_NAME}"$'\n'"${BUILD_TYPE}"$'\n'"${CACHE_GENERATION}"$'\n'"${FINGERPRINT}"$'\n'"${GRADLE_FILES_HASH}"
412+
printf '%s\n' "${EXPECTED}" > "${CACHE_DIR}/.e2e-apk-cache-marker"
413+
echo "Namespace APK cache marker + APKs written to ${CACHE_DIR}."
414+
318415
- name: Repack APK with JS updates using @expo/repack-app
319416
if: ${{ steps.gate.outputs.needs-native-build != 'true' }}
320417
run: |

0 commit comments

Comments
 (0)