Skip to content

Commit

Permalink
Merge branch 'main' into update/stale-bot-language
Browse files Browse the repository at this point in the history
  • Loading branch information
sethkfman authored Sep 13, 2023
2 parents 20310a1 + 57dbc0e commit 0888bb1
Show file tree
Hide file tree
Showing 313 changed files with 12,327 additions and 5,594 deletions.
86 changes: 86 additions & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# List things here that *are - 'used, that depcheck is wrong about'
ignores:

# Note: Everything below this line should be removed after investigation
# TODO: Investigate each dependency to see whether it's used

## Unused dependencies to investigate
- '@babel/preset-env'
- '@babel/runtime'
- '@cucumber/message-streams'
- '@cucumber/messages'
- '@metamask/mobile-provider'
- '@rpii/wdio-html-reporter'
- '@testing-library/react'
- '@testing-library/react-hooks'
- '@types/jest'
- '@types/react-native-video'
- '@wdio/appium-service'
- '@wdio/browserstack-service'
- '@wdio/junit-reporter'
- '@wdio/local-runner'
- '@wdio/spec-reporter'
- 'appium'
- 'assert'
- 'babel-core'
- 'babel-loader'
- 'chromedriver'
- 'eslint-config-prettier'
- 'eslint-plugin-prettier'
- 'eslint-plugin-react-native'
- 'execa'
- 'fbjs-scripts'
- 'improved-yarn-audit'
- 'jetifier'
- 'metro'
- 'metro-react-native-babel-preset'
- 'octonode'
- 'oss-attribution-generator'
- 'prettier-plugin-gherkin'
- 'react-native-svg-asset-plugin'
- 'regenerator-runtime'
- 'rn-nodeify'

## Unused devDependencies to investigate
- '@ethersproject/abi'
- '@metamask/swappable-obj-proxy'
- '@react-native-picker/picker'
- '@rnhooks/keyboard'
- '@segment/sovran-react-native'
- '@tradle/react-native-http'
- 'asyncstorage-down'
- 'buffer'
- 'd3-shape'
- 'dnode'
- 'eciesjs'
- 'eth-block-tracker'
- 'eth-json-rpc-infura'
- 'events'
- 'https-browserify'
- 'obs-store'
- 'path'
- 'pbkdf2'
- 'pify'
- 'punycode'
- 'randomfill'
- 'react-native-aes-crypto'
- 'react-native-aes-crypto-forked'
- 'react-native-crypto'
- 'react-native-flash-message'
- 'react-native-level-fs'
- 'react-native-os'
- 'react-native-randombytes'
- 'react-native-redash'
- 'react-native-swipe-gestures'
- 'react-native-tcp'
- 'react-native-v8'
- 'socket.io-client'
- 'stream-browserify'
- 'url'
- 'vm-browserify'

## Missing dependencies to investigate
- '@react-navigation/core'
- 'app'
- 'i18n-js'
- 'images'
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ CHANGELOG.md
/storybook/storyLoader.js
wdio
/app/util/test/testSetup.js
/app/lib/ppom/ppom.html.js
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ module.exports = {
rules: {
// TODO: re-enable
'jsdoc/no-types': 'off',
// This change is included in `@metamask/[email protected]
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'all',
argsIgnorePattern: '[_]+',
ignoreRestSiblings: true, // this line is what has changed
},
],
},
},
{
Expand Down
83 changes: 75 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: printf '%s\n\n%s' '@metamask:registry=https://npm.pkg.github.com' "//npm.pkg.github.com/:_authToken=${PACKAGE_READ_TOKEN}" > .npmrc
env:
PACKAGE_READ_TOKEN: ${{ secrets.PACKAGE_READ_TOKEN }}
- run: yarn setup
- run: yarn setup:node
- name: Require clean working directory
shell: bash
run: |
Expand All @@ -39,15 +39,17 @@ jobs:
matrix:
scripts:
- lint
- lint:tsc
- audit:ci
- test:depcheck
- test:tgz-check
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn setup
- run: yarn setup:node
- run: yarn ${{ matrix['scripts'] }}
- name: Require clean working directory
shell: bash
Expand All @@ -56,26 +58,91 @@ jobs:
echo "Working tree dirty at end of job"
exit 1
fi
tests:
unit-tests:
runs-on: ubuntu-20.04
needs: setup
strategy:
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn setup
- run: yarn test:unit --forceExit --silent
- run: yarn setup:node
# The "10" in this command is the total number of shards. It must be kept
# in sync with the length of matrix.shard
- run: yarn test:unit --shard=${{ matrix.shard }}/10 --forceExit --silent --coverageReporters=json
env:
NODE_OPTIONS: --max_old_space_size=20480
- name: Rename coverage report to include shard number
shell: bash
run: |
mv ./tests/coverage/coverage-final.json ./tests/coverage/coverage-${{ matrix.shard }}.json
- uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.shard }}
path: ./tests/coverage/coverage-${{ matrix.shard }}.json
if-no-files-found: error
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi
merge-unit-tests:
runs-on: ubuntu-20.04
needs: unit-tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn setup
- uses: actions/download-artifact@v3
with:
path: tests/coverage/
- name: Gather partial coverage reports into one directory
shell: bash
run: |
mv ./tests/coverage/coverage-*/* ./tests/coverage
- run: yarn test:merge-coverage
- run: yarn test:validate-coverage
- uses: actions/upload-artifact@v3
with:
name: coverage
path: ./tests/merged-coverage/coverage.json
if-no-files-found: error
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
fi
sonar-cloud:
runs-on: ubuntu-20.04
needs: merge-unit-tests
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # SonarCloud needs a full checkout to perform necessary analysis
- uses: actions/download-artifact@v3
with:
name: coverage
path: tests/coverage/
- name: Upload coverage reports to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
- name: SonarCloud Scan
# v1.9.1
uses: SonarSource/sonarcloud-github-action@5875562561d22a34be0c657405578705a169af6c
if: ${{ env.HAVE_SONAR_TOKEN == 'true' }}
# This is SonarSource/[email protected]
uses: SonarSource/sonarcloud-github-action@4b4d7634dab97dcee0b75763a54a6dc92a9e6bc1
env:
HAVE_SONAR_TOKEN: ${{ secrets.SONAR_TOKEN != '' }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Require clean working directory
shell: bash
Expand All @@ -99,6 +166,6 @@ jobs:
all-jobs-pass:
name: All jobs pass
runs-on: ubuntu-20.04
needs: [setup, scripts, tests, check-workflows]
needs: [setup, scripts, unit-tests, check-workflows, sonar-cloud]
steps:
- run: echo "Great success!"
40 changes: 14 additions & 26 deletions .github/workflows/create-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,17 @@ jobs:
- name: Create bug report issue on planning repo
if: env.version
uses: octokit/[email protected]
with:
route: POST /repos/MetaMask/mobile-planning/issues
owner: MetaMask
title: v${{ env.version }} Bug Report
body: |
This bug report was automatically created by a GitHub action upon the creation of release branch `release/${{ env.version }}` (release cut).
**Expected actions for release engineers:**
1. Convert this issue into a Zenhub epic and link all bugs identified during the release regression testing phase to this epic.
2. After completing the first regression run, move this epic to "Regression Completed" on the [Mobile Release Regression board](https://app.zenhub.com/workspaces/mobile-release-regression-6249e5242464b70013315a98/board?filterLogic=any&labels=release-${{ env.version }},release-task).
Note that once the release is prepared for store submission, meaning the `release/${{ env.version }}` branch merges into `main`, another GitHub action will automatically close this epic.
labels: |
[
"type-bug",
"regression-RC",
"release-${{ env.version }}"
]
env:
GITHUB_TOKEN: ${{ secrets.BUG_REPORT_TOKEN }}
run: |
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 \`release/${{ 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 [Mobile Release Regression board](https://app.zenhub.com/workspaces/mobile-release-regression-6249e5242464b70013315a98/board?filterLogic=any&labels=release-${{ env.version }},release-task).\n\nNote that once the release is prepared for store submission, meaning the \`release/${{ env.version }}\` branch merges into \`main\`, another GitHub action will automatically close this epic.",
"labels": ["type-bug", "regression-RC", "release-${{ env.version }}"]
}
EOF
)
curl -X POST \
-H "Authorization: token ${{ secrets.BUG_REPORT_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/MetaMask/mobile-planning/issues \
-d "$payload"
2 changes: 1 addition & 1 deletion .github/workflows/crowdin_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: crowdin action
uses: crowdin/github-action@a3160b9e5a9e00739392c23da5e580c6cabe526d
with:
upload_translations: true
upload_translations: false # disabled to prevent translations overwriting Blends translations
download_translations: true
github_user_name: metamaskbot
github_user_email: [email protected]
Expand Down
5 changes: 5 additions & 0 deletions .js.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ export WALLET_CONNECT_PROJECT_ID=""

# Optional: SDK Remote Communication url (for testing with your local socket server)
# export SDK_COMMLAYER_URL="http://{YOUR_LOCAL_IP}

# CDN for blockaid files
export BLOCKAID_FILE_CDN=""
export BLOCKAID_PUBLIC_KEY=""
export MM_BLOCKAID_UI_ENABLED=""
Loading

0 comments on commit 0888bb1

Please sign in to comment.