Skip to content

Conversation

@ixf
Copy link
Contributor

@ixf ixf commented May 28, 2025

Description

This creates a Bitrise pipeline for creating flask builds.

Changes made:

  • build:ios:flask:local and build:android:flask:local is used by Bitrise for generating Flask Expo prebuild in CI
  • Added Flask development provisioning profile
  • generateIosBinary selects the correct plist

Related issues

Fixes: #15563

Manual testing steps

  1. Go to bitrise, make a new build from this branch using expo_flask_pipeline
  2. Verify that there are 4 artifacts - main .apk, test .apk, .ipa and .app
  3. Install .apk on Android emulator, verify that the Flask target is installed
  4. Install .ipa and .app on iOS simulator and device, verify that the Flask target is installed
  5. yarn watch and run the app

For reference here's the latest bitrise build of this pipeline:
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/be69d047-60ea-400d-8a39-4153f0d85f84

Screenshots/Recordings

After

Installing .ipa and .apk

flask-installs.mov

Pre-merge author checklist

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.

@github-actions
Copy link
Contributor

github-actions bot commented May 28, 2025

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.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 28, 2025
@ixf
Copy link
Contributor Author

ixf commented May 28, 2025

I have read the CLA Document and I hereby sign the CLA

@ixf ixf force-pushed the swmansion/feat-expo-flask-prebuilds branch from 2655520 to 6065345 Compare May 30, 2025 15:06
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.97%. Comparing base (f6f4594) to head (c6505c4).
Report is 51 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15792      +/-   ##
==========================================
+ Coverage   69.58%   69.97%   +0.38%     
==========================================
  Files        2473     2530      +57     
  Lines       53007    54023    +1016     
  Branches     8063     8309     +246     
==========================================
+ Hits        36886    37800     +914     
- Misses      13752    13784      +32     
- Partials     2369     2439      +70     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ixf ixf force-pushed the swmansion/feat-expo-flask-prebuilds branch 4 times, most recently from 09c285c to 52c28d6 Compare June 10, 2025 11:45
@ixf ixf force-pushed the swmansion/feat-expo-flask-prebuilds branch from 52c28d6 to 6595493 Compare June 10, 2025 14:23
@Cal-L Cal-L changed the title feat: Add the expo flash pipeline feat: Add the expo flask pipeline Jun 11, 2025
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

left a comment

@Cal-L Cal-L mentioned this pull request Jun 12, 2025
7 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2025

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: 58d1a04
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/03f07dc8-8917-432b-a8d9-4000ed607ceb

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

Added comments for context

@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 1f482bb
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/4b2ada34-0635-4f5c-8ecb-c204644b71c9

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@Cal-L Cal-L added No E2E Smoke Needed and removed INVALID-PR-TEMPLATE PR's body doesn't match template Run Smoke E2E labels Jul 9, 2025
@Cal-L
Copy link
Contributor

Cal-L commented Jul 9, 2025

E2E passed already, just resolved conflict from main

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Android Build Script Issues

The scripts/build.sh script introduces two issues in Android builds:

  1. The buildAndroidDevBuild function no longer sources environment variables from .android.env when PRE_RELEASE is true, as the sourcing logic in prebuild_android is now conditional on PRE_RELEASE being false. This can lead to build failures.
  2. Both buildAndroidDevBuild and the newly added buildAndroidFlaskLocal functions are missing the -DtestBuildType=debug parameter when building their respective AndroidTest APKs (assembleProdDebugAndroidTest and assembleFlaskDebugAndroidTest). This omission breaks consistency with other test builds and may cause build or test failures.

scripts/build.sh#L286-L299

buildAndroidDevBuild(){
prebuild_android
# Generate both APK (for development) and test APK (for E2E testing)
cd android && ./gradlew assembleProdDebug assembleProdDebugAndroidTest --build-cache --parallel && cd ..
}
# Builds the Flask APK for local development
buildAndroidFlaskLocal(){
prebuild_android
# Generate both APK (for development) and test APK (for E2E testing)
cd android && ./gradlew assembleFlaskDebug assembleFlaskDebugAndroidTest --build-cache --parallel && cd ..

Fix in CursorFix in Web


Bug: Build Function Directory Inconsistency

The buildIosFlaskLocal function changes to the ios directory but does not return, which is inconsistent with other build functions and can cause subsequent operations to run from the wrong directory. Additionally, the remapFlaskEnvVariables call was removed from buildIosFlaskRelease to rely on a new global call for Flask modes. This creates an inconsistency where Android Flask release builds may still have a redundant remapFlaskEnvVariables call, leading to it being executed twice for Android but only once for iOS, potentially causing unexpected environment variable behavior.

scripts/build.sh#L460-L471

buildIosFlaskLocal() {
prebuild_ios
# Go to ios directory
cd ios
# Generate a Flask debug .ipa for local
generateIosBinary "MetaMask-Flask" "Debug"
}
buildIosFlaskRelease(){
prebuild_ios

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 9, 2025

@Cal-L
Copy link
Contributor

Cal-L commented Jul 9, 2025

All cursor comments are expected. The Expo prebuild configuration is most up-to-date. Other configurations will be updated in follow up PRs

@Cal-L Cal-L added this pull request to the merge queue Jul 9, 2025
@github-project-automation github-project-automation bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Jul 9, 2025
Merged via the queue into main with commit 8b382ea Jul 9, 2025
56 checks passed
@Cal-L Cal-L deleted the swmansion/feat-expo-flask-prebuilds branch July 9, 2025 23:05
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2025
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jul 9, 2025
@metamaskbot metamaskbot added the release-7.52.0 Issue or pull request that will be included in release 7.52.0 label Jul 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

external-contributor No QA Needed Apply this label when your PR does not need any QA effort. no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.52.0 Issue or pull request that will be included in release 7.52.0 team-mobile-platform Mobile Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Add Expo Prebuilds for Flask Environment

6 participants