Skip to content

Commit 27d4464

Browse files
Merge branch 'main' into feat/MCWP-474-automated-flaky-test-detection-workflow
2 parents 0dbeaa5 + ffe991f commit 27d4464

482 files changed

Lines changed: 17774 additions & 5512 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.

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ wdio
1717
junitProperties.js
1818
/tests/scripts/ai-e2e-tags-selector.ts
1919
tests/scripts/aggregate-performance-reports.mjs
20+
app/**/*-method-action-types.ts

.github/workflows/ci-namespace-shadow.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11
name: CI (Namespace shadow)
22

3-
# On-demand dispatcher for Namespace shadow runs (INFRA-3631 / INFRA-3678).
4-
#
5-
# Automatic triggers (pull_request, push to main, hourly schedule) are disabled:
6-
# the Phase 5d benchmark is complete (INFRA-3631) and the failure investigation
7-
# is closed (INFRA-3652). The workflow is retained for on-demand runs only
8-
# (e.g. INFRA-3639 swap testing) via manual workflow_dispatch.
3+
# Dispatcher for Namespace shadow runs (INFRA-3631 / INFRA-3678).
94
#
105
# It dispatches `ci.yml` as a separate `workflow_dispatch` run with
116
# `runner_provider=namespace` (not `workflow_call`), so shadow runs live in the
127
# Actions tab only and never appear in PR checks or the merge queue. The OIDC,
138
# token-exchange, and dispatch steps use continue-on-error so this job's own
149
# check always concludes success even when the dispatch cannot run.
1510
#
11+
# Shadow runs are iOS-only: ci.yml skips Android and Linux-only jobs when
12+
# runner_provider is namespace (see the BITRISE/NAMESPACE-SHADOW markers there),
13+
# mirroring the Bitrise shadow benchmark scope.
14+
#
1615
# Authentication: Token Exchange Service (same pattern as triage-forwarder.yml —
1716
# OIDC → POST /api/exchange/token). Prerequisites:
1817
# - Actions variable TOKEN_EXCHANGE_URL (already used elsewhere, e.g. triage-forwarder).
1918
# - Rego policy mm-metamask-mobile-namespace-shadow-ci-token-exchange in
2019
# token-exchange-service (matches the OIDC `workflow_ref` claim).
20+
#
21+
# Auto-dispatch gate: set repo Actions variable NAMESPACE_SHADOW_AUTO_DISPATCH=true
22+
# to dispatch on PR/push. Default (unset/false) = manual workflow_dispatch only.
2123
on:
24+
pull_request:
25+
types: [opened, synchronize, reopened, ready_for_review]
26+
paths-ignore:
27+
- "docs/**"
28+
- "**/*.md"
29+
- ".github/CODEOWNERS"
30+
push:
31+
branches: [main]
2232
workflow_dispatch:
2333

2434
concurrency:
@@ -33,8 +43,13 @@ jobs:
3343
dispatch-shadow:
3444
name: "[shadow] Dispatch"
3545
runs-on: ubuntu-latest
36-
# Manual dispatch only. If pull_request triggers are ever restored, re-add a
37-
# fork-PR guard here so OIDC/token exchange never runs for untrusted forks.
46+
# Fork PRs use head.repo != github.repository — skip (no shadow, no token exchange).
47+
# PR/push auto-dispatch requires NAMESPACE_SHADOW_AUTO_DISPATCH=true; workflow_dispatch always runs.
48+
if: >-
49+
${{
50+
(github.event_name == 'workflow_dispatch' || vars.NAMESPACE_SHADOW_AUTO_DISPATCH == 'true') &&
51+
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
52+
}}
3853
steps:
3954
- name: Get OIDC token for token-exchange-service
4055
id: oidc

.github/workflows/ci.yml

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ jobs:
164164
dedupe:
165165
name: Dedupe
166166
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
167-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
168-
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' }}
167+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
168+
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' }}
169169
needs:
170170
- get_requirements
171171
steps:
@@ -213,8 +213,8 @@ jobs:
213213
git-safe-dependencies:
214214
name: Run `@lavamoat/git-safe-dependencies`
215215
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
216-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
217-
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' }}
216+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
217+
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' }}
218218
needs:
219219
- get_requirements
220220
steps:
@@ -255,8 +255,8 @@ jobs:
255255
scripts:
256256
name: Run `${{ matrix.scripts }}`
257257
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
258-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
259-
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' }}
258+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
259+
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' }}
260260
needs:
261261
- get_requirements
262262
strategy:
@@ -314,8 +314,8 @@ jobs:
314314
js-bundle-size-check:
315315
name: JS bundle size check
316316
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
317-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
318-
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' }}
317+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
318+
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' }}
319319
needs:
320320
- get_requirements
321321
permissions:
@@ -627,8 +627,8 @@ jobs:
627627
check-workflows:
628628
name: Check workflows
629629
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
630-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
631-
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' }}
630+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
631+
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' }}
632632
needs:
633633
- get_requirements
634634
steps:
@@ -649,8 +649,8 @@ jobs:
649649
prepare-ci-js-deps:
650650
name: Prepare CI JS dependencies
651651
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
652-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
653-
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' }}
652+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
653+
if: ${{ needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' }}
654654
needs:
655655
- get_requirements
656656
steps:
@@ -676,8 +676,8 @@ jobs:
676676
unit-tests:
677677
name: Unit tests (${{ matrix.shard }})
678678
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
679-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
680-
if: ${{ !cancelled() && needs.get_requirements.result == 'success' && needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' }}
679+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
680+
if: ${{ !cancelled() && needs.get_requirements.result == 'success' && needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' }}
681681
needs:
682682
- get_requirements
683683
- prepare-ci-js-deps
@@ -751,8 +751,8 @@ jobs:
751751
merge-unit-and-component-view-tests:
752752
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
753753
needs: [prepare-ci-js-deps, unit-tests, component-view-tests]
754-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
755-
if: ${{ github.event_name != 'merge_group' && inputs.runner_provider != 'bitrise' }}
754+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
755+
if: ${{ github.event_name != 'merge_group' && inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' }}
756756
steps:
757757
- uses: namespacelabs/nscloud-checkout-action@938f5d2d403d6224d9a0c0dc559b1dae09c2ede4 # v8.1.1
758758
if: ${{ inputs.runner_provider == 'namespace' }}
@@ -933,8 +933,8 @@ jobs:
933933
component-view-tests:
934934
name: Component view tests
935935
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
936-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
937-
if: ${{ !cancelled() && needs.get_requirements.result == 'success' && needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' }}
936+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
937+
if: ${{ !cancelled() && needs.get_requirements.result == 'success' && needs.get_requirements.outputs.skip_everything != 'true' && inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' }}
938938
needs:
939939
- get_requirements
940940
- prepare-ci-js-deps
@@ -1050,10 +1050,11 @@ jobs:
10501050
# ai_performance_test_tags == '[]' → AI ran and found no perf-relevant changes: skip.
10511051
# ai_performance_test_tags == '' → conservative fallback (AI failed) or run-performance-tests label: run all tests.
10521052
# ai_performance_test_tags == '[…]' → specific tags selected: run those tests.
1053-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
1053+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
10541054
if: >-
10551055
${{
10561056
inputs.runner_provider != 'bitrise' &&
1057+
inputs.runner_provider != 'namespace' &&
10571058
github.event_name == 'pull_request' &&
10581059
!cancelled() &&
10591060
(
@@ -1081,10 +1082,11 @@ jobs:
10811082

10821083
build-android-apks:
10831084
name: 'Build Android APKs'
1084-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
1085+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
10851086
if: >-
10861087
${{
10871088
inputs.runner_provider != 'bitrise' &&
1089+
inputs.runner_provider != 'namespace' &&
10881090
!cancelled() &&
10891091
needs.get_requirements.outputs.android_e2e_needed == 'true' &&
10901092
!(fromJSON(needs.smart-e2e-selection.outputs.ai_confidence || '0') >= 85 && needs.smart-e2e-selection.outputs.ai_e2e_test_tags == '[]')
@@ -1157,10 +1159,11 @@ jobs:
11571159

11581160
e2e-smoke-tests-android:
11591161
name: 'Android E2E Smoke Tests'
1160-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
1162+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
11611163
if: >-
11621164
${{
11631165
inputs.runner_provider != 'bitrise' &&
1166+
inputs.runner_provider != 'namespace' &&
11641167
!cancelled() &&
11651168
needs.build-android-apks.result == 'success' &&
11661169
(needs.prepare-e2e-timings.result == 'success' || needs.prepare-e2e-timings.result == 'failure' || needs.prepare-e2e-timings.result == 'skipped')
@@ -1235,10 +1238,11 @@ jobs:
12351238

12361239
appium-smoke-tests-android:
12371240
name: 'Appium Smoke Tests (Android)'
1238-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
1241+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
12391242
if: >-
12401243
${{
12411244
inputs.runner_provider != 'bitrise' &&
1245+
inputs.runner_provider != 'namespace' &&
12421246
!cancelled() &&
12431247
needs.build-android-apks.result == 'success'
12441248
}}
@@ -1321,8 +1325,8 @@ jobs:
13211325
report-fixture-validation:
13221326
name: 'Report Fixture Validation'
13231327
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
1324-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
1325-
if: ${{ inputs.runner_provider != 'bitrise' && !cancelled() && needs.validate-e2e-fixtures.result != 'skipped' }}
1328+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
1329+
if: ${{ inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' && !cancelled() && needs.validate-e2e-fixtures.result != 'skipped' }}
13261330
needs: [validate-e2e-fixtures]
13271331
permissions:
13281332
pull-requests: write
@@ -1362,8 +1366,8 @@ jobs:
13621366
name: SonarCloud analysis
13631367
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
13641368
needs: merge-unit-and-component-view-tests
1365-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
1366-
if: ${{ inputs.runner_provider != 'bitrise' && github.event_name != 'merge_group' && !github.event.pull_request.head.repo.fork }}
1369+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
1370+
if: ${{ inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' && github.event_name != 'merge_group' && !github.event.pull_request.head.repo.fork }}
13671371
steps:
13681372
- uses: namespacelabs/nscloud-checkout-action@938f5d2d403d6224d9a0c0dc559b1dae09c2ede4 # v8.1.1
13691373
if: ${{ inputs.runner_provider == 'namespace' }}
@@ -1430,8 +1434,8 @@ jobs:
14301434
name: SonarCloud quality gate status
14311435
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
14321436
needs: sonar-cloud
1433-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
1434-
if: ${{ inputs.runner_provider != 'bitrise' && github.event_name != 'merge_group' && !github.event.pull_request.head.repo.fork }}
1437+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
1438+
if: ${{ inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' && github.event_name != 'merge_group' && !github.event.pull_request.head.repo.fork }}
14351439
steps:
14361440
- uses: namespacelabs/nscloud-checkout-action@938f5d2d403d6224d9a0c0dc559b1dae09c2ede4 # v8.1.1
14371441
if: ${{ inputs.runner_provider == 'namespace' }}
@@ -1506,7 +1510,7 @@ jobs:
15061510
cleanup-ci-js-deps:
15071511
name: Delete CI JS deps artifact
15081512
runs-on: ubuntu-latest
1509-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
1513+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
15101514
if: ${{ always() && inputs.runner_provider != 'namespace' && inputs.runner_provider != 'bitrise' }}
15111515
needs:
15121516
- unit-tests
@@ -1540,8 +1544,8 @@ jobs:
15401544
name: Check all jobs pass
15411545
# Run the aggregate gate even when optional dependencies are skipped.
15421546
# The composite action decides which skipped jobs are acceptable.
1543-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
1544-
if: ${{ always() && !cancelled() && inputs.runner_provider != 'bitrise' }}
1547+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
1548+
if: ${{ always() && !cancelled() && inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' }}
15451549
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
15461550
needs:
15471551
- get_requirements
@@ -1588,8 +1592,8 @@ jobs:
15881592
name: Log merge group failure
15891593
runs-on: ${{ inputs.runner_provider == 'namespace' && 'namespace-profile-metamask-ci-linux' || 'ubuntu-latest' }}
15901594
# Only run this job if the merge group event fails, skip on forks
1591-
# BITRISE-SHADOW: skip for iOS-only benchmark (INFRA-3679) — revert to enable full pipeline
1592-
if: ${{ inputs.runner_provider != 'bitrise' && github.event_name == 'merge_group' && failure() }}
1595+
# BITRISE/NAMESPACE-SHADOW: skip for iOS-only shadow benchmark (INFRA-3679) — revert to enable full pipeline
1596+
if: ${{ inputs.runner_provider != 'bitrise' && inputs.runner_provider != 'namespace' && github.event_name == 'merge_group' && failure() }}
15931597
needs:
15941598
- check-all-jobs-pass
15951599
steps:

0 commit comments

Comments
 (0)