Skip to content

Commit

Permalink
Merge branch 'main' into feature/ramp-deeplink-handler
Browse files Browse the repository at this point in the history
  • Loading branch information
wachunei authored Apr 19, 2024
2 parents 91a79b1 + 0922dd2 commit 3917eaa
Show file tree
Hide file tree
Showing 152 changed files with 3,479 additions and 875 deletions.
3 changes: 3 additions & 0 deletions .github/guidelines/LABELING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Every PR shall include one the QA labels below:
Once PR has been tested by QA (only if the PR was labeled with `needs-qa`):
- **QA Passed**: If the PR was labeled with `needs-qa`, this label must be added once QA has signed off

### Optional labels:
- **regression-develop**: This label can manually be added to a bug report issue at the time of its creation if the bug is present on development branch (i.e. `main`), but is not yet released in production.

### Labels prohibited when PR needs to be merged:
Any PR that includes one of the following labels can not be merged:

Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/crowdin-branch-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Crowdin - Branch and Label Cleanup for merged localization PR
# This action should delete the branch from Crowdin after the localization PR is
# merged to the original branch. It should also remove the "ready-for-translation" label

# TODO: Add trigger for merge of localization PR.
on: workflow_dispatch

jobs:
prestep:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_current_branch.outputs.branch }}
pr: ${{ steps.get-prs.outputs.pr }}
steps:
- name: Extract current branch name
shell: bash
run: |
echo "running on branch ${GITHUB_REF##*/}"
echo "other version: ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_OUTPUT"
id: extract_current_branch

- name: Get PR with Label for this branch
id: get-prs
run: |
LABEL="ready-for-translation"
API_URL="https://api.github.com/repos/Metamask/crowdin-sandbox/pulls?head:${{steps.extract_current_branch.outputs.branch}}&state=open&per_page=100"
# Fetch the list of open pull requests with the specified label using curl
PRS=$(curl -sS --header "Authorization: Bearer $GITHUB_TOKEN" "$API_URL")
PR=$(echo "$PRS" | jq -r '.[] | select(.labels[].name == "'"$LABEL"'") | .number | @json')
echo "Found PR: $PR"
echo "pr=$PR" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURRENT_BRANCH: ${{ steps.extract_current_branch.outputs.branch }}

github_cleanup:
runs-on: ubuntu-latest
needs: prestep
steps:
- name: Remove label from PR
uses: actions/github-script@v3
if: needs.prestep.outputs.pr != null || needs.prestep.outputs.pr != ''
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const label = "ready-for-translation";
await github.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ needs.prestep.outputs.pr }},
name: label
});
crowdin_cleanup:
runs-on: ubuntu-latest
needs: prestep
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ needs.prestep.outputs.branch }}

- name: Delete branch within Crowdin
if: needs.prestep.outputs.branch != 'main'
uses: crowdin/github-action@c953b17499daa6be3e5afbf7a63616fb02d8b18d
with:
command: branch delete ${{ needs.prestep.outputs.branch }}
command_args: -v
50 changes: 50 additions & 0 deletions .github/workflows/crowdin-branch-pr-ready-for-translation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Crowdin - Ready for translations label added, push to crowdin

# When an individual is working on a feature which requires translations, they can
# add a label "ready-for-translation" which will trigger this action to push the
# source and translation files to Crowdin. We will always push main as the base of
# the crowdin branch creation and then push in the changes over the top. This ensures
# that the translations which have already been done and approved previously do not
# show as needing to be translated again in the crowdin branch.

# TODO: switch to trigger on label add once testing complete
on: workflow_dispatch

jobs:
crowdin-upload:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

steps:
- name: Extract current branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_OUTPUT"
id: extract_current_branch

- name: Checkout
uses: actions/checkout@v3
with:
ref: main

- name: Crowdin push main as baseline
uses: crowdin/github-action@c953b17499daa6be3e5afbf7a63616fb02d8b18d
with:
crowdin_branch_name: ${{ steps.extract_current_branch.outputs.branch }}
upload_sources: true
upload_translations_args: --import-eq-suggestions --auto-approve-imported --verbose
upload_translations: true

- name: Checkout Branch and push to crowdin
uses: actions/checkout@v3
with:
ref: ${{ steps.extract_current_branch.outputs.branch }}
- name: Crowdin sources push
uses: crowdin/github-action@c953b17499daa6be3e5afbf7a63616fb02d8b18d
with:
crowdin_branch_name: ${{ steps.extract_current_branch.outputs.branch }}
upload_sources: true
upload_sources_args: --auto-update --verbose
upload_translations: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Crowdin - Find all branches with translations and trigger completion checks
# This workflow will run on a schedule. It will pull all pull requests with a label of
# ready-for-translation and create a matrix of the associated branches to run the
# crowdin-reusable-translation-download.yml workflow on.
# That workflow will check the status of the translations and if complete create a pull
# request with the translations off of the branch.

permissions:
contents: write
pull-requests: write

# TODO: Add a schedule to run this workflow twice a day(?) once the testing is complete
on: workflow_dispatch

jobs:
run-check-and-download-for-branch:
needs: get-branches
if: ${{ needs.get-branches.outputs.matrix != '[]' && needs.get-branches.outputs.matrix != '' }}
strategy:
fail-fast: false
matrix:
branch: ${{fromJson(needs.get-branches.outputs.matrix)}}
uses: ./.github/workflows/crowdin-reusable-translation-download.yml
with:
branch: ${{ matrix.branch }}
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
crowdin_personal_token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
crowdin_project_id: ${{ secrets.CROWDIN_PROJECT_ID }}

get-branches:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix-outputs.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Get Branches with Label
id: get-branches
run: |
GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}"
LABEL="ready-for-translation"
API_URL="https://api.github.com/repos/Metamask/crowdin-sandbox/pulls?state=open&per_page=100"
# Fetch the list of open pull requests with the specified label using curl
PRS=$(curl -sS --header "Authorization: Bearer $GITHUB_TOKEN" "$API_URL")
BRANCHES=$(echo "$PRS" | jq -r '[.[] | select(.labels[].name == "'"$LABEL"'") | .head.ref] | @json')
echo "Found branches: $BRANCHES"
echo "branches=$BRANCHES" >> "$GITHUB_OUTPUT"
- name: Set up matrix
id: matrix-outputs
run: |
# Parse the branches output and create a matrix
BRANCHES="${{ toJson(steps.get-branches.outputs.branches) }}"
echo "Creating matrix from branches..."
MATRIX="${BRANCHES}"
echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT"
64 changes: 64 additions & 0 deletions .github/workflows/crowdin-reusable-translation-download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Crowdin - Check translation progress and download if complete (unless main)
# This is a reusable workflow that is called by crowdin-pull-branch-pr-completed-translations
# across all branches which have a label of "ready-for-translation" aka being translated.
# This workflow will check the translation progress and download the translations if
# they are 100% translated. If the branch that is running this is main it will skip completion
# check and just pull whatever translations are available.


permissions:
contents: write
pull-requests: write

on:
workflow_call:
inputs:
branch:
required: true
type: string
secrets:
gh_token:
required: true
crowdin_project_id:
required: true
crowdin_personal_token:
required: true

jobs:
crowdin:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.gh_token }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.crowdin_personal_token }}
CROWDIN_PROJECT_ID: ${{ secrets.crowdin_project_id }}

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}

- name: Check translation progress
# when main just pull whatever you have (aka skip this) - need to test
if: ${{ inputs.branch != 'main' }}
uses: crowdin/github-action@c953b17499daa6be3e5afbf7a63616fb02d8b18d
with:
command: 'status translation'
command_args: '-b ${{ inputs.branch }} --fail-if-incomplete'

- name: Synchronize with Crowdin
uses: crowdin/github-action@c953b17499daa6be3e5afbf7a63616fb02d8b18d
with:
crowdin_branch_name: ${{ inputs.branch }}
upload_sources: false
upload_translations: false
download_translations: true
skip_untranslated_strings: true
export_only_approved: true
localization_branch_name: l10n_crowdin_translations_${{ inputs.branch }}

create_pull_request: true
skip_ref_checkout: true
pull_request_title: New Crowdin translations for ${{ inputs.branch }}
pull_request_body: New Crowdin pull request with translations for ${{ inputs.branch }}
pull_request_base_branch_name: ${{ inputs.branch }}
31 changes: 31 additions & 0 deletions .github/workflows/crowdin-upload-both-sources-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Crowdin - Upload Both Sources and Translations Crowdin Action
# This action is intended to ensure our main branch on crowdin is in sync with our
# main branch on github and will run on every push to main that has changes to any
# locales files.

# TODO: Change to trigger on merge to main when locales files are changed (after testing)
# This should replace the current crowdin_action.yml file (after testing)
on: workflow_dispatch

jobs:
crowdin-upload:
runs-on: ubuntu-latest
steps:
- name: Extract current branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_OUTPUT"
id: extract_current_branch
- name: Checkout
uses: actions/checkout@v3

- name: Crowdin push
uses: crowdin/github-action@c953b17499daa6be3e5afbf7a63616fb02d8b18d
with:
crowdin_branch_name: ${{ steps.extract_current_branch.outputs.branch }}
upload_sources: true
upload_translations: true
upload_translations_args: --import-eq-suggestions --auto-approve-imported --verbose
download_translations: false
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,62 @@

## Current Main Branch

## 7.20.0 - Apr 1, 2024
### Added
- [#8982](https://github.com/MetaMask/metamask-mobile/pull/8982): feat: Update gas fee controller to version 6.1.2
- [#9079](https://github.com/MetaMask/metamask-mobile/pull/9079): feat: Update controller utils to 5.0.2
- [#9036](https://github.com/MetaMask/metamask-mobile/pull/9036): feat: Adding blockaid validations for sepolia network
- [#8668](https://github.com/MetaMask/metamask-mobile/pull/8668): feat: PPOM Version update to download files only before transaction
- [#8720](https://github.com/MetaMask/metamask-mobile/pull/8720): feat: migrate to native primary currency
- [#8989](https://github.com/MetaMask/metamask-mobile/pull/8989): feat: Signature Controller v5.3.1
- [#8759](https://github.com/MetaMask/metamask-mobile/pull/8759): feat: Accounts controller integration
- [#9007](https://github.com/MetaMask/metamask-mobile/pull/9007): feat: Assets controller updated to version 12.0.0
- [#9005](https://github.com/MetaMask/metamask-mobile/pull/9005): feat: Update network controller to version 12.2.0
- [#8920](https://github.com/MetaMask/metamask-mobile/pull/8920): feat: add the 'eth_phishing_detection' logic to the connect accounts flow
- [#8952](https://github.com/MetaMask/metamask-mobile/pull/8952): feat: Network Controller update to v12.1.2
- [#8981](https://github.com/MetaMask/metamask-mobile/pull/8981): feat: Minor update of phishing-controller
- [#8986](https://github.com/MetaMask/metamask-mobile/pull/8986): feat: Updated Assets Controllers to v11.1.0

### Changed
- [#8967](https://github.com/MetaMask/metamask-mobile/pull/8967): chore: Handle async migrations & add migration tests
- [#8826](https://github.com/MetaMask/metamask-mobile/pull/8826): refactor: update Ledger connection instructions
- [#9038](https://github.com/MetaMask/metamask-mobile/pull/9038): chore: Consolidate and simplify isTest condition
- [#9094](https://github.com/MetaMask/metamask-mobile/pull/9094): test: stabilize swaps e2e tests
- [#9069](https://github.com/MetaMask/metamask-mobile/pull/9069): test: clean up detox build/run scripts
- [#9078](https://github.com/MetaMask/metamask-mobile/pull/9078): chore: Sentry reduce traceSample rate to 0.04
- [#9039](https://github.com/MetaMask/metamask-mobile/pull/9039): refactor(ramp): persist and format amount in build quote view
- [#9033](https://github.com/MetaMask/metamask-mobile/pull/9033): Revert "feat: migrate to native primary currency (#8720)"
- [#8918](https://github.com/MetaMask/metamask-mobile/pull/8918): ci: Simplify PR template
- [#9008](https://github.com/MetaMask/metamask-mobile/pull/9008): chore(ramp): upgrade sdk to 1.26.8
- [#7591](https://github.com/MetaMask/metamask-mobile/pull/7591): chore(deps-dev): bump @babel/traverse from 7.22.6 to 7.23.2 in /ppom
- [#8842](https://github.com/MetaMask/metamask-mobile/pull/8842): ci: Create Bitrise status check for commits
- [#8990](https://github.com/MetaMask/metamask-mobile/pull/8990): chore: Remove unnecessary react native animate fox patch
- [#8987](https://github.com/MetaMask/metamask-mobile/pull/8987): chore: adding code owner for confirmation domain's code
- [#8675](https://github.com/MetaMask/metamask-mobile/pull/8675): refactor: Refactor inpage blocklist to avoid usage of regex
- [#8959](https://github.com/MetaMask/metamask-mobile/pull/8959): chore: Migrate another (3/3) batch of unit tests away from enzyme

### Fixed
- [#9000](https://github.com/MetaMask/metamask-mobile/pull/9000): fix: Revert "test: [android] run tests on the first emulator in your list …
- [#8998](https://github.com/MetaMask/metamask-mobile/pull/8998): fix: Revert "fix: hardcode emulator name to fix failing android tests on C…
- [#8995](https://github.com/MetaMask/metamask-mobile/pull/8995): fix: hardcode emulator name to fix failing android tests on CI
- [#9023](https://github.com/MetaMask/metamask-mobile/pull/9023): fix: improve SVG Validation and Error Handling in AvatarFavicon Component
- [#9001](https://github.com/MetaMask/metamask-mobile/pull/9001): fix: (#8617): Reduce enzyme usage in unit test by 25% - [2/3] (#8823)
- [#9013](https://github.com/MetaMask/metamask-mobile/pull/9013): fix: isEIP1559 is undefined migration 29 issue
- [#8980](https://github.com/MetaMask/metamask-mobile/pull/8980): fix: analytics on Account Right Button analytics
- [#8991](https://github.com/MetaMask/metamask-mobile/pull/8991): fix: add Referer to Dapp Viewed events
- [#8977](https://github.com/MetaMask/metamask-mobile/pull/8977): fix: Remove wallet connect and sdk connect prefix from ppom domain
- [#9080](https://github.com/MetaMask/metamask-mobile/pull/9080): fix: check for preferences controller in 036 migration
- [#8751](https://github.com/MetaMask/metamask-mobile/pull/8751): fix: removes addSubjectMetadata and improves Snaps Execution Environment Webview origin restriction.
- [#9082](https://github.com/MetaMask/metamask-mobile/pull/9082): fix: Check for missing identities on migration 36
- [#9031](https://github.com/MetaMask/metamask-mobile/pull/9031): fix: Remove prefix from origin before sending request to ppom
- [#9066](https://github.com/MetaMask/metamask-mobile/pull/9066): fix: dedupe dependencies
- [#9051](https://github.com/MetaMask/metamask-mobile/pull/9051): fix: Remove duplicate i18n, en key: `qr_hardware`
- [#9053](https://github.com/MetaMask/metamask-mobile/pull/9053): fix: update ppom npm package to version 1.4.5
- [#9042](https://github.com/MetaMask/metamask-mobile/pull/9042): fix: Refactor SDK initialization
- [#8975](https://github.com/MetaMask/metamask-mobile/pull/8975): fix: remove call to private/internal methods from the `@metamask/keyring-controller`
- [#9021](https://github.com/MetaMask/metamask-mobile/pull/9021): fix: Network not updating when changing account connected the first time on a DAPP
- [#8932](https://github.com/MetaMask/metamask-mobile/pull/8932): fix: breaking change from `@metamask/transaction-controller` regarding Ledger transactions

## 7.19.1 - Apr 10, 2024
### Fixed
- [#9193](https://github.com/MetaMask/metamask-mobile/pull/9193): fix(ramp): default networks state to array
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1306
versionName "7.19.1"
versionCode 1308
versionName "7.20.0"
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy 'react-native-camera', 'general'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export const BADGE_BADGENETWORK_TEST_ID = 'badge-badgenetwork';
export const BADGE_BADGESTATUS_TEST_ID = 'badge-badgestatus';
export const BADGE_BADGENOTIFICATIONS_TEST_ID = 'badge-badgenotifications';
Loading

0 comments on commit 3917eaa

Please sign in to comment.