Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New mobile Flask Build Type #7837

Merged
merged 44 commits into from
Nov 28, 2023
Merged

feat: New mobile Flask Build Type #7837

merged 44 commits into from
Nov 28, 2023

Conversation

owencraston
Copy link
Contributor

@owencraston owencraston commented Nov 15, 2023

Description

This change enables a new build type for MetaMask mobile. This new build is called flask and will be used for the canary distribution of features, namely snaps. These builds will be distributed through the google play store as a new app listing on android, and through tetsflight on iOS. These builds already exist through the work of mobile snaps. This PR pulls in the non snaps related code for creating these builds. The end result is new "flavour" of metamask, that is identical to the main build. Once we merge code fencing into main, we can then start merging snaps code into then flask build without effecting the main build.

  • Most of this work was already implemented and reviewed in this PR. We are now updating it and bringing it into main.

Bitrise

  • Flask Bitrise build
    • Passed. We expect the deploy android to store to fail since we need Dan Finlay to help us setup the last part of the pipeline. APKS and IPA are present in the artifacts and iOS has been uploaded to testflight.
Screenshot 2023-11-21 at 6 09 37 PM

Testflight

Main build

  • I created a test production release to verify that these changes do not effect production releases. You can test this out on Testflight v7.12.1 1213.
RPReplay_Final1700791919.MP4

Flask Build

  • version 0.0.4 1212
  • This build is available for testing through testflight
  • the app is correctly built and everything is working
  • the proper code fencing (flask) has been applied
RPReplay_Final1700780718.MP4

Related issues

Progresses: https://github.com/MetaMask/accounts-planning/issues/143

Manual testing steps iOS

  1. checkout this PR and run yarn setup
  2. run yarn watch:clean
  3. open the app in Xcode
  4. click the drop down menu with the orange fox (pictured below) and select MetaMask-Flask as your new variant
  5. click build (play button)
  6. you can also run flask with yarn run start:ios:flask
  7. the app should build on the emulator with the purple fox icon and the name MetaMask Flask
  8. open the app and create a wallet
  9. the app should function normally

Manual testing steps Android

  1. checkout this PR and run yarn setup
  2. run yarn watch:clean
  3. open the app in android studio
  4. open the build variants through View/Tool window/Variants
Screenshot 2023-11-15 at 6 12 10 PM
  1. In the build variant tab, open the app variants and select flaskDebug
Screenshot 2023-11-15 at 6 14 22 PM
  1. now click the green build button
  2. you can also run flask with yarn run start:android:flask
  3. the app should build on the emulator with the purple fox icon and the name MetaMask Flask
  4. open the app and create a wallet
  5. the app should function normally

Screenshots/Recordings

Android

283299619-024d0e9f-3506-441e-a097-9c0114b351c3

iOS

283295309-3705e04a-52f4-4912-a77f-efa6aa6732a4

Screenshot 2023-11-15 at 5 41 33 PM Screenshot 2023-11-15 at 5 41 46 PM

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (b58f4f6) 37.44% compared to head (9f8bb52) 37.46%.

Files Patch % Lines
app/util/sentry/utils.js 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7837      +/-   ##
==========================================
+ Coverage   37.44%   37.46%   +0.02%     
==========================================
  Files        1052     1052              
  Lines       28192    28202      +10     
  Branches     2517     2517              
==========================================
+ Hits        10556    10566      +10     
  Misses      17037    17037              
  Partials      599      599              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Nov 16, 2023
@owencraston owencraston marked this pull request as ready for review November 16, 2023 02:16
@owencraston owencraston requested a review from a team as a code owner November 16, 2023 02:16
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/eb8499b8-c6f5-4604-a873-8a273a776b6c
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

android/app/build.gradle Outdated Show resolved Hide resolved
@owencraston owencraston changed the title [Feat]: New mobile Flask Build Type feat: New mobile Flask Build Type Nov 16, 2023
scripts/build.sh Outdated Show resolved Hide resolved
scripts/build.sh Outdated Show resolved Hide resolved
@wachunei
Copy link
Member

From a general point of view, Flask build should point to Dev/Test/Staging or Production services, eg: swaps, ramp?

Copy link
Member

@gantunesr gantunesr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor comments

app/util/sentry/sentryUtils.test.ts Outdated Show resolved Hide resolved
scripts/build.sh Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
ios/MetaMask/MetaMask-Flask-Info.plist Show resolved Hide resolved
ios/MetaMask/MetaMask-Flask-Info.plist Show resolved Hide resolved
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8384a612-ea83-45a2-8f14-44581c9f85ef
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@owencraston
Copy link
Contributor Author

@wachunei as clarified on slack, we want to have all the ramps environments pointing to the same production end point when flask is released to stores.

Copy link

socket-security bot commented Nov 17, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Copy link

socket-security bot commented Nov 17, 2023

No top level dependency changes detected. Learn more about Socket for GitHub ↗︎

@owencraston
Copy link
Contributor Author

yarn run start:ios:flask is working ✅

Screenshot 2023-11-21 at 11 38 30 AM

@owencraston owencraston force-pushed the flask-build-type branch 2 times, most recently from 4e46766 to 5689076 Compare November 21, 2023 22:51
Jonathansoufer
Jonathansoufer previously approved these changes Nov 28, 2023
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

25.5% 25.5% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@owencraston owencraston merged commit 3d8c5b6 into main Nov 28, 2023
26 checks passed
@owencraston owencraston deleted the flask-build-type branch November 28, 2023 21:05
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2023
@metamaskbot metamaskbot added the release-7.13.0 Issue or pull request that will be included in release 7.13.0 label Nov 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-7.13.0 Issue or pull request that will be included in release 7.13.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants