Skip to content

Commit

Permalink
temp+fix: Fix/10812 redundant source map upload (#11993)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR introduces two new workflows in Bitrise
- `build_android_release_and_upload_sourcemaps` - Runs
`build_android_release` and uploads sourcemaps to Sentry
- `build_ios_release_and_upload_sourcemaps` - Runs `build_ios_release`
and uploads sourcemaps to Sentry

By default, both `build_android_release` and `build_ios_release` will
not automatically upload sourcemaps to Sentry

Related PR - #11490

## **Related issues**

Fixes: #10812

## **Manual testing steps**

To build release AND upload sourcemaps, use the two workflows in
Bitrise:
- `build_android_release_and_upload_sourcemaps`
- `build_ios_release_and_upload_sourcemaps`

To only build release without uploading sourcemaps, use the two
workflows in Bitrise:
- `build_android_release`
- `build_ios_release`

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->
In this test, we ran the default `build_ios_release` and
`build_android_release`, which resulted in no sourcemaps being uploaded
- Android -
https://app.bitrise.io/build/bc568645-d1e4-418c-bea0-6aafe8f2e21c
- iOS -
https://app.bitrise.io/build/e7c224b3-c0f3-4be9-afa0-b3ad423d0da7

In this test, we enabled Sentry sourcemap upload and re-used
`build_ios_release` and `build_android_release` to mimic the workflows
that uploads sourcemaps. We can see in the two builds that it
successfully uploads sourcemaps.
- Android -
https://app.bitrise.io/build/d93989e0-3ca8-4bab-aaf2-48b0ca104986
- iOS -
https://app.bitrise.io/build/b24edfed-b020-4ac1-bf44-191d284b099b

Sourcemaps uploaded
- Android:
<img width="870" alt="Screenshot 2024-10-23 at 6 08 21 PM"
src="https://github.com/user-attachments/assets/44b24050-7337-4cc8-b13a-5aa9795bb72d">
- iOS:
<img width="851" alt="Screenshot 2024-10-23 at 6 08 31 PM"
src="https://github.com/user-attachments/assets/c26e8b8c-a767-46ee-ade6-5c519767893c">

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
  • Loading branch information
runway-github[bot] authored Oct 29, 2024
2 parents 07d2318 + 8e51d4c commit 420b3c4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ stages:
- run_tag_smoke_core_android: {}
build_regression_e2e_ios_android_stage:
workflows:
- ios_e2e_build: {}
- android_e2e_build: {}
- ios_e2e_build: {}
- android_e2e_build: {}
run_regression_e2e_ios_android_stage:
workflows:
- ios_run_regression_tests: {}
Expand Down Expand Up @@ -1094,6 +1094,11 @@ workflows:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
build_android_release_and_upload_sourcemaps:
envs:
- SENTRY_DISABLE_AUTO_UPLOAD: 'false'
after_run:
- build_android_release
build_android_qa:
before_run:
- code_setup
Expand Down Expand Up @@ -1264,7 +1269,7 @@ workflows:
- ipa_path: $BITRISE_APP_STORE_IPA_PATH
build_ios_release:
envs:
- NO_FLIPPER: '1'
- NO_FLIPPER: '1'
before_run:
- code_setup
after_run:
Expand Down Expand Up @@ -1303,9 +1308,14 @@ workflows:
- pipeline_intermediate_files: sourcemaps/ios/index.js.map:BITRISE_APP_STORE_SOURCEMAP_PATH
- deploy_path: sourcemaps/ios/index.js.map
title: Deploy Source Map
build_ios_release_and_upload_sourcemaps:
envs:
- SENTRY_DISABLE_AUTO_UPLOAD: 'false'
after_run:
- build_ios_release
build_ios_qa:
envs:
- NO_FLIPPER: '1'
- NO_FLIPPER: '1'
before_run:
- code_setup
after_run:
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ buildIosRelease(){
remapEnvVariableRelease

# Enable Sentry to auto upload source maps and debug symbols
export SENTRY_DISABLE_AUTO_UPLOAD="false"
export SENTRY_DISABLE_AUTO_UPLOAD=${SENTRY_DISABLE_AUTO_UPLOAD:-"true"}

prebuild_ios

Expand Down Expand Up @@ -425,7 +425,7 @@ buildAndroidRelease(){
fi

# Enable Sentry to auto upload source maps and debug symbols
export SENTRY_DISABLE_AUTO_UPLOAD="false"
export SENTRY_DISABLE_AUTO_UPLOAD=${SENTRY_DISABLE_AUTO_UPLOAD:-"true"}
prebuild_android

# GENERATE APK
Expand Down

0 comments on commit 420b3c4

Please sign in to comment.