Skip to content

Commit

Permalink
Merge branch 'main' into 1560_ios_deeplink_cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasMassart authored Sep 3, 2024
2 parents e5121fa + 6b19866 commit dcb0d3a
Show file tree
Hide file tree
Showing 362 changed files with 3,759 additions and 2,678 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ module.exports = {
'import/no-mutable-exports': 2,
'import/no-namespace': 2,
'import/no-nodejs-modules': 2,
'import/prefer-default-export': 2,
'import/prefer-default-export': 0,
'no-alert': 2,
'no-constant-condition': [
2,
Expand Down Expand Up @@ -190,5 +190,5 @@ module.exports = {
radix: 0,
},

ignorePatterns: ['wdio.conf.js', 'app/util/termsOfUse/termsOfUseContent.js'],
ignorePatterns: ['wdio.conf.js', 'app/util/termsOfUse/termsOfUseContent.ts'],
};
94 changes: 90 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ 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:node
- run: yarn setup --node
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
else
echo "No changes detected"
fi
dedupe:
runs-on: ubuntu-20.04
Expand All @@ -41,7 +43,7 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn setup:node
- run: yarn setup --node
- name: Deduplicate dependencies
run: yarn deduplicate
- name: Print error if duplicates found
Expand All @@ -68,14 +70,16 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: yarn
- run: yarn setup:node
- run: yarn setup --node
- run: yarn ${{ matrix['scripts'] }}
- name: Require clean working directory
shell: bash
run: |
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
else
echo "No changes detected"
fi
unit-tests:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -110,6 +114,8 @@ jobs:
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
else
echo "No changes detected"
fi
merge-unit-tests:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -141,14 +147,38 @@ jobs:
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
else
echo "No changes detected"
fi
js-bundle-size-check:
runs-on: ubuntu-20.04
needs: setup
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- name: Install dependencies
run: yarn setup

- name: Generate iOS bundle
run: yarn gen-bundle:ios

- name: Check bundle size
run: ./scripts/js-bundle-stats.sh ios/main.jsbundle 40

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/setup-node@v3
with:
node-version-file: '.nvmrc'
- uses: actions/download-artifact@v3
with:
name: coverage
Expand All @@ -169,6 +199,52 @@ jobs:
if ! git diff --exit-code; then
echo "Working tree dirty at end of job"
exit 1
else
echo "No changes detected"
fi
# Revert git update-index --no-assume-unchanged for each entry
echo "Reverting assume unchanged for the following paths:"
for path in "${EXCLUDES[@]}"; do
echo "$path"
git update-index --no-assume-unchanged "$path"
done
sonar-cloud-quality-gate-status:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: sonar-cloud
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: SonarCloud Quality Gate Status
id: sonar-status
run: |
sleep 30
PROJECT_KEY="metamask-mobile"
PR_NUMBER="${{ github.event.pull_request.number }}"
SONAR_TOKEN="${{ secrets.SONAR_TOKEN }}"
if [ -z "$PR_NUMBER" ]; then
echo "No pull request number found. Failing the check."
exit 1
fi
RESPONSE=$(curl -s -u "$SONAR_TOKEN:" \
"https://sonarcloud.io/api/qualitygates/project_status?projectKey=$PROJECT_KEY&pullRequest=$PR_NUMBER")
echo "SonarCloud API Response: $RESPONSE"
STATUS=$(echo "$RESPONSE" | jq -r '.projectStatus.status')
if [[ "$STATUS" == "ERROR" ]]; then
echo "Quality Gate failed."
exit 1
elif [[ "$STATUS" == "OK" ]]; then
echo "Quality Gate passed."
else
echo "Could not determine Quality Gate status."
exit 1
fi
check-workflows:
name: Check workflows
Expand All @@ -185,6 +261,16 @@ jobs:
all-jobs-pass:
name: All jobs pass
runs-on: ubuntu-20.04
needs: [setup, dedupe, scripts, unit-tests, check-workflows, sonar-cloud]
needs:
[
setup,
dedupe,
scripts,
unit-tests,
check-workflows,
sonar-cloud,
js-bundle-size-check,
sonar-cloud-quality-gate-status,
]
steps:
- run: echo "Great success!"
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 \`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.",
"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/3), 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 \`release/${{ env.version }}\`, indicating the release was cut.\n\n- This issue gets automatically closed by another GitHub action, once the \`release/${{ env.version }}\` branch merges into \`main\`, indicating the release is prepared for store submission.",
"labels": ["type-bug", "team-mobile-platform", "regression-RC-${{ env.version }}"]
}
EOF
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,7 @@ ccache
html-report/

# terms of use
app/util/termsOfUse/termsOfUseContent.js
docs/assets/termsOfUse.html
app/util/termsOfUse/termsOfUseContent.ts
docs/assets/termsOfUse.html

/app/images/branding
4 changes: 0 additions & 4 deletions .iyarc
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# ReDoS vulnerability, no impact to this application, and fix not backported yet to the versions we use

GHSA-c2qf-rxjj-qqgw

# micromatch ReDoS

GHSA-952p-6rrq-rcjv
1 change: 0 additions & 1 deletion .storybook/decorators/withSafeArea.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ GEM
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.3.3)
rexml (3.3.6)
strscan
ruby-macho (2.5.1)
strscan (3.1.0)
Expand Down
2 changes: 0 additions & 2 deletions app/__mocks__/@react-native-community/netinfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// eslint-disable-next-line import/prefer-default-export

export default {
useNetInfo: () => ({ isInternetReachable: false }),
};
2 changes: 1 addition & 1 deletion app/__mocks__/htmlMock.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@ts-expect-error TS issue: Cannot find module '../../node_modules/@metamask/...
// eslint-disable-next-line import/prefer-default-export

export { default as html } from '../../node_modules/@metamask/snaps-execution-environments/dist/browserify/webview/index.html';
1 change: 0 additions & 1 deletion app/__mocks__/react-native-camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ class RNCamera extends React.Component {
}
}

// eslint-disable-next-line import/prefer-default-export
export { RNCamera };
1 change: 0 additions & 1 deletion app/actions/modals/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/prefer-default-export
export function toggleNetworkModal(shouldNetworkSwitchPopToWallet = true) {
return {
type: 'TOGGLE_NETWORK_MODAL',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ exports[`TagBase should render TagBase 1`] = `
style={
{
"color": "#141618",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
// eslint-disable-next-line import/prefer-default-export
export const ACCOUNT_BASE_TEST_ID = 'account-base';
export const ACCOUNT_BALANCE_AVATAR_TEST_ID = 'account-avatar';
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const SAMPLE_CELLSELECT_WITH_BUTTON_AVATARPROPS: AvatarProps = {
type: AvatarAccountType.JazzIcon,
};

// eslint-disable-next-line import/prefer-default-export
export const SAMPLE_CELLSELECT_WITH_BUTTON_PROPS: CellSelectWithMenuProps = {
title: SAMPLE_CELLSELECT_WITH_BUTTON_TITLE,
secondaryText: SAMPLE_CELLSELECT_WITH_BUTTON_SECONDARYTEXT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ exports[`CellSelectWithMenu should render with default settings correctly 1`] =
style={
{
"color": "#141618",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 16,
"fontWeight": "400",
"letterSpacing": 0,
Expand Down Expand Up @@ -249,7 +249,7 @@ exports[`CellSelectWithMenu should render with default settings correctly 1`] =
style={
{
"color": "#6a737d",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports[`CustomSpendCap should match snapshot 1`] = `
style={
{
"color": "#141618",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Bold",
"fontSize": 14,
"fontWeight": "700",
"letterSpacing": 0,
Expand Down Expand Up @@ -99,6 +99,11 @@ exports[`CustomSpendCap should match snapshot 1`] = `
{
"backgroundColor": "transparent",
"color": "#141618",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
}
}
suppressHighlighting={true}
Expand All @@ -108,7 +113,7 @@ exports[`CustomSpendCap should match snapshot 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
Expand Down Expand Up @@ -185,7 +190,7 @@ exports[`CustomSpendCap should match snapshot 1`] = `
style={
{
"color": "#6a737d",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 12,
"fontWeight": "400",
"letterSpacing": 0,
Expand All @@ -210,7 +215,7 @@ exports[`CustomSpendCap should match snapshot 1`] = `
style={
{
"color": "#6a737d",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
Expand All @@ -230,6 +235,11 @@ exports[`CustomSpendCap should match snapshot 1`] = `
{
"backgroundColor": "transparent",
"color": "#141618",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
}
}
suppressHighlighting={true}
Expand All @@ -239,7 +249,7 @@ exports[`CustomSpendCap should match snapshot 1`] = `
style={
{
"color": "#0376c9",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports[`AggregatedPercentage should render correctly 1`] = `
style={
{
"color": "#1c8234",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "500",
"letterSpacing": 0,
Expand All @@ -29,7 +29,7 @@ exports[`AggregatedPercentage should render correctly 1`] = `
style={
{
"color": "#1c8234",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "500",
"letterSpacing": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`PercentageChange should render correctly 1`] = `
style={
{
"color": "#1c8234",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "500",
"letterSpacing": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`TagColored should render TagColored 1`] = `
style={
{
"color": "#6a737d",
"fontFamily": "Euclid Circular B",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 10,
"fontWeight": "bold",
"letterSpacing": 0.25,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/prefer-default-export
// External dependencies.
import { AnimationDuration } from '../../../constants/animation.constants';
import { SAMPLE_ACCORDIONHEADER_TITLE } from './foundation/AccordionHeader/AccordionHeader.constants';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-console */
// eslint-disable-next-line import/prefer-default-export

// Internal dependencies.
import {
AccordionHeaderHorizontalAlignment,
Expand Down
Loading

0 comments on commit dcb0d3a

Please sign in to comment.