Skip to content

Conversation

@Cal-L
Copy link
Contributor

@Cal-L Cal-L commented Oct 22, 2025

Description

This change aims to resolve some bottlenecks associated with hardcoded environment build types and environments especially when running the watcher locally. This is causing much confusion since devs have reported that METAMASK_BUILD_TYPE and METAMASK_ENVIRONMENT is not being picked up when switching between variants such as main and flask. Furthermore, these issues impacts E2E as well (especially flask build setup), which continues to introduce friction as CI continues to migrate to Github CI.

Changelog

CHANGELOG entry:

Related issues

Fixes: #21682

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

watcher mode with both METAMASK_BUILD_TYPE and METAMASK_ENVIRONMENT specified
image

watcher mode without METAMASK_BUILD_TYPE and METAMASK_ENVIRONMENT
image

using start:ios, which hardcodes platform=ios, buildtype=main, environment=dev
image

using test:e2e:android:flask:build, which hardcodes platform=android, buildtype=flask, environment=e2e
image

expo_dev_pipeline - https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a9dc5979-790d-411c-b823-f3295abb9d28

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.

Note

Unifies E2E build/run across scripts, Detox, Bitrise, and docs with dynamic Debug/Release via CONFIGURATION, prebuilt artifact support, new iOS/Flask CI configs, and removal of legacy workflows.

  • Build system:
    • Refactor scripts/build.sh to source METAMASK_BUILD_TYPE/METAMASK_ENVIRONMENT (except watcher), validate inputs, and print unified titles.
    • Add generateAndroidBinary for flavor/config builds; remove legacy per-variant dev/E2E builders; standardize Sentry property handling.
  • CI (Bitrise):
    • Standardize Android/iOS build steps to use COMMAND_YARN and CONFIGURATION (Debug/Release); add/share intermediate artifacts; adjust renaming/deploy steps.
    • Add explicit CONFIGURATION='Release' to main Android workflows; simplify build scripts; remove deprecated Flask QA/beta paths and redundant workflows.
    • Update E2E runners to call yarn test:e2e:*:$METAMASK_BUILD_TYPE:ci; improve caching and artifact sharing.
  • Detox:
    • Enable prebuilt binary paths via env for all apps; export CONFIGURATION in build commands.
    • Switch ios.sim.main.ci to ios.main.release; add ios.sim.flask.ci.
    • Reorder Android app configs; add testBinaryPath support.
  • NPM scripts (package.json):
    • Simplify watch scripts; remove start-e2e variants.
    • Add test:e2e:ios:flask:ci; set BRIDGE_USE_DEV_APIS=true for Flask E2E builds; add build:android:checksum:prod.
  • Docs:
    • Update E2E guide to emphasize sourcing .e2e.env, watcher usage, and hardcoded build types; revise Flask sections to use test:e2e:*:flask:* commands and troubleshooting.
  • CODEOWNERS:
    • Add ownership for app/core/DeeplinkManager, scripts/build.sh, and handlePerpsUrl.ts under Perps.

Written by Cursor Bugbot for commit cb8faa3. This will update automatically on new commits. Configure here.

@github-actions
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.

@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label Oct 22, 2025
cursor[bot]

This comment was marked as outdated.

@Cal-L Cal-L force-pushed the chore/respect-js-env-build-variants branch from 98316be to 27c4a6f Compare October 22, 2025 16:31
@github-actions github-actions bot added size-S and removed size-M labels Oct 22, 2025
@Cal-L Cal-L added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Oct 22, 2025
@github-project-automation github-project-automation bot moved this to Needs dev review in PR review queue Oct 22, 2025
@Cal-L Cal-L added needs-qa Any New Features that needs a full manual QA prior to being added to a release. no changelog required No changelog entry is required for this change no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed and removed no changelog required No changelog entry is required for this change labels Oct 22, 2025
@christopherferreira9 christopherferreira9 added the run-android-flask-e2e-smoke Run Android flask E2E tests on next CI run label Oct 22, 2025
@Cal-L Cal-L requested a review from a team as a code owner October 27, 2025 20:47
@github-actions github-actions bot added size-L and removed size-S labels Oct 27, 2025
cursor[bot]

This comment was marked as outdated.

@Cal-L Cal-L changed the title chore: Prioritize build type and environment from js env for build.sh chore: Consolidate E2E commands and enable dynamic debug/release configuration for Android Oct 28, 2025
@Cal-L Cal-L changed the title chore: Consolidate E2E commands and enable dynamic debug/release configuration for Android chore: Consolidate E2E commands and enable dynamic debug/release configuration for Android Oct 28, 2025
cursor[bot]

This comment was marked as outdated.

@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.07%. Comparing base (744b8ce) to head (cb8faa3).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21530      +/-   ##
==========================================
+ Coverage   77.04%   77.07%   +0.02%     
==========================================
  Files        3765     3767       +2     
  Lines       95826    95853      +27     
  Branches    18616    18622       +6     
==========================================
+ Hits        73833    73874      +41     
+ Misses      16918    16906      -12     
+ Partials     5075     5073       -2     

☔ 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.

cursor[bot]

This comment was marked as outdated.

jvbriones
jvbriones previously approved these changes Oct 30, 2025
@Cal-L Cal-L force-pushed the chore/respect-js-env-build-variants branch from 06828ff to cb8faa3 Compare October 31, 2025 04:23
@sonarqubecloud
Copy link

@Cal-L Cal-L added this pull request to the merge queue Oct 31, 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 Oct 31, 2025
Merged via the queue into main with commit 4d9c9af Oct 31, 2025
88 of 89 checks passed
@Cal-L Cal-L deleted the chore/respect-js-env-build-variants branch October 31, 2025 19:47
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2025
@github-actions github-actions bot removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Oct 31, 2025
@metamaskbot metamaskbot added the release-7.59.0 Issue or pull request that will be included in release 7.59.0 label Oct 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.59.0 Issue or pull request that will be included in release 7.59.0 run-android-flask-e2e-smoke Run Android flask E2E tests on next CI run size-L team-mobile-platform Mobile Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Improve bottlenecks in build configuration related to switching build type and environment

7 participants