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

Prevent redundant Sentry sourcemap uploads #10812

Closed
9 tasks
Cal-L opened this issue Aug 26, 2024 · 1 comment · Fixed by #11081 or #11993
Closed
9 tasks

Prevent redundant Sentry sourcemap uploads #10812

Cal-L opened this issue Aug 26, 2024 · 1 comment · Fixed by #11081 or #11993
Assignees
Labels
release-7.33.0 Issue or pull request that will be included in release 7.33.0 release-7.35.0 Issue or pull request that will be included in release 7.35.0 team-mobile-delivery team-mobile-platform

Comments

@Cal-L
Copy link
Contributor

Cal-L commented Aug 26, 2024

What is this about?

This task tracks preventing redundant Sentry sourcemap uploads. For context: We've noticed that there are duplicate sourcemaps being uploaded for releases under the same distribution name. This messes with stack traces since production bugs can now be associated with sourcemaps generated with different stack traces. In turn, this can make debugging Sentry issues impossible. The solution is to fix the system so that we only upload one set of source maps to each platform for each distributed version.

This shows redundant sourcemaps uploaded to the same distribution name
image

Scenario

No response

Design

No response

Technical Details

  • It is believed that the issue occurs because certain release flows are used indiscriminately
  • For example, build_ios_release/build_android_release is a step used for cutting RCs as well as uploading builds to TestFlight for testing
    • This pipeline should be renamed/created to describe the building and staging of apps in test disruptions
    • release_builds_to_store_pipeline - remove this pipeline
    • build_send_apps_to_testflight - create a pipeline that disables source map uploads
  • In the scenario above, it's possible that build_ios_release/build_android_release overwrites the sourcemaps for the RC, which eventually becomes prod
  • The technical task here is to confirm this suspicion and possibly abstract + designate a flow only used for cutting RCs. Once this flow is created, we need to ensure that only this flow uploads Sentry sourcemaps

Threat Modeling Framework

No response

Acceptance Criteria

  • Only a single set of sourcemaps is being uploaded to each RC/distribution version
  • Reported errors in Sentry shows the correct stack trace
  • The new abstracted flow creates an RC + uploads the correct sourcemaps in Sentry

Stakeholder review needed before the work gets merged

  • Engineering (needed in most cases)
  • Design
  • Product
  • QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
  • Security
  • Legal
  • Marketing
  • Management (please specify)
  • Other (please specify)

References

No response

@Daniel-Cross Daniel-Cross linked a pull request Sep 6, 2024 that will close this issue
7 tasks
@metamaskbot metamaskbot added the release-7.33.0 Issue or pull request that will be included in release 7.33.0 label Sep 27, 2024
@Daniel-Cross Daniel-Cross assigned Cal-L and unassigned Daniel-Cross Oct 22, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 24, 2024
<!--
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.
@metamaskbot metamaskbot added the release-7.35.0 Issue or pull request that will be included in release 7.35.0 label Oct 24, 2024
runway-github bot added a commit that referenced this issue Oct 29, 2024
<!--
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.
runway-github bot added a commit that referenced this issue Oct 29, 2024
<!--
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.
runway-github bot pushed a commit that referenced this issue Oct 29, 2024
…#11993)

<!--
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.
sethkfman pushed a commit that referenced this issue Oct 29, 2024
<!--
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-7.33.0 Issue or pull request that will be included in release 7.33.0 release-7.35.0 Issue or pull request that will be included in release 7.35.0 team-mobile-delivery team-mobile-platform
Projects
None yet
9 participants
@gauthierpetetin @Cal-L @Daniel-Cross @metamaskbot and others