Skip to content

Commit

Permalink
Merge branch 'main' into feat/sentry-perf-qa-builds
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoloureirop authored Oct 17, 2024
2 parents b1d011f + 0482c6e commit 0b66536
Show file tree
Hide file tree
Showing 256 changed files with 16,920 additions and 6,931 deletions.
1 change: 0 additions & 1 deletion .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
ignores:
- '@metamask/oss-attribution-generator'
- 'webpack-cli'
- '@react-native-community/datetimepicker'
- '@react-native-community/slider'
- 'patch-package'
- '@lavamoat/allow-scripts'
Expand Down
28 changes: 8 additions & 20 deletions .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
configurations: {
'ios.sim.apiSpecs': {
device: 'ios.simulator',
app: 'ios.debug',
app: 'ios.qa',
testRunner: {
args: {
"$0": "node e2e/api-specs/run-api-spec-tests.js",
Expand All @@ -41,10 +41,9 @@ module.exports = {
device: 'ios.simulator',
app: 'ios.release',
},
// because e2e run on debug mode in bitrise
'android.emu.bitrise.debug': {
device: 'android.bitrise.emulator',
app: 'android.bitrise.debug',
'ios.sim.qa': {
device: 'ios.simulator',
app: 'ios.qa',
},

'android.emu.debug': {
Expand Down Expand Up @@ -86,32 +85,21 @@ module.exports = {
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/MetaMask.app',
build: 'yarn start:ios:e2e',
},
'ios.release': {
'ios.qa': {
type: 'ios.app',
binaryPath:
'ios/build/Build/Products/Release-iphonesimulator/MetaMask.app',
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='production' yarn build:ios:release:e2e",
},
'android.bitrise.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk',
build: 'yarn start:android:e2e',
'ios/build/Build/Products/Release-iphonesimulator/MetaMask-QA.app',
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:ios:qa",
},
'android.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/prod/debug/app-prod-debug.apk',
build: 'yarn start:android:e2e',
},
'android.release': {
type: 'android.apk',
binaryPath:
'android/app/build/outputs/apk/prod/release/app-prod-release.apk',
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='production' yarn build:android:release:e2e",
},
'android.qa': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/qa/release/app-qa-release.apk',
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:android:qa:e2e",
build: "METAMASK_BUILD_TYPE='main' METAMASK_ENVIRONMENT='qa' yarn build:android:qa",
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ VERSION_BRANCHES=$(git branch -r | grep -o 'release/[0-9]*\.[0-9]*\.[0-9]*' | gr
VERSION_TAGS=$(git tag | grep -o 'v[0-9]*\.[0-9]*\.[0-9]*' | grep -o '[0-9]*\.[0-9]*\.[0-9]*' | sort --version-sort | tail -n 1)

# Get the version from package.json
VERSION_PACKAGE=$(node -p "require('./package.json').version")
VERSION_PACKAGE=$(node -p "require('../../package.json').version")

# Compare versions and keep the highest one
HIGHEST_VERSION=$(printf "%s\n%s\n%s" "$VERSION_BRANCHES" "$VERSION_TAGS" "$VERSION_PACKAGE" | sort --version-sort | tail -n 1)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/add-release-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: get-next-semver-version
env:
FORCE_NEXT_SEMVER_VERSION: ${{ vars.FORCE_NEXT_SEMVER_VERSION }}
run: ./scripts/get-next-semver-version.sh "$FORCE_NEXT_SEMVER_VERSION"
run: ./get-next-semver-version.sh "$FORCE_NEXT_SEMVER_VERSION"
working-directory: '.github/scripts'

- name: Add release label to PR and linked issues
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@ jobs:
bundler-cache: true
env:
BUNDLE_GEMFILE: ios/Gemfile
- name: Determine whether the current PR is a draft
id: set-is-draft
if: github.event_name == 'pull_request' && github.event.pull_request.number
run: echo "IS_DRAFT=$(gh pr view --json isDraft --jq '.isDraft' "${PR_NUMBER}")" >> "$GITHUB_OUTPUT"
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup registry config for using package previews on draft PRs
if: github.event_name == 'pull_request' && steps.set-is-draft.outputs.IS_DRAFT == 'true'
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
- name: Require clean working directory
shell: bash
Expand Down Expand Up @@ -179,14 +167,14 @@ jobs:
with:
name: ios-bundle
path: ios/main.jsbundle

ship-js-bundle-size-check:
runs-on: ubuntu-latest
needs: [js-bundle-size-check]
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4

- name: Download iOS bundle
uses: actions/download-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ android {
release {
manifestPlaceholders.isDebug = false
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro", "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro", "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules.pro"
}
}

Expand Down
1 change: 1 addition & 0 deletions app/actions/notification/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export enum notificationsErrors {
UPDATE_TRIGGER_PUSH_NOTIFICATIONS = 'Error while trying to update trigger push notifications',
ENABLE_NOTIFICATIONS_SERVICES = 'Error while trying to enable notifications services',
DISABLE_NOTIFICATIONS_SERVICES = 'Error while trying to disable notifications services',
DELETE_STORAGE_KEY = 'Error while trying to delete storage key',
}

export default notificationsErrors;
17 changes: 17 additions & 0 deletions app/actions/notification/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,20 @@ export const markMetamaskNotificationsAsRead = async (
return getErrorMessage(error);
}
};
/**
* Perform the deletion of the notifications storage key and the creation of on chain triggers to reset the notifications.
*
* @returns {Promise<string | undefined>} A promise that resolves to a string error message or undefined if successful.
*/
export const performDeleteStorage = async (): Promise<string | undefined> => {
try {
await Engine.context.UserStorageController.performDeleteStorage('notifications.notification_settings');
await Engine.context.NotificationServicesController.createOnChainTriggers(
{
resetNotifications: true,
},
);
} catch (error) {
return getErrorMessage(error);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const styleSheet = StyleSheet.create({
justifyContent: 'flex-start',
},
accountNameLabelText: {
marginLeft: 4,
paddingHorizontal: 8,
borderWidth: 1,
borderRadius: 8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ const AccountBase = ({

<View style={styles.accountNameLabel}>
<Text variant={TextVariant.BodyMDBold}>{accountName}</Text>
{accountTypeLabel && (
</View>
{accountTypeLabel && (
<View style={styles.accountNameLabel}>
<Text
variant={TextVariant.BodySM}
variant={TextVariant.BodyMDBold}
style={styles.accountNameLabelText}
>
{strings(accountTypeLabel)}
</Text>
)}
</View>
)}
</View>
</View>
<View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ exports[`CellSelectWithMenu should render with default settings correctly 1`] =
"alignItems": "center",
"backgroundColor": "#ffffff",
"flexDirection": "row",
"paddingRight": 20,
"width": "100%",
}
}
>
<TouchableOpacity
disabled={false}
style={
{
"flex": 1,
"opacity": 1,
"padding": 16,
"position": "relative",
"width": "90%",
"zIndex": 1,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ListItemMultiSelectButtonProps } from './ListItemMultiSelectButton.type
// Defaults
export const DEFAULT_LISTITEMMULTISELECT_GAP = 16;
export const BUTTON_TEST_ID = 'button-menu-select-test-id';
export const BUTTON_TEXT_TEST_ID = 'button-text-select-test-id';

// Sample consts
export const SAMPLE_LISTITEMMULTISELECT_PROPS: ListItemMultiSelectButtonProps =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const styleSheet = (params: {
return StyleSheet.create({
base: Object.assign(
{
flex: 1,
position: 'relative',
opacity: isDisabled ? 0.5 : 1,
padding: 16,
width: '90%',
zIndex: 1,
} as ViewStyle,
style,
Expand Down Expand Up @@ -71,10 +71,8 @@ const styleSheet = (params: {
backgroundColor: isSelected
? colors.primary.muted
: colors.background.default,
paddingRight: 20,
flexDirection: 'row',
alignItems: 'center',
width: '100%',
},
itemColumn: {
display: 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ exports[`ListItemMultiSelectButton should render correctly with default props 1`
"alignItems": "center",
"backgroundColor": "#ffffff",
"flexDirection": "row",
"paddingRight": 20,
"width": "100%",
}
}
>
<TouchableOpacity
disabled={false}
style={
{
"flex": 1,
"opacity": 1,
"padding": 16,
"position": "relative",
"width": "90%",
"zIndex": 1,
}
}
Expand Down
Loading

0 comments on commit 0b66536

Please sign in to comment.