Skip to content

Commit

Permalink
Merge origin/develop into master-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
danjm committed Sep 25, 2024
2 parents 63a50cc + ad7a546 commit 9deae2f
Show file tree
Hide file tree
Showing 1,418 changed files with 56,460 additions and 53,925 deletions.
126 changes: 66 additions & 60 deletions .circleci/config.yml

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions .circleci/scripts/enable-vnc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# This script is based on the documentation from CircleCI, which does not work as written
# https://circleci.com/docs/browser-testing/#interacting-with-the-browser-over-vnc

set -e
set -u
set -o pipefail
set -x

cd "${HOME}/project"

# Install a VNC server
readonly LOCK_FILE="installed.lock"
if [ ! -f "${LOCK_FILE}" ]; then
sudo apt update
sudo apt install -y x11vnc

touch "${LOCK_FILE}"
fi

# Start VNC server
if ! pgrep x11vnc > /dev/null; then
x11vnc -display "$DISPLAY" -bg -forever -nopw -quiet -listen localhost -xkb -rfbport 5901 -passwd password
fi
8 changes: 8 additions & 0 deletions .circleci/scripts/test-run-e2e-timeout-minutes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { filterE2eChangedFiles } from '../../test/e2e/changedFilesUtil';

const changedOrNewTests = filterE2eChangedFiles();

//15 minutes, plus 3 minutes for every changed file, up to a maximum of 30 minutes
const extraTime = Math.min(15 + changedOrNewTests.length * 3, 30);

console.log(extraTime);
16 changes: 14 additions & 2 deletions .circleci/scripts/test-run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,23 @@ then
exit 1
fi

# Skip running e2e tests if we're doing "Rerun job with SSH" and we're not on the first node
if netstat -tnlp | grep -q 'circleci-agent' && [ "$CIRCLE_NODE_INDEX" -ne 0 ]
then
printf '"Rerun job with SSH" and not on the first node, shutting down\n'
circleci-agent step halt
exit 1
fi

TIMEOUT_MINUTES=$(yarn tsx .circleci/scripts/test-run-e2e-timeout-minutes.ts)
echo "TIMEOUT_MINUTES: $TIMEOUT_MINUTES"

# Run the actual test command from the parameters
timeout 20m "$@" --retries 1
timeout "${TIMEOUT_MINUTES}"m "$@" --retries 1

# Error code 124 means the command timed out
if [ $? -eq 124 ]; then
if [ $? -eq 124 ]
then
# Once deleted, if someone tries to "Rerun failed tests" the result will be
# "Error: can not rerun failed tests: no failed tests could be found"
echo 'Timeout error, deleting the test results'
Expand Down
4 changes: 2 additions & 2 deletions .circleci/scripts/validate-locales-only.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const { readChangedFiles } = require('../../test/e2e/changedFilesUtil.js');
* Fails the build if any changed files are outside of the /_locales/ directory.
* Fails if no changed files are detected.
*/
async function validateLocalesOnlyChangedFiles() {
const changedFiles = await readChangedFiles();
function validateLocalesOnlyChangedFiles() {
const changedFiles = readChangedFiles();
if (!changedFiles || changedFiles.length === 0) {
console.error('Failure: No changed files detected.');
process.exit(1);
Expand Down
1 change: 1 addition & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ignores:
- '@sentry/cli' # invoked as `sentry-cli`
- 'chromedriver'
- 'depcheck' # ooo meta
- 'ethers' # ethers @5.7.0 expected by @account-abstraction/contracts, but conflicts with transitive ethers@6.x
- 'ganache-cli'
- 'geckodriver'
- 'jest'
Expand Down
30 changes: 30 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,36 @@ module.exports = {
plugins: ['@metamask/design-tokens'],
rules: {
'@metamask/design-tokens/color-no-hex': 'warn',
'import/no-restricted-paths': [
'error',
{
basePath: './',
zones: [
{
target: './app',
from: './ui',
message:
'Should not import from UI in background, use shared directory instead',
},
{
target: './ui',
from: './app',
message:
'Should not import from background in UI, use shared directory instead',
},
{
target: './shared',
from: './app',
message: 'Should not import from background in shared',
},
{
target: './shared',
from: './ui',
message: 'Should not import from UI in shared',
},
],
},
],
},
overrides: [
/**
Expand Down
23 changes: 22 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

* @MetaMask/extension-devs
development/ @MetaMask/extension-devs @kumavis
lavamoat/ @MetaMask/extension-devs @MetaMask/supply-chain @MetaMask/snaps-devs
lavamoat/ @MetaMask/extension-devs @MetaMask/supply-chain

# The offscreen.ts script file that is included in the offscreen document html
# file is responsible, at present, for loading the snaps execution environment
Expand Down Expand Up @@ -93,3 +93,24 @@ app/scripts/controllers/swaps @MetaMask/swaps-engineers
shared/constants/permissions.ts @MetaMask/snaps-devs
ui/helpers/utils/permission.js @MetaMask/snaps-devs
ui/hooks/useTransactionInsights.js @MetaMask/snaps-devs

# Wallet UX
ui/components/multichain @MetaMask/wallet-ux
ui/components/app/whats-new-popup @MetaMask/wallet-ux
ui/css @MetaMask/wallet-ux
ui/pages/home @MetaMask/wallet-ux
ui/pages/onboarding-flow @MetaMask/wallet-ux

# Assets
ui/components/app/add-network @MetaMask/metamask-assets
ui/components/app/auto-detect-nft @MetaMask/metamask-assets
ui/components/app/auto-detect-token @MetaMask/metamask-assets
ui/components/app/import-token @MetaMask/metamask-assets
ui/components/app/nft-default-image @MetaMask/metamask-assets
ui/components/app/nft-details @MetaMask/metamask-assets
ui/components/app/nft-options @MetaMask/metamask-assets
ui/components/app/nfts-detection-notice-import-nfts @MetaMask/metamask-assets
ui/components/app/nfts-items @MetaMask/metamask-assets
ui/components/app/nfts-tab @MetaMask/metamask-assets
ui/components/ui/deprecated-networks @MetaMask/metamask-assets
ui/components/ui/nft-collection-image @MetaMask/metamask-assets
89 changes: 0 additions & 89 deletions .github/scripts/add-team-label.ts

This file was deleted.

4 changes: 2 additions & 2 deletions .github/scripts/check-template-and-add-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enum RegressionStage {
Production
}

const knownBots = ["metamaskbot", "dependabot", "github-actions", "sentry-io"];
const knownBots = ["metamaskbot", "dependabot", "github-actions", "sentry-io", "devin-ai-integration"];

main().catch((error: Error): void => {
console.error(error);
Expand Down Expand Up @@ -82,7 +82,7 @@ async function main(): Promise<void> {
}

// If author is not part of the MetaMask organisation
if (!(await userBelongsToMetaMaskOrg(octokit, labelable?.author))) {
if (!knownBots.includes(labelable?.author) && !(await userBelongsToMetaMaskOrg(octokit, labelable?.author))) {
// Add external contributor label to the issue
await addLabelToLabelable(octokit, labelable, externalContributorLabel);
}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/add-team-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

jobs:
add-team-label:
uses: metamask/github-tools/.github/workflows/add-team-label.yml@main
uses: metamask/github-tools/.github/workflows/add-team-label.yml@058012b49ff2fbd9649c566ba43b29497f93b21d
permissions:
pull-requests: write
secrets:
PERSONAL_ACCESS_TOKEN: ${{ secrets.RELEASE_LABEL_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/create-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
payload=$(cat <<EOF
{
"title": "v${{ env.version }} Bug Report",
"body": "This bug report was automatically created by a GitHub action upon the creation of release branch \`Version-v${{ env.version }}\` (release cut).\n\n**Expected actions for release engineers:**\n\n1. Convert this issue into a Zenhub epic and link all bugs identified during the release regression testing phase to this epic.\n\n2. After completing the first regression run, move this epic to \"Regression Completed\" on the [Extension Release Regression board](https://app.zenhub.com/workspaces/extension-release-regression-6478c62d937eaa15e95c33c5/board?filterLogic=any&labels=release-${{ env.version }},release-task).\n\nNote that once the release is prepared for store submission, meaning the \`Version-v${{ env.version }}\` branch merges into \`master\`, another GitHub action will automatically close this epic.",
"body": "**What is this bug report issue for?**\n\n1. This issue is used to track release dates on this [Github Project board](https://github.com/orgs/MetaMask/projects/86/views/1), which content then gets pulled into our metrics system.\n\n2. This issue is also used by our Zapier automations, to determine if automated notifications shall be sent on Slack for release \`${{ env.version }}\`. Notifications will only be sent as long as this issue is open.\n\n**Who created and/or closed this issue?**\n\n- This issue was automatically created by a GitHub action upon the creation of the release branch \`Version-v${{ env.version }}\`, indicating the release was cut.\n\n- This issue gets automatically closed by another GitHub action, once the \`Version-v${{ env.version }}\` branch merges into \`master\`, indicating the release is prepared for store submission.",
"labels": ["type-bug", "team-extension-platform", "regression-RC-${{ env.version }}"]
}
EOF
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/run-integration-tests.yml

This file was deleted.

Loading

0 comments on commit 9deae2f

Please sign in to comment.