ci(MMQA-1667): skip native builds when PR only changes E2E/performance tests#33180
Conversation
When a PR only changes E2E or performance test files, CI still runs Smart E2E Selection and the selected test suites, but reuses the latest matching iOS/Android artifacts from main instead of compiling fresh native builds. Performance PR workflows also resolve existing BrowserStack apps instead of triggering new Android builds. Adds test-only change detection in get-requirements, a native_build_needed output, main-branch-only reuse in find-reusable-build, and unit tests for the platform flag decision logic. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
get-requirements runs before yarn install, so esbuild-register was not available. Move platform flag logic to plain CommonJS that runs with node only. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
Address CodeQL finding by validating app_url and custom_id against strict allowlists before persisting network data to the GitHub Actions output file. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
Test-only PRs were fingerprinting the PR merge tree, so find-reusable-build could not match completed main branch runs. Compute the fingerprint from main, relax metadata requirements for test-only reuse, and fall back to the main APK cache on Android. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 615857d. Configure here.
When reuse-main-builds-only is active, force-builds should compile fresh instead of failing because no main artifact was found. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
…ceful fallback - Encode branch slug in BrowserStack custom_id uploads and resolve only main-prefixed apps for test-only performance E2E reuse - Use native_build_needed == 'false' for reuse mode (fail-safe default) - Fall back to fresh native build when main artifacts are not ready yet - Document race window and BrowserStack main-only resolution Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
⚡ Performance Test Results
❌ 5 tests failed · 20 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ❌ Failed Tests (5)@swap-bridge-dev-team
@metamask-mobile-platform
@metamask-onboarding-team
@mm-perps-engineering-team
✅ Passed Tests (15)
Branch: |
test:unit only matches .github/**/*.test.ts; rename the two new browserstack and e2e-platform-flags tests so they run in CI. Co-authored-by: javiergarciavera <javiergarciavera@users.noreply.github.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Since these are CI workflow files ( All E2E smoke tags are selected because:
No performance tests are selected because no app code was changed — only CI infrastructure was modified, and performance tests measure app behavior, not CI pipeline behavior. Performance Test Selection: |
🧪 Flaky unit test detectionRun history flaky detectionHistorical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow. Failures / runs sampled per window:
AI-detected flaky patterns
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #33180 +/- ##
==========================================
- Coverage 84.28% 84.28% -0.01%
==========================================
Files 6064 6067 +3
Lines 161494 161636 +142
Branches 39385 39432 +47
==========================================
+ Hits 136121 136234 +113
- Misses 15995 16001 +6
- Partials 9378 9401 +23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|




Description
PRs that only touch E2E or performance test files currently trigger full iOS and Android native builds even though the app binary does not change. This adds test-only change detection so CI still runs Smart E2E Selection (including performance tag selection), but reuses the latest matching builds from
maininstead of compiling fresh native artifacts.an example where the PR only touches test files and does not create builds for e2e, but reuse ones from main can be seen in
#33188
What changed
.github/rules/filter-rules.yml: newe2e_test_filesande2e_test_or_ignorablefilters for smoke/regression/performance test paths and shared E2E infra..github/workflows/get-requirements.yml: newnative_build_neededoutput; test-only PRs setnative_build_needed=falsewhile keeping E2E + Smart selection enabled..github/actions/find-reusable-build:main-branch-onlymode to search only the base branch when reusing builds..github/workflows/build-android-e2e.yml/build-ios-e2e.yml:reuse-main-builds-onlyinput skips repack and fails fast if no main artifact is found..github/workflows/ci.yml: wiresnative_build_neededinto E2E and performance build jobs..github/workflows/run-performance-e2e.yml: skips fresh BrowserStack Android builds on test-only PRs and resolves the latest uploaded apps via BrowserStack API..github/guidelines/E2E_DECISION_TREE.md: documents the new test-only path.force-buildslabel /[force-builds]commit tag still forces fresh native builds.Changelog
CHANGELOG entry: null
Related issues
Fixes: MMQA-1667
Manual testing steps
N/A for on-device manual QA — CI workflow change only. Validated locally with
compute-e2e-platform-flagsunit tests and therun-compute-e2e-platform-flagsGitHub Actions entrypoint.Screenshots/Recordings
N/A — CI infrastructure change with no UI impact.
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist