Skip to content

Commit a71d3c5

Browse files
authored
Merge branch 'main' into user_ctrl_update
2 parents 5064ba3 + 0e3a38e commit a71d3c5

File tree

291 files changed

+7455
-5129
lines changed

Some content is hidden

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

291 files changed

+7455
-5129
lines changed

.circleci/config.yml

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,6 @@ workflows:
215215
- test-e2e-firefox-flask
216216
- test-e2e-chrome-vault-decryption
217217
- test-e2e-chrome-webpack
218-
- benchmark:
219-
requires:
220-
- prep-build-test
221-
- user-actions-benchmark:
222-
requires:
223-
- prep-build-test
224-
- bundle-size:
225-
requires:
226-
- prep-build-test
227218
- job-publish-prerelease:
228219
requires:
229220
- prep-deps
@@ -236,9 +227,6 @@ workflows:
236227
- prep-build-test-flask
237228
- prep-build-test-flask-mv2
238229
- prep-build-ts-migration-dashboard
239-
- benchmark
240-
- user-actions-benchmark
241-
- bundle-size
242230
- all-tests-pass
243231
- job-publish-release:
244232
filters:
@@ -907,84 +895,6 @@ jobs:
907895
- store_test_results:
908896
path: test/test-results/e2e
909897

910-
benchmark:
911-
executor: node-browsers-small
912-
steps:
913-
- run: *shallow-git-clone-and-enable-vnc
914-
- run: sudo corepack enable
915-
- attach_workspace:
916-
at: .
917-
- run:
918-
name: Move test build to dist
919-
command: mv ./dist-test ./dist
920-
- run:
921-
name: Move test zips to builds
922-
command: mv ./builds-test ./builds
923-
- run:
924-
name: Run page load benchmark
925-
command: yarn benchmark:chrome --out test-artifacts/chrome/benchmark/pageload.json --retries 2
926-
- store_artifacts:
927-
path: test-artifacts
928-
destination: test-artifacts
929-
- persist_to_workspace:
930-
root: .
931-
paths:
932-
- test-artifacts
933-
934-
user-actions-benchmark:
935-
executor: node-browsers-small
936-
steps:
937-
- run: *shallow-git-clone-and-enable-vnc
938-
- run: sudo corepack enable
939-
- attach_workspace:
940-
at: .
941-
- run:
942-
name: Move test build to dist
943-
command: mv ./dist-test ./dist
944-
- run:
945-
name: Move test zips to builds
946-
command: mv ./builds-test ./builds
947-
- run:
948-
name: Run page load benchmark
949-
command: yarn user-actions-benchmark:chrome --out test-artifacts/chrome/benchmark/user_actions.json --retries 2
950-
- store_artifacts:
951-
path: test-artifacts
952-
destination: test-artifacts
953-
- persist_to_workspace:
954-
root: .
955-
paths:
956-
- test-artifacts
957-
958-
bundle-size:
959-
executor: node-browsers-small
960-
steps:
961-
- run: *shallow-git-clone-and-enable-vnc
962-
- run: sudo corepack enable
963-
- attach_workspace:
964-
at: .
965-
- run:
966-
name: Move test build to dist
967-
command: mv ./dist-test ./dist
968-
- run:
969-
name: Move test zips to builds
970-
command: mv ./builds-test ./builds
971-
- run:
972-
name: Measure bundle size
973-
command: yarn bundle-size --out test-artifacts/chrome
974-
- run:
975-
name: Install jq
976-
command: sudo apt install jq -y
977-
- run:
978-
name: Record bundle size at commit
979-
command: ./.circleci/scripts/bundle-stats-commit.sh
980-
- store_artifacts:
981-
path: test-artifacts
982-
destination: test-artifacts
983-
- persist_to_workspace:
984-
root: .
985-
paths:
986-
- test-artifacts
987-
988898
job-publish-prerelease:
989899
executor: node-browsers-medium
990900
steps:

.circleci/scripts/bundle-stats-commit.sh

Lines changed: 0 additions & 81 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ module.exports = {
353353
'app/scripts/controllers/alert-controller.test.ts',
354354
'app/scripts/metamask-controller.actions.test.js',
355355
'app/scripts/detect-multiple-instances.test.js',
356-
'app/scripts/controllers/bridge.test.ts',
357356
'app/scripts/controllers/swaps/**/*.test.js',
358357
'app/scripts/controllers/swaps/**/*.test.ts',
359358
'app/scripts/controllers/metametrics.test.js',
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -u
5+
set -o pipefail
6+
7+
if [[ -z "${EXTENSION_BUNDLESIZE_STATS_TOKEN:-}" ]]; then
8+
printf '%s\n' 'EXTENSION_BUNDLESIZE_STATS_TOKEN environment variable must be set'
9+
exit 1
10+
fi
11+
12+
if [[ -z "${GITHUB_SHA:-}" ]]; then
13+
printf '%s\n' 'GITHUB_SHA environment variable must be set'
14+
exit 1
15+
fi
16+
17+
if [[ -z "${GITHUB_REPOSITORY_OWNER:-}" ]]; then
18+
printf '%s\n' 'GITHUB_REPOSITORY_OWNER environment variable must be set'
19+
exit 1
20+
fi
21+
22+
mkdir temp
23+
24+
git config --global user.email "metamaskbot@users.noreply.github.com"
25+
26+
git config --global user.name "MetaMask Bot"
27+
28+
git clone --depth 1 https://github.com/MetaMask/extension_bundlesize_stats.git temp
29+
30+
BUNDLE_SIZE_FILE="test-artifacts/chrome/bundle_size_stats.json"
31+
STATS_FILE="temp/stats/bundle_size_data.json"
32+
TEMP_FILE="temp/stats/bundle_size_data.temp.json"
33+
34+
# Ensure the JSON file exists
35+
if [[ ! -f "${STATS_FILE}" ]]; then
36+
echo "{}" > "${STATS_FILE}"
37+
fi
38+
39+
# Validate JSON files before modification
40+
jq . "${STATS_FILE}" > /dev/null || {
41+
echo "Error: Existing stats JSON is invalid"
42+
exit 1
43+
}
44+
jq . "${BUNDLE_SIZE_FILE}" > /dev/null || {
45+
echo "Error: New bundle size JSON is invalid"
46+
exit 1
47+
}
48+
49+
# Check if the SHA already exists in the stats file
50+
if jq -e "has(\"${GITHUB_SHA}\")" "${STATS_FILE}" > /dev/null; then
51+
echo "SHA ${GITHUB_SHA} already exists in stats file. No new commit needed."
52+
exit 0
53+
fi
54+
55+
# Append new bundle size data correctly using jq
56+
jq --arg sha "${GITHUB_SHA}" --argjson data "$(cat "${BUNDLE_SIZE_FILE}")" \
57+
'. + {($sha): $data}' "${STATS_FILE}" > "${TEMP_FILE}"
58+
59+
# Overwrite the original JSON file with the corrected version
60+
mv "${TEMP_FILE}" "${STATS_FILE}"
61+
62+
cd temp
63+
64+
# Only add the JSON file
65+
git add stats/bundle_size_data.json
66+
67+
git commit --message "Adding bundle size at commit: ${GITHUB_SHA}"
68+
69+
repo_slug="${GITHUB_REPOSITORY_OWNER}/extension_bundlesize_stats"
70+
71+
git push "https://metamaskbot:${EXTENSION_BUNDLESIZE_STATS_TOKEN}@github.com/${repo_slug}" main
72+
73+
cd ..
74+
75+
rm -rf temp

0 commit comments

Comments
 (0)