Skip to content

Commit

Permalink
Merge pull request #24372 from MetaMask/Version-v11.15.1
Browse files Browse the repository at this point in the history
Version v11.15.1
  • Loading branch information
danjm committed May 4, 2024
2 parents ba27c66 + 889c40d commit 5ee4ae3
Show file tree
Hide file tree
Showing 447 changed files with 15,988 additions and 6,501 deletions.
99 changes: 89 additions & 10 deletions .circleci/config.yml
Expand Up @@ -67,6 +67,18 @@ aliases:
git checkout -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
fi
# Check if MMI Optional tests should run
- &check-mmi-optional
name: Check if MMI Optional tests should run
command: |
RUN_MMI_OPTIONAL=$(cat ./RUN_MMI_OPTIONAL)
if [[ "${CIRCLE_BRANCH}" == "develop" || "${RUN_MMI_OPTIONAL}" == "true" ]]; then
echo "Running MMI Optional tests"
else
echo "Skipping MMI Optional tests"
circleci step halt
fi
workflows:
test_and_release:
jobs:
Expand All @@ -77,6 +89,7 @@ workflows:
- trigger-beta-build:
requires:
- prep-deps
- check-pr-tag
- prep-deps
- test-deps-audit:
requires:
Expand Down Expand Up @@ -132,6 +145,7 @@ workflows:
- prep-build-test-mmi-playwright:
requires:
- prep-deps
- check-pr-tag
- prep-build-storybook:
requires:
- prep-deps
Expand Down Expand Up @@ -373,6 +387,68 @@ jobs:
name: Create GitHub Pull Request for version
command: .circleci/scripts/release-create-release-pr.sh

check-pr-tag:
docker:
- image: cimg/base:stable
steps:
- run:
name: Check for MMI Team Tag
command: |
#!/bin/bash
# GitHub Personal Access Token for API Authentication
GITHUB_TOKEN="${GITHUB_TOKEN}"
BRANCH="${CIRCLE_BRANCH}"
# Fetch the PRs associated with the current branch and check the response
PR_RESPONSE=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
"https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls?state=open&head=${CIRCLE_PROJECT_USERNAME}:${BRANCH}")
echo "https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls?state=open&head=${CIRCLE_PROJECT_USERNAME}:${BRANCH}"
# Check if the response contains valid JSON
if ! echo "$PR_RESPONSE" | jq empty; then
echo "Failed to parse JSON response."
echo "$PR_RESPONSE"
exit 1
fi
# Check if we received an array of PRs
if ! echo "$PR_RESPONSE" | jq -e '. | type == "array"'; then
echo "$PR_RESPONSE"
echo "Expected an array of PRs, got something else."
exit 1
fi
# Check if the array of PRs is empty
PR_COUNT=$(echo "$PR_RESPONSE" | jq '. | length')
# If no PRs are found, exit gracefully
if [ "$PR_COUNT" -eq 0 ]; then
echo "No open PRs found. Exiting."
echo "false" > ./RUN_MMI_OPTIONAL
exit 0
fi
# Extract label names from the PR_RESPONSE
LABEL_NAMES=$(echo "$PR_RESPONSE" | jq -r '.[0].labels[].name')
echo "Labels found: $LABEL_NAMES"
# Check if "team-mmi" label is present
if echo "$LABEL_NAMES" | grep -qw "team-mmi"; then
echo "team-mmi tag found."
# assign the RUN_MMI_OPTIONAL variable to true
echo "true" > ./RUN_MMI_OPTIONAL
else
echo "team-mmi tag not found."
# assign the RUN_MMI_OPTIONAL variable to false
echo "false" > ./RUN_MMI_OPTIONAL
fi
- persist_to_workspace:
root: .
paths:
- RUN_MMI_OPTIONAL

prep-deps:
executor: node-browsers-medium
steps:
Expand Down Expand Up @@ -640,6 +716,7 @@ jobs:
- run: *shallow-git-clone
- attach_workspace:
at: .
- run: *check-mmi-optional
- run:
name: Build MMI extension for Playwright e2e
command: |
Expand All @@ -654,6 +731,7 @@ jobs:
- persist_to_workspace:
root: .
paths:
- RUN_MMI_OPTIONAL
- dist-test-mmi-playwright
- builds-test-mmi-playwright
- store_artifacts:
Expand Down Expand Up @@ -875,7 +953,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome --retries 2 --debug
timeout 20m yarn test:e2e:chrome --retries 2
fi
no_output_timeout: 5m
- store_artifacts:
Expand All @@ -902,7 +980,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome --retries 2 --debug
timeout 20m yarn test:e2e:chrome --retries 2
fi
no_output_timeout: 5m
environment:
Expand Down Expand Up @@ -931,7 +1009,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome --retries 2 --debug || echo "Temporarily suppressing MV3 e2e test failures"
timeout 20m yarn test:e2e:chrome --retries 2 || echo "Temporarily suppressing MV3 e2e test failures"
fi
no_output_timeout: 5m
- store_artifacts:
Expand Down Expand Up @@ -1009,7 +1087,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome:rpc --retries 2 --debug --build-type=mmi
timeout 20m yarn test:e2e:chrome:rpc --retries 2 --build-type=mmi
fi
no_output_timeout: 5m
- store_artifacts:
Expand All @@ -1029,7 +1107,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.js --browser chrome --retries 2 --debug
yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.js --browser chrome --retries 2
fi
no_output_timeout: 5m

Expand All @@ -1051,7 +1129,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:firefox:flask --retries 2 --debug
timeout 20m yarn test:e2e:firefox:flask --retries 2
fi
no_output_timeout: 5m
- store_artifacts:
Expand All @@ -1078,7 +1156,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome:flask --retries 2 --debug
timeout 20m yarn test:e2e:chrome:flask --retries 2
fi
no_output_timeout: 5m
- store_artifacts:
Expand All @@ -1105,7 +1183,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:chrome:mmi --retries 2 --debug --build-type=mmi
timeout 20m yarn test:e2e:chrome:mmi --retries 2 --build-type=mmi
fi
no_output_timeout: 5m
- store_artifacts:
Expand All @@ -1121,6 +1199,7 @@ jobs:
- run: *shallow-git-clone
- attach_workspace:
at: .
- run: *check-mmi-optional
- run:
name: Move test build to dist
command: mv ./dist-test-mmi-playwright ./dist
Expand Down Expand Up @@ -1172,7 +1251,7 @@ jobs:
command: |
if .circleci/scripts/test-run-e2e.sh
then
timeout 20m yarn test:e2e:firefox --retries 2 --debug
timeout 20m yarn test:e2e:firefox --retries 2
fi
no_output_timeout: 5m
- store_artifacts:
Expand Down Expand Up @@ -1571,4 +1650,4 @@ jobs:
steps:
- run:
name: All Tests Passed
command: echo 'weew - everything passed!'
command: echo 'whew - everything passed!'
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -135,6 +135,7 @@ module.exports = {
path.resolve(__dirname, '.eslintrc.typescript-compat.js'),
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
// this rule is new, but we didn't use it before, so it's off now
'@typescript-eslint/no-duplicate-enum-values': 'off',
'@typescript-eslint/no-shadow': [
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -51,3 +51,6 @@ privacy-snapshot.json @MetaMask/extension-privacy-reviewers
# For now, restricting approvals inside the .devcontainer folder to devs
# who were involved with the Codespaces project.
.devcontainer/ @MetaMask/library-admins @HowardBraham @plasmacorral @brad-decker

# Confirmations UX team to own code for confirmations on UI.
ui/pages/confirmations @MetaMask/confirmations-ux @MetaMask/confirmations-system-team
2 changes: 1 addition & 1 deletion .github/scripts/check-pr-has-required-labels.ts
Expand Up @@ -73,7 +73,7 @@ async function main(): Promise<void> {
if (!hasTeamLabel) {
errorMessage += 'No team labels found on the PR. ';
}
errorMessage += `Please make sure the PR is appropriately labeled before merging it.\n\nSee labeling guidelines for more detail: https://github.com/MetaMask/metamask-extension/blob/develop/.github/LABELING_GUIDELINES.md`;
errorMessage += `Please make sure the PR is appropriately labeled before merging it.\n\nSee labeling guidelines for more detail: https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md`;
core.setFailed(errorMessage);
process.exit(1);
}
2 changes: 1 addition & 1 deletion .github/workflows/security-code-scanner.yml
Expand Up @@ -32,5 +32,5 @@ jobs:
node_modules
rules_excluded:
example
mixpanel_project_token: ${{secrets.SECURITY_CODE_SCANNER_MIXPANEL_TOKEN}}
project_metrics_token: ${{secrets.SECURITY_SCAN_METRICS_TOKEN}}
slack_webhook: ${{ secrets.APPSEC_BOT_SLACK_WEBHOOK }}
14 changes: 12 additions & 2 deletions .github/workflows/sonar.yml
Expand Up @@ -4,6 +4,16 @@ on:
secrets:
SONAR_TOKEN:
required: true
pull_request:
branches:
- develop
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

jobs:
sonarcloud:
name: SonarCloud
Expand All @@ -13,8 +23,8 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for better relevancy of analysis
- name: SonarCloud Scan
# v1.9.1
uses: SonarSource/sonarcloud-github-action@5875562561d22a34be0c657405578705a169af6c
# This is SonarSource/sonarcloud-github-action@v2.0.0
uses: SonarSource/sonarcloud-github-action@4b4d7634dab97dcee0b75763a54a6dc92a9e6bc1
with:
args: >
-Dsonar.javascript.lcov.reportPaths=tests/coverage/lcov.info
Expand Down
1 change: 1 addition & 0 deletions .metamaskrc.dist
Expand Up @@ -21,3 +21,4 @@ BLOCKAID_PUBLIC_KEY=
; SELENIUM_HEADLESS=
; Set this to 1 to make chrome e2e tests disable DoH/DoT and use system DNS
; SELENIUM_USE_SYSTEM_DNS=
ENABLE_CONFIRMATION_REDESIGN=
10 changes: 10 additions & 0 deletions .storybook/main.js
Expand Up @@ -64,6 +64,7 @@ module.exports = {
{
loader: 'css-loader',
options: {
esModule: false,
import: false,
url: false,
},
Expand All @@ -83,6 +84,15 @@ module.exports = {
config.plugins.push(
new CopyWebpackPlugin({
patterns: [
{
from: path.join(
'ui',
'css',
'utilities',
'fonts/',
),
to: 'fonts',
},
{
from: path.join(
'node_modules',
Expand Down
84 changes: 84 additions & 0 deletions .vscode/cspell.json
@@ -0,0 +1,84 @@
{
"ignorePaths": ["app/images", "package.json"],
"ignoreWords": [
"acitores",
"autofetch",
"azuretools",
"Brainstem",
"C01LUJL3T98",
"C05QXJA7NP8",
"cids",
"eamodio",
"initialisation",
"koalaman",
"mockttp",
"multibase",
"multicodec",
"namelookup",
"pluggable",
"protobufjs",
"regadas",
"remotedev",
"rvest",
"sesify",
"siginsights",
"testrpc",
"txinsights",
"webextension",
"xvfb"
],
"useGitignore": true,
"version": "0.2",
"words": [
"bignumber",
"blockaid",
"browserlistrc",
"cimg",
"codecov",
"codespace",
"codespaces",
"corepack",
"datetime",
"datetimes",
"dedupe",
"depcheck",
"devcontainer",
"devcontainers",
"endregion",
"ensdomains",
"flamegraph",
"FONTCONFIG",
"hardfork",
"hexstring",
"jazzicon",
"keccak",
"lavadome",
"lavamoat",
"lavapack",
"lockdown",
"metamaskbot",
"metamaskrc",
"metametrics",
"mocharc",
"MULTICHAIN",
"MULTIPROVIDER",
"npmcli",
"onboarded",
"pageload",
"petnames",
"pipefail",
"quickstart",
"recompiles",
"shellcheck",
"sourcemaps",
"sprintf",
"testcase",
"TESTFILES",
"testid",
"tsbuildinfo",
"tsconfigs",
"typecheck",
"yargs",
"yarnpkg"
]
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Expand Up @@ -38,7 +38,7 @@
"type": "pickString",
"id": "browserToUse",
"description": "Which browser do you want to test with?",
"options": ["chrome", "firefox"],
"options": ["chrome", "firefox", "all"],
"default": "chrome"
}
],
Expand Down

0 comments on commit 5ee4ae3

Please sign in to comment.