Skip to content

Commit c2a9cb7

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

File tree

592 files changed

+33310
-12258
lines changed

Some content is hidden

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

592 files changed

+33310
-12258
lines changed

.depcheckrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ ignores:
2929
# Appium drivers are used by Appwright for mobile automation
3030
- 'appium-uiautomator2-driver'
3131
- 'appium-xcuitest-driver'
32+
# ESBuild is used for AI E2E script compilation
33+
- 'esbuild'
34+
- 'esbuild-register'
35+
3236
# Used in scripts/repack for CI optimization
3337
- '@expo/repack-app'
3438
# Note: Everything below this line should be removed after investigation

.detoxrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ module.exports = {
6767
device: 'android.github_ci.emulator',
6868
app: 'android.release',
6969
},
70+
'android.github_ci.flask.release': {
71+
device: 'android.github_ci.emulator',
72+
app: 'android.flask.release',
73+
},
7074
'android.emu.flask.release': {
7175
device: 'android.bitrise.emulator',
7276
app: 'android.flask.release',

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ wdio
1414
/app/lib/ppom/blockaid-version.js
1515
/ppom
1616
junitProperties.js
17-
scripts/aggregate-performance-reports.mjs
17+
/e2e/scripts/ai-e2e-tags-selector.ts
18+
scripts/aggregate-performance-reports.mjs

.github/CODEOWNERS

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,19 @@ app/core/Analytics/events/confirmations @MetaMask/confirmati
6565
ppom @MetaMask/confirmations
6666
app/selectors/featureFlagController/confirmations/ @MetaMask/confirmations
6767

68-
# All below files are maintained by the SDK team because they contain SDK related code, WalletConnect integrations, or critical SDK flows.
69-
app/actions/sdk @MetaMask/sdk-devs
70-
app/components/Approvals/WalletConnectApproval @MetaMask/sdk-devs
71-
app/components/Views/SDK @MetaMask/sdk-devs
72-
app/components/Views/WalletConnectSessions @MetaMask/sdk-devs
73-
app/core/BackgroundBridge/WalletConnectPort.ts @MetaMask/sdk-devs
74-
app/core/RPCMethods/RPCMethodMiddleware.ts @MetaMask/sdk-devs
75-
app/core/SDKConnect @MetaMask/sdk-devs
76-
app/core/WalletConnect @MetaMask/sdk-devs
77-
app/reducers/sdk @MetaMask/sdk-devs
78-
app/util/walletconnect.js @MetaMask/sdk-devs
68+
# Wallet integrations Team
69+
app/actions/sdk @MetaMask/wallet-integrations
70+
app/components/Approvals/WalletConnectApproval @MetaMask/wallet-integrations
71+
app/components/Views/SDK @MetaMask/wallet-integrations
72+
app/components/Views/WalletConnectSessions @MetaMask/wallet-integrations
73+
app/core/BackgroundBridge/WalletConnectPort.ts @MetaMask/wallet-integrations
74+
app/core/RPCMethods @MetaMask/wallet-integrations
75+
app/core/SDKConnect @MetaMask/wallet-integrations
76+
app/core/SDKConnectV2 @MetaMask/wallet-integrations
77+
app/core/WalletConnect @MetaMask/wallet-integrations
78+
app/reducers/sdk @MetaMask/wallet-integrations
79+
app/util/walletconnect.js @MetaMask/wallet-integrations
80+
app/util/permissions/ @MetaMask/wallet-integrations
7981

8082
# Accounts Team
8183
app/core/Encryptor/ @MetaMask/accounts-engineers
@@ -121,9 +123,6 @@ app/core/Engine/controllers/TokenSearchDiscoveryController @MetaMask/portfolio
121123
# Co-owned by Confirmations team and Core Platform team
122124
app/components/UI/TemplateRenderer @MetaMask/confirmations @MetaMask/core-platform
123125

124-
# Wallet API Platform Team
125-
app/core/RPCMethods/ @MetaMask/wallet-api-platform-engineers
126-
app/util/permissions/ @MetaMask/wallet-api-platform-engineers
127126

128127
# Earn Team
129128
app/components/UI/Stake @MetaMask/metamask-earn
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: 'AI E2E Analysis'
2+
description: 'Run AI-powered E2E test selection analysis based on code changes'
3+
inputs:
4+
changed-files:
5+
description: 'Pre-computed list of changed files from needs_e2e_build job'
6+
required: true
7+
event-name:
8+
description: 'GitHub event name (pull_request, workflow_dispatch, schedule, etc.)'
9+
required: true
10+
claude-api-key:
11+
description: 'Claude API key for AI analysis'
12+
required: true
13+
github-token:
14+
description: 'GitHub token for PR comments (optional)'
15+
required: false
16+
pr-number:
17+
description: 'Pull request number for commenting (optional)'
18+
required: false
19+
repository:
20+
description: 'Repository name (owner/repo) for commenting (optional)'
21+
required: false
22+
post-comment:
23+
description: 'Whether to post a comment to the PR'
24+
required: false
25+
default: 'false'
26+
27+
outputs:
28+
test-matrix:
29+
description: 'JSON matrix for GitHub Actions test jobs - array of {tag, fileCount, split, totalSplits}'
30+
value: ${{ steps.ai-analysis.outputs.test_matrix }}
31+
32+
runs:
33+
using: 'composite'
34+
steps:
35+
- name: Minimal checkout for AI analysis
36+
uses: actions/checkout@v4
37+
with:
38+
sparse-checkout: |
39+
.github/scripts
40+
e2e/scripts
41+
e2e/specs
42+
e2e/tags.js
43+
.nvmrc
44+
sparse-checkout-cone-mode: false
45+
fetch-depth: 1
46+
47+
- name: Setup Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version-file: '.nvmrc'
51+
52+
- name: Install minimal dependencies for AI analysis
53+
shell: bash
54+
run: |
55+
echo "📦 Installing only required packages for AI analysis..."
56+
# Install to a separate location that won't be overwritten
57+
mkdir -p /tmp/ai-deps
58+
cd /tmp/ai-deps
59+
npm init -y
60+
npm install @anthropic-ai/sdk@latest esbuild-register@latest --no-audit --no-fund
61+
echo "✅ AI analysis dependencies installed in /tmp/ai-deps"
62+
63+
- name: Copy AI dependencies to workspace
64+
shell: bash
65+
run: |
66+
echo "📋 Copying AI dependencies to workspace..."
67+
# Create node_modules if it doesn't exist
68+
mkdir -p node_modules
69+
# Copy our pre-installed dependencies
70+
cp -r /tmp/ai-deps/node_modules/* node_modules/
71+
echo "✅ AI dependencies available in workspace"
72+
73+
- name: Test Selection AI Analysis
74+
id: ai-analysis
75+
shell: bash
76+
env:
77+
E2E_CLAUDE_API_KEY: ${{ inputs.claude-api-key }}
78+
CHANGED_FILES: ${{ inputs.changed-files }}
79+
EVENT_NAME: ${{ inputs.event-name }}
80+
run: |
81+
# Only run AI analysis for pull_request events with changed files
82+
if [[ "$EVENT_NAME" == "pull_request" ]] && [[ -n "$CHANGED_FILES" ]]; then
83+
echo "✅ Running AI analysis for PR with changed files"
84+
node .github/scripts/ai-e2e-analysis.mjs \
85+
"$EVENT_NAME" \
86+
"$CHANGED_FILES"
87+
else
88+
echo "⏭️ Skipping AI analysis - only runs on PRs with changed files (event: $EVENT_NAME, has files: $([ -n "$CHANGED_FILES" ] && echo 'yes' || echo 'no'))"
89+
echo "test_matrix=[]" >> "$GITHUB_OUTPUT"
90+
echo "tags=" >> "$GITHUB_OUTPUT"
91+
echo "tags_display=None (AI analysis skipped)" >> "$GITHUB_OUTPUT"
92+
echo "risk_level=N/A" >> "$GITHUB_OUTPUT"
93+
echo "reasoning=AI analysis only runs for pull_request events with changed files" >> "$GITHUB_OUTPUT"
94+
echo "confidence=0" >> "$GITHUB_OUTPUT"
95+
fi
96+
97+
- name: Delete existing AI E2E comments
98+
if: inputs.post-comment == 'true' && inputs.pr-number != '' && inputs.github-token != ''
99+
shell: bash
100+
env:
101+
GH_TOKEN: ${{ inputs.github-token }}
102+
run: |
103+
echo "🗑️ Deleting all existing AI E2E comments..."
104+
105+
# Get all AI E2E comment IDs (both analysis-only and test mode comments)
106+
ALL_COMMENT_IDS=$(gh api "repos/${{ inputs.repository }}/issues/${{ inputs.pr-number }}/comments" \
107+
--jq '.[] | select(.body | test("🤖 AI E2E Test Analysis|🔍 AI E2E Analysis Report")) | .id')
108+
109+
COMMENT_COUNT=$(echo "$ALL_COMMENT_IDS" | wc -l | tr -d ' ')
110+
echo "📊 Found $COMMENT_COUNT existing AI E2E comments"
111+
112+
if [ -n "$ALL_COMMENT_IDS" ] && [ "$COMMENT_COUNT" -gt 0 ]; then
113+
echo "🗑️ Deleting all $COMMENT_COUNT AI E2E comments..."
114+
115+
echo "$ALL_COMMENT_IDS" | while read -r COMMENT_ID; do
116+
if [ -n "$COMMENT_ID" ]; then
117+
echo " Deleting comment: $COMMENT_ID"
118+
gh api "repos/${{ inputs.repository }}/issues/comments/$COMMENT_ID" \
119+
--method DELETE > /dev/null 2>&1 || echo " ⚠️ Failed to delete comment $COMMENT_ID"
120+
fi
121+
done
122+
echo "✨ Cleanup completed - deleted all $COMMENT_COUNT comments"
123+
else
124+
echo "📝 No existing AI E2E comments found"
125+
fi
126+
127+
- name: Create PR comment with analysis results
128+
if: inputs.post-comment == 'true' && inputs.pr-number != '' && inputs.github-token != ''
129+
shell: bash
130+
env:
131+
GH_TOKEN: ${{ inputs.github-token }}
132+
run: |
133+
# Create analysis report comment
134+
cat > pr_comment.md << EOF
135+
## 🔍 AI E2E Analysis Report
136+
137+
**Risk Level:** ${{ steps.ai-analysis.outputs.risk_level }} | **Selected Tags:** ${{ steps.ai-analysis.outputs.tags_display }}
138+
139+
**🤖 AI Analysis:**
140+
> ${{ steps.ai-analysis.outputs.reasoning }}
141+
142+
**📊 Analysis Results:**
143+
- **Confidence:** ${{ steps.ai-analysis.outputs.confidence }}%
144+
145+
**🏷️ Test Recommendation:**
146+
Based on the code changes, the AI recommends testing the following areas: **${{ steps.ai-analysis.outputs.tags_display }}**
147+
148+
_🔍 [View complete analysis](https://github.com/${{ inputs.repository }}/actions/runs/${{ github.run_id }}) • AI E2E Analysis_
149+
150+
<!-- ai-e2e-analysis -->
151+
EOF
152+
153+
# Create new comment
154+
echo "📝 Creating AI E2E analysis comment..."
155+
gh pr comment ${{ inputs.pr-number }} --repo ${{ inputs.repository }} --body-file pr_comment.md
156+
echo "✅ Successfully created comment"

.github/guidelines/LABELING_GUIDELINES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Any label can be manually added on demand depending on the PR's content. For ins
2424
Android E2E smoke tests run on every PR automatically, but running iOS E2E smoke tests are optional based on the following label:
2525

2626
- **run-ios-e2e-smoke**: The iOS E2E smoke tests jobs will run in the pipeline.
27+
- **run-android-flask-e2e-smoke**: The Android Flask E2E smoke tests jobs will run in the pipeline.
2728

2829
### Bypass Quality Gates
2930

0 commit comments

Comments
 (0)