Skip to content

Commit da3b015

Browse files
authored
Merge branch 'develop' into fix-blockaid-false-positive-metrics
2 parents 7819d57 + e2dd47b commit da3b015

31 files changed

+2651
-1321
lines changed

.circleci/config.yml

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,33 +47,22 @@ aliases:
4747
set -u
4848
set -o pipefail
4949
50-
# This Shallow Git Clone code is adapted from what the standard CircleCI `checkout` command does for the case of an external PR (link to example below):
51-
# https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/49817/workflows/dc195ea6-ac06-4de1-9edf-4c949427b5fb/jobs/1430976/parallel-runs/0/steps/0-101
52-
### git clone --no-checkout "$CIRCLE_REPOSITORY_URL" .
53-
### git fetch --force origin +refs/pull/18748/head:refs/remotes/origin/pull/18748
54-
### git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
55-
### git --no-pager log --no-color -n 1 --format='HEAD is now at %h %s'
56-
5750
# Set up SSH access
5851
# This SSH key is the current github.com SSH key as of June 2023, but it will need to be changed whenever github changes their key (probably every few years)
5952
GITHUB_SSH_KEY="AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl"
6053
mkdir -p ~/.ssh
6154
echo github.com ssh-ed25519 $GITHUB_SSH_KEY >> ~/.ssh/known_hosts
6255
63-
# Take a different clone path depending on if it's a tag, a PR from an external repo, or the normal case
56+
git clone --depth 1 --no-checkout "$CIRCLE_REPOSITORY_URL" .
57+
git fetch --depth 1 origin "$CIRCLE_SHA1"
58+
6459
if [ -n "${CIRCLE_TAG-}" ]; then
65-
# tag
66-
git clone --depth 1 --no-checkout "$CIRCLE_REPOSITORY_URL" .
67-
git fetch --depth 1 --force origin "+refs/tags/${CIRCLE_TAG}:refs/tags/${CIRCLE_TAG}"
68-
git checkout --force -q "$CIRCLE_TAG" "$CIRCLE_SHA1"
69-
elif [[ "$CIRCLE_BRANCH" =~ ^pull\/* ]]; then
70-
# pull request
71-
git clone --depth 1 --no-checkout "$CIRCLE_REPOSITORY_URL" .
72-
git fetch --depth 1 --force origin "${CIRCLE_BRANCH}/head:remotes/origin/${CIRCLE_BRANCH}"
73-
git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
60+
echo "Checkout tag '${CIRCLE_TAG}' at commit '${CIRCLE_SHA1}'"
61+
git checkout "$CIRCLE_TAG"
62+
git reset --hard "$CIRCLE_SHA1"
7463
else
75-
# normal case
76-
git clone --depth 1 "$CIRCLE_REPOSITORY_URL" --branch "$CIRCLE_BRANCH" .
64+
echo "Checkout branch '${CIRCLE_BRANCH}' at commit '${CIRCLE_SHA1}'"
65+
git checkout -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
7766
fi
7867
7968
workflows:
@@ -880,7 +869,7 @@ jobs:
880869
command: |
881870
if .circleci/scripts/test-run-e2e.sh
882871
then
883-
yarn test:e2e:chrome --retries 2 --debug
872+
timeout 20m yarn test:e2e:chrome --retries 2 --debug
884873
fi
885874
no_output_timeout: 5m
886875
- store_artifacts:
@@ -907,9 +896,11 @@ jobs:
907896
command: |
908897
if .circleci/scripts/test-run-e2e.sh
909898
then
910-
MULTICHAIN=1 yarn test:e2e:chrome --retries 2 --debug
899+
timeout 20m yarn test:e2e:chrome --retries 2 --debug
911900
fi
912901
no_output_timeout: 5m
902+
environment:
903+
MULTICHAIN: 1
913904
- store_artifacts:
914905
path: test-artifacts
915906
destination: test-artifacts
@@ -934,7 +925,7 @@ jobs:
934925
command: |
935926
if .circleci/scripts/test-run-e2e.sh
936927
then
937-
yarn test:e2e:chrome --retries 2 --debug || echo "Temporarily suppressing MV3 e2e test failures"
928+
timeout 20m yarn test:e2e:chrome --retries 2 --debug || echo "Temporarily suppressing MV3 e2e test failures"
938929
fi
939930
no_output_timeout: 5m
940931
- store_artifacts:
@@ -959,7 +950,7 @@ jobs:
959950
command: |
960951
if .circleci/scripts/test-run-e2e.sh
961952
then
962-
yarn test:e2e:chrome:rpc --retries 2
953+
timeout 20m yarn test:e2e:chrome:rpc --retries 2
963954
fi
964955
no_output_timeout: 5m
965956
- store_artifacts:
@@ -1012,7 +1003,7 @@ jobs:
10121003
command: |
10131004
if .circleci/scripts/test-run-e2e.sh
10141005
then
1015-
yarn test:e2e:chrome:rpc --retries 2 --debug --build-type=mmi
1006+
timeout 20m yarn test:e2e:chrome:rpc --retries 2 --debug --build-type=mmi
10161007
fi
10171008
no_output_timeout: 5m
10181009
- store_artifacts:
@@ -1054,7 +1045,7 @@ jobs:
10541045
command: |
10551046
if .circleci/scripts/test-run-e2e.sh
10561047
then
1057-
yarn test:e2e:firefox:flask --retries 2 --debug
1048+
timeout 20m yarn test:e2e:firefox:flask --retries 2 --debug
10581049
fi
10591050
no_output_timeout: 5m
10601051
- store_artifacts:
@@ -1081,7 +1072,7 @@ jobs:
10811072
command: |
10821073
if .circleci/scripts/test-run-e2e.sh
10831074
then
1084-
yarn test:e2e:chrome:flask --retries 2 --debug
1075+
timeout 20m yarn test:e2e:chrome:flask --retries 2 --debug
10851076
fi
10861077
no_output_timeout: 5m
10871078
- store_artifacts:
@@ -1108,7 +1099,7 @@ jobs:
11081099
command: |
11091100
if .circleci/scripts/test-run-e2e.sh
11101101
then
1111-
yarn test:e2e:chrome:mmi --retries 2 --debug --build-type=mmi
1102+
timeout 20m yarn test:e2e:chrome:mmi --retries 2 --debug --build-type=mmi
11121103
fi
11131104
no_output_timeout: 5m
11141105
- store_artifacts:
@@ -1136,7 +1127,7 @@ jobs:
11361127
command: |
11371128
TESTFILES=$(circleci tests glob "test/e2e/mmi/**/*.spec.ts")
11381129
echo "$TESTFILES"
1139-
echo "$TESTFILES" | circleci tests run --command="xvfb-run xargs yarn playwright test" verbose --split-by=timings
1130+
echo "$TESTFILES" | timeout 20m circleci tests run --command="xvfb-run xargs yarn playwright test" verbose --split-by=timings
11401131
no_output_timeout: 10m
11411132
- slack/notify:
11421133
branch_pattern: Version-v*
@@ -1175,7 +1166,7 @@ jobs:
11751166
command: |
11761167
if .circleci/scripts/test-run-e2e.sh
11771168
then
1178-
yarn test:e2e:firefox --retries 2 --debug
1169+
timeout 20m yarn test:e2e:firefox --retries 2 --debug
11791170
fi
11801171
no_output_timeout: 5m
11811172
- store_artifacts:

.yarn/releases/yarn-4.0.0-rc.48.cjs

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

.yarn/releases/yarn-4.0.2.cjs

Lines changed: 893 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,18 @@ npmAuditIgnoreAdvisories:
126126
- '@metamask/snaps-ui (deprecation)'
127127

128128
npmRegistries:
129-
'https://npm.pkg.github.com':
129+
"https://npm.pkg.github.com":
130130
npmAlwaysAuth: true
131-
npmAuthToken: '${GITHUB_PACKAGE_READ_TOKEN-}'
131+
npmAuthToken: "${GITHUB_PACKAGE_READ_TOKEN-}"
132132

133133
npmScopes:
134134
metamask:
135-
npmRegistryServer: '${METAMASK_NPM_REGISTRY:-https://registry.yarnpkg.com}'
135+
npmRegistryServer: "${METAMASK_NPM_REGISTRY:-https://registry.yarnpkg.com}"
136136

137137
plugins:
138138
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
139-
spec: 'https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js'
139+
spec: "https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js"
140140
- path: .yarn/plugins/@yarnpkg/plugin-engines.cjs
141-
spec: 'https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js'
141+
spec: "https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js"
142142

143-
yarnPath: .yarn/releases/yarn-4.0.0-rc.48.cjs
143+
yarnPath: .yarn/releases/yarn-4.0.2.cjs

app/_locales/en/messages.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/scripts/controllers/decrypt-message.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const createKeyringControllerMock = () => ({
3131
const createMessengerMock = () =>
3232
({
3333
registerActionHandler: jest.fn(),
34+
registerInitialEventPayload: jest.fn(),
3435
publish: jest.fn(),
3536
call: jest.fn(),
3637
} as any as jest.Mocked<DecryptMessageControllerMessenger>);

app/scripts/controllers/permissions/selectors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export const getPermittedAccountsByOrigin = createSelector(
2525
getSubjects,
2626
(subjects) => {
2727
return Object.values(subjects).reduce((originToAccountsMap, subject) => {
28-
const caveat = subject.permissions?.eth_accounts?.caveats.find(
28+
const caveats = subject.permissions?.eth_accounts?.caveats || [];
29+
30+
const caveat = caveats.find(
2931
({ type }) => type === CaveatTypes.restrictReturnedAccounts,
3032
);
3133

app/scripts/lib/keyring-snaps-permissions.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('keyringSnapPermissionsBuilder', () => {
1313
subjectCacheLimit: 100,
1414
messenger: {
1515
registerActionHandler: jest.fn(),
16+
registerInitialEventPayload: jest.fn(),
1617
publish: jest.fn(),
1718
} as any,
1819
state: {},

app/scripts/lib/setupSentry.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ export const SENTRY_BACKGROUND_STATE = {
312312
TxController: {
313313
transactions: false,
314314
},
315+
UserOperationController: {
316+
userOperations: false,
317+
},
315318
};
316319

317320
const flattenedBackgroundStateMask = Object.values(

0 commit comments

Comments
 (0)