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

[Gutenberg] Add error boundary components and exception logging #20359

Merged
merged 25 commits into from
Mar 12, 2024

Conversation

fluiddot
Copy link
Contributor

@fluiddot fluiddot commented Mar 1, 2024

Related PRs:

This PR enables the error boundary at the editor and block level. It also connects Gutenberg Mobile to the Crash logging service in order to log JavaScript exceptions.

Additionally, it uploads to Sentry the JavaScript source map included in the React Native bridge Android library.


To Test:

Follow testing instructions from wordpress-mobile/gutenberg-mobile#6655.


Regression Notes

  1. Potential unintended areas of impact

    • None on the user-facing side as this PR mainly implements a new RN bridge function. However, it also adds a step in the build process that if fails might disrupt the release process.
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • I manually tested the build process for alpha builds. I didn't cover beta and app store builds, but the only error I foresee that it might introduce is tagging the source map files with a wrong release version. We'll work with Apps Infra team closely in the release where these changes are introduced to validate the source map files are properly uploaded.
  3. What automated tests I added (or what prevented me from doing so)

    • N/A

PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing Checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@fluiddot fluiddot requested a review from jhnstn March 1, 2024 12:49
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wordpress-mobile/apps-infrastructure I'd appreciate it if someone could take a look at this approach for uploading the React Native's JavaScript source map file to Sentry. I'm mostly seeking validation of the approach, thoughts/feedback or better alternatives. Thank you very much for the help 🙇 !

To give some context on the approach: The source map is generated as part of the Gutenerg Mobile build process, the files are being passed as assets via the library (reference). Sentry uses the JavaScript bundle and the source map to symbolicate the stack trace and reference the exact code line that caused the exception (reference).

The approach followed here consists in:

  1. Add Gem fastlane-plugin-sentry to use the sentry_upload_sourcemap action.
  2. Add upload_gutenberg_sourcemaps helper function to build lanes.
  3. To invoke sentry_upload_sourcemap we need a set of parameters that are fetched with the following steps:
    1. Load Sentry properties to obtain the token, organization and project slugs.
    2. Locate the bundle and source map files passed as assets of the Gutenberg Mobile dependency, based on app, build flavor, and build type. Note that the path points to intermediates folder within the project's build path.
  4. Invoke the upload_gutenberg_sourcemaps in the different build lanes.

As a first approach, I tried to copy the bundle and source map files to a different folder during the asset merging step in the build process. However, I finally discarded this option because seemed unnecessary. Here you can see the changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Approach looks good to me; thanks for documenting it all with comments 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @AliSoftware for taking a look and validating the approach, I appreciate it 🙇 .

fastlane/lanes/build.rb Outdated Show resolved Hide resolved
fastlane/lanes/build.rb Outdated Show resolved Hide resolved
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 7, 2024

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20359-eadc097
Commiteadc097
Direct Downloadwordpress-prototype-build-pr20359-eadc097.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 7, 2024

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20359-eadc097
Commiteadc097
Direct Downloadjetpack-prototype-build-pr20359-eadc097.apk
Note: Google Login is not supported on these builds.

@fluiddot fluiddot marked this pull request as ready for review March 7, 2024 18:07
Copy link
Member

@jhnstn jhnstn left a comment

Choose a reason for hiding this comment

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

Tested via #20435 (comment)

:shipit:

@fluiddot fluiddot added the Observability Telemetry and Crash Logs label Mar 11, 2024
@fluiddot fluiddot added this to the 24.5 milestone Mar 11, 2024
@wpmobilebot
Copy link
Contributor

Found 1 violations:

The PR caused some dependency changes (expand to see details)

 +--- project :libs:analytics
-|    \--- com.automattic:Automattic-Tracks-Android:3.4.0
-|         +--- io.sentry:sentry-bom:6.32.0
-|         |    +--- io.sentry:sentry-android:6.32.0 (c)
-|         |    +--- io.sentry:sentry-android-fragment:6.32.0 (c)
-|         |    +--- io.sentry:sentry-android-okhttp:6.32.0 (c)
-|         |    +--- io.sentry:sentry-android-core:6.32.0 (c)
-|         |    +--- io.sentry:sentry-android-ndk:6.32.0 (c)
-|         |    \--- io.sentry:sentry:6.32.0 (c)
-|         +--- io.sentry:sentry-android -> 6.32.0
-|         |    +--- io.sentry:sentry-android-core:6.32.0
-|         |    |    +--- io.sentry:sentry:6.32.0
-|         |    |    +--- androidx.lifecycle:lifecycle-process:2.2.0 -> 2.6.2 (*)
-|         |    |    +--- androidx.lifecycle:lifecycle-common-java8:2.2.0 -> 2.6.2 (*)
-|         |    |    \--- androidx.core:core:1.3.2 -> 1.12.0 (*)
-|         |    \--- io.sentry:sentry-android-ndk:6.32.0
-|         |         +--- io.sentry:sentry:6.32.0
-|         |         \--- io.sentry:sentry-android-core:6.32.0 (*)
-|         +--- io.sentry:sentry-android-okhttp -> 6.32.0
-|         |    +--- io.sentry:sentry:6.32.0
-|         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0 -> 1.9.10 (*)
-|         +--- io.sentry:sentry-android-fragment -> 6.32.0
-|         |    \--- io.sentry:sentry:6.32.0
-|         +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.11.0
-|         |    +--- com.squareup.okio:okio:3.2.0 -> 3.6.0
-|         |    |    \--- com.squareup.okio:okio-jvm:3.6.0
-|         |    |         +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10 (*)
-|         |    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10 -> 1.9.22 (*)
-|         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.20 -> 1.9.22 (*)
-|         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.10 (*)
-|         +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 -> 1.7.3 (*)
-|         \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
+|    \--- com.automattic:Automattic-Tracks-Android:3.5.0
+|         +--- io.sentry:sentry-bom:7.5.0
+|         |    +--- io.sentry:sentry-android:7.5.0 (c)
+|         |    +--- io.sentry:sentry-android-fragment:7.5.0 (c)
+|         |    +--- io.sentry:sentry-android-okhttp:7.5.0 (c)
+|         |    +--- io.sentry:sentry-android-core:7.5.0 (c)
+|         |    +--- io.sentry:sentry-android-ndk:7.5.0 (c)
+|         |    +--- io.sentry:sentry:7.5.0 (c)
+|         |    \--- io.sentry:sentry-okhttp:7.5.0 (c)
+|         +--- io.sentry:sentry-android -> 7.5.0
+|         |    +--- io.sentry:sentry-android-core:7.5.0
+|         |    |    +--- io.sentry:sentry:7.5.0
+|         |    |    +--- androidx.lifecycle:lifecycle-process:2.2.0 -> 2.6.2 (*)
+|         |    |    +--- androidx.lifecycle:lifecycle-common-java8:2.2.0 -> 2.6.2 (*)
+|         |    |    \--- androidx.core:core:1.3.2 -> 1.12.0 (*)
+|         |    \--- io.sentry:sentry-android-ndk:7.5.0
+|         |         +--- io.sentry:sentry:7.5.0
+|         |         \--- io.sentry:sentry-android-core:7.5.0 (*)
+|         +--- io.sentry:sentry-android-okhttp -> 7.5.0
+|         |    +--- io.sentry:sentry:7.5.0
+|         |    +--- io.sentry:sentry-okhttp:7.5.0
+|         |    |    +--- io.sentry:sentry:7.5.0
+|         |    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0 -> 1.9.10 (*)
+|         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0 -> 1.9.10 (*)
+|         +--- io.sentry:sentry-android-fragment -> 7.5.0
+|         |    \--- io.sentry:sentry:7.5.0
+|         +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         +--- com.squareup.okhttp3:okhttp:4.9.0 -> 4.11.0
+|         |    +--- com.squareup.okio:okio:3.2.0 -> 3.6.0
+|         |    |    \--- com.squareup.okio:okio-jvm:3.6.0
+|         |    |         +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10 (*)
+|         |    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10 -> 1.9.22 (*)
+|         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.20 -> 1.9.22 (*)
+|         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20 -> 1.9.10 (*)
+|         +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 -> 1.7.3 (*)
+|         \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
 +--- project :libs:editor
-|    \--- org.wordpress.gutenberg-mobile:react-native-gutenberg-bridge:v1.115.0-alpha3
-|         +--- com.facebook.fresco:animated-gif:2.0.0
-|         |    +--- com.parse.bolts:bolts-tasks:1.4.0
-|         |    +--- com.facebook.soloader:soloader:0.6.0 -> 0.10.5 (*)
-|         |    +--- com.facebook.fresco:fbcore:2.0.0 -> 3.1.3 (*)
-|         |    \--- com.facebook.fresco:animated-base:2.0.0
-|         |         +--- com.facebook.fresco:fbcore:2.0.0 -> 3.1.3 (*)
-|         |         +--- com.facebook.fresco:imagepipeline-base:2.0.0 -> 3.1.3 (*)
-|         |         +--- com.facebook.fresco:imagepipeline:2.0.0 -> 3.1.3 (*)
-|         |         +--- com.facebook.fresco:animated-drawable:2.0.0
-|         |         |    +--- com.facebook.fresco:imagepipeline:2.0.0 -> 3.1.3 (*)
-|         |         |    +--- com.facebook.fresco:drawee:2.0.0 -> 3.1.3 (*)
-|         |         |    \--- com.facebook.fresco:fbcore:2.0.0 -> 3.1.3 (*)
-|         |         \--- com.parse.bolts:bolts-tasks:1.4.0
-|         +--- com.google.android.material:material:1.2.1 -> 1.9.0 (*)
-|         +--- com.github.wordpress-mobile:react-native-video:5.2.0-wp-6
-|         |    +--- com.google.android.exoplayer:exoplayer:2.13.3
-|         |    |    +--- com.google.android.exoplayer:exoplayer-core:2.13.3
-|         |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         |    |    |    +--- com.google.android.exoplayer:exoplayer-common:2.13.3
-|         |    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         |    |    |    |    \--- com.google.guava:guava:27.1-android
-|         |    |    |    |         +--- com.google.guava:failureaccess:1.0.1
-|         |    |    |    |         \--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
-|         |    |    |    \--- com.google.android.exoplayer:exoplayer-extractor:2.13.3
-|         |    |    |         +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         |    |    |         \--- com.google.android.exoplayer:exoplayer-common:2.13.3 (*)
-|         |    |    +--- com.google.android.exoplayer:exoplayer-dash:2.13.3
-|         |    |    |    +--- com.google.android.exoplayer:exoplayer-core:2.13.3 (*)
-|         |    |    |    \--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         |    |    +--- com.google.android.exoplayer:exoplayer-hls:2.13.3
-|         |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         |    |    |    \--- com.google.android.exoplayer:exoplayer-core:2.13.3 (*)
-|         |    |    +--- com.google.android.exoplayer:exoplayer-smoothstreaming:2.13.3
-|         |    |    |    +--- com.google.android.exoplayer:exoplayer-core:2.13.3 (*)
-|         |    |    |    \--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         |    |    +--- com.google.android.exoplayer:exoplayer-transformer:2.13.3
-|         |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         |    |    |    \--- com.google.android.exoplayer:exoplayer-core:2.13.3 (*)
-|         |    |    \--- com.google.android.exoplayer:exoplayer-ui:2.13.3
-|         |    |         +--- com.google.android.exoplayer:exoplayer-core:2.13.3 (*)
-|         |    |         +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         |    |         +--- androidx.recyclerview:recyclerview:1.1.0 -> 1.3.0 (*)
-|         |    |         \--- androidx.media:media:1.2.1 (*)
-|         |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         |    +--- androidx.core:core:1.1.0 -> 1.12.0 (*)
-|         |    +--- androidx.media:media:1.1.0 -> 1.2.1 (*)
-|         |    +--- com.google.android.exoplayer:extension-okhttp:2.13.3
-|         |    |    +--- com.google.android.exoplayer:exoplayer-common:2.13.3 (*)
-|         |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
-|         |    |    \--- com.squareup.okhttp3:okhttp:3.12.11 -> 4.11.0 (*)
-|         |    \--- com.squareup.okhttp3:okhttp:${OKHTTP_VERSION} -> 4.11.0 (*)
-|         +--- com.github.wordpress-mobile:react-native-slider:3.0.2-wp-4
-|         +--- org.wordpress.react-native-libraries.v5:react-native-get-random-values:1.4.0
-|         +--- org.wordpress.react-native-libraries.v5:react-native-safe-area-context:4.8.2
-|         |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.21 -> 1.9.22 (*)
-|         +--- org.wordpress.react-native-libraries.v5:react-native-screens:3.29.0
-|         |    +--- androidx.appcompat:appcompat:1.6.1 (*)
-|         |    +--- androidx.fragment:fragment:1.3.6 -> 1.6.2 (*)
-|         |    +--- androidx.coordinatorlayout:coordinatorlayout:1.2.0 (*)
-|         |    +--- androidx.swiperefreshlayout:swiperefreshlayout:1.1.0 (*)
-|         |    +--- com.google.android.material:material:1.9.0 (*)
-|         |    +--- androidx.core:core-ktx:1.9.0 -> 1.12.0 (*)
-|         |    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
-|         |    \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1 -> 2.6.2 (c)
-|         +--- org.wordpress.react-native-libraries.v5:react-native-svg:14.0.0
-|         +--- org.wordpress.react-native-libraries.v5:react-native-webview:13.6.1
-|         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.21 -> 1.9.22 (*)
-|         |    \--- androidx.webkit:webkit:1.4.0 -> 1.10.0 (*)
-|         +--- org.wordpress.react-native-libraries.v5:react-native-masked-view:0.3.0
-|         +--- org.wordpress.react-native-libraries.v5:react-native-clipboard:1.11.2
-|         +--- org.wordpress.react-native-libraries.v5:react-native-fast-image:8.5.11
-|         |    +--- com.github.bumptech.glide:glide:4.12.0 -> 4.16.0
-|         |    |    +--- com.github.bumptech.glide:gifdecoder:4.16.0
-|         |    |    |    \--- androidx.annotation:annotation:1.5.0 -> 1.6.0 (*)
-|         |    |    +--- com.github.bumptech.glide:disklrucache:4.16.0
-|         |    |    +--- com.github.bumptech.glide:annotations:4.16.0
-|         |    |    +--- androidx.fragment:fragment:1.3.6 -> 1.6.2 (*)
-|         |    |    +--- androidx.vectordrawable:vectordrawable-animated:1.1.0 (*)
-|         |    |    +--- androidx.exifinterface:exifinterface:1.3.6 (*)
-|         |    |    \--- androidx.tracing:tracing:1.0.0 -> 1.1.0 (*)
-|         |    \--- com.github.bumptech.glide:okhttp3-integration:4.12.0
-|         |         +--- com.github.bumptech.glide:glide:4.12.0 -> 4.16.0 (*)
-|         |         +--- com.squareup.okhttp3:okhttp:3.9.1 -> 4.11.0 (*)
-|         |         \--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*)
-|         +--- org.wordpress.react-native-libraries.v5:react-native-reanimated:3.6.2
-|         |    +--- com.facebook.yoga:proguard-annotations:1.19.0
-|         |    +--- androidx.transition:transition:1.1.0 -> 1.4.1 (*)
-|         |    \--- androidx.core:core:1.9.0 -> 1.12.0 (*)
-|         +--- org.wordpress.react-native-libraries.v5:react-native-gesture-handler:2.14.1
-|         |    +--- org.wordpress.react-native-libraries.v5:react-native-reanimated:3.6.2 (*)
-|         |    +--- androidx.appcompat:appcompat:1.6.1 (*)
-|         |    +--- androidx.core:core-ktx:1.9.0 -> 1.12.0 (*)
-|         |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.21 -> 1.9.22 (*)
-|         +--- org.wordpress.react-native-libraries.v5:react-native-linear-gradient:2.7.3
-|         +--- org.wordpress.gutenberg-mobile:react-native-aztec:v1.115.0-alpha3
-|         |    +--- androidx.legacy:legacy-support-v4:1.0.0 (*)
-|         |    +--- androidx.gridlayout:gridlayout:1.0.0
-|         |    |    +--- androidx.core:core:1.0.0 -> 1.12.0 (*)
-|         |    |    \--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
-|         |    +--- androidx.cardview:cardview:1.0.0 (*)
-|         |    +--- androidx.appcompat:appcompat:1.2.0 -> 1.6.1 (*)
-|         |    +--- androidx.recyclerview:recyclerview:1.1.0 -> 1.3.0 (*)
-|         |    +--- org.wordpress:aztec:v1.9.0 -> v2.0 (*)
-|         |    +--- org.wordpress.aztec:wordpress-shortcodes:v1.9.0 -> v2.0 (*)
-|         |    +--- org.wordpress.aztec:wordpress-comments:v1.9.0 -> v2.0 (*)
-|         |    +--- org.wordpress.aztec:glide-loader:v1.9.0
-|         |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 -> 1.9.10 (*)
-|         |    |    +--- org.wordpress:aztec:v1.9.0 -> v2.0 (*)
-|         |    |    \--- com.github.bumptech.glide:glide:4.10.0 -> 4.16.0 (*)
-|         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0 -> 1.9.10 (*)
-|         \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0 -> 1.9.10 (*)
+|    +--- org.wordpress.gutenberg-mobile:react-native-gutenberg-bridge:v1.115.0-alpha5
+|         +--- com.facebook.fresco:animated-gif:2.0.0
+|         |    +--- com.parse.bolts:bolts-tasks:1.4.0
+|         |    +--- com.facebook.soloader:soloader:0.6.0 -> 0.10.5 (*)
+|         |    +--- com.facebook.fresco:fbcore:2.0.0 -> 3.1.3 (*)
+|         |    \--- com.facebook.fresco:animated-base:2.0.0
+|         |         +--- com.facebook.fresco:fbcore:2.0.0 -> 3.1.3 (*)
+|         |         +--- com.facebook.fresco:imagepipeline-base:2.0.0 -> 3.1.3 (*)
+|         |         +--- com.facebook.fresco:imagepipeline:2.0.0 -> 3.1.3 (*)
+|         |         +--- com.facebook.fresco:animated-drawable:2.0.0
+|         |         |    +--- com.facebook.fresco:imagepipeline:2.0.0 -> 3.1.3 (*)
+|         |         |    +--- com.facebook.fresco:drawee:2.0.0 -> 3.1.3 (*)
+|         |         |    \--- com.facebook.fresco:fbcore:2.0.0 -> 3.1.3 (*)
+|         |         \--- com.parse.bolts:bolts-tasks:1.4.0
+|         +--- com.google.android.material:material:1.2.1 -> 1.9.0 (*)
+|         +--- com.github.wordpress-mobile:react-native-video:5.2.0-wp-6
+|         |    +--- com.google.android.exoplayer:exoplayer:2.13.3
+|         |    |    +--- com.google.android.exoplayer:exoplayer-core:2.13.3
+|         |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         |    |    |    +--- com.google.android.exoplayer:exoplayer-common:2.13.3
+|         |    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         |    |    |    |    \--- com.google.guava:guava:27.1-android
+|         |    |    |    |         +--- com.google.guava:failureaccess:1.0.1
+|         |    |    |    |         \--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
+|         |    |    |    \--- com.google.android.exoplayer:exoplayer-extractor:2.13.3
+|         |    |    |         +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         |    |    |         \--- com.google.android.exoplayer:exoplayer-common:2.13.3 (*)
+|         |    |    +--- com.google.android.exoplayer:exoplayer-dash:2.13.3
+|         |    |    |    +--- com.google.android.exoplayer:exoplayer-core:2.13.3 (*)
+|         |    |    |    \--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         |    |    +--- com.google.android.exoplayer:exoplayer-hls:2.13.3
+|         |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         |    |    |    \--- com.google.android.exoplayer:exoplayer-core:2.13.3 (*)
+|         |    |    +--- com.google.android.exoplayer:exoplayer-smoothstreaming:2.13.3
+|         |    |    |    +--- com.google.android.exoplayer:exoplayer-core:2.13.3 (*)
+|         |    |    |    \--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         |    |    +--- com.google.android.exoplayer:exoplayer-transformer:2.13.3
+|         |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         |    |    |    \--- com.google.android.exoplayer:exoplayer-core:2.13.3 (*)
+|         |    |    \--- com.google.android.exoplayer:exoplayer-ui:2.13.3
+|         |    |         +--- com.google.android.exoplayer:exoplayer-core:2.13.3 (*)
+|         |    |         +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         |    |         +--- androidx.recyclerview:recyclerview:1.1.0 -> 1.3.0 (*)
+|         |    |         \--- androidx.media:media:1.2.1 (*)
+|         |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         |    +--- androidx.core:core:1.1.0 -> 1.12.0 (*)
+|         |    +--- androidx.media:media:1.1.0 -> 1.2.1 (*)
+|         |    +--- com.google.android.exoplayer:extension-okhttp:2.13.3
+|         |    |    +--- com.google.android.exoplayer:exoplayer-common:2.13.3 (*)
+|         |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.6.0 (*)
+|         |    |    \--- com.squareup.okhttp3:okhttp:3.12.11 -> 4.11.0 (*)
+|         |    \--- com.squareup.okhttp3:okhttp:${OKHTTP_VERSION} -> 4.11.0 (*)
+|         +--- com.github.wordpress-mobile:react-native-slider:3.0.2-wp-4
+|         +--- org.wordpress.react-native-libraries.v5:react-native-get-random-values:1.4.0
+|         +--- org.wordpress.react-native-libraries.v5:react-native-safe-area-context:4.8.2
+|         |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.21 -> 1.9.22 (*)
+|         +--- org.wordpress.react-native-libraries.v5:react-native-screens:3.29.0
+|         |    +--- androidx.appcompat:appcompat:1.6.1 (*)
+|         |    +--- androidx.fragment:fragment:1.3.6 -> 1.6.2 (*)
+|         |    +--- androidx.coordinatorlayout:coordinatorlayout:1.2.0 (*)
+|         |    +--- androidx.swiperefreshlayout:swiperefreshlayout:1.1.0 (*)
+|         |    +--- com.google.android.material:material:1.9.0 (*)
+|         |    +--- androidx.core:core-ktx:1.9.0 -> 1.12.0 (*)
+|         |    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
+|         |    \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1 -> 2.6.2 (c)
+|         +--- org.wordpress.react-native-libraries.v5:react-native-svg:14.0.0
+|         +--- org.wordpress.react-native-libraries.v5:react-native-webview:13.6.1
+|         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.21 -> 1.9.22 (*)
+|         |    \--- androidx.webkit:webkit:1.4.0 -> 1.10.0 (*)
+|         +--- org.wordpress.react-native-libraries.v5:react-native-masked-view:0.3.0
+|         +--- org.wordpress.react-native-libraries.v5:react-native-clipboard:1.11.2
+|         +--- org.wordpress.react-native-libraries.v5:react-native-fast-image:8.5.11
+|         |    +--- com.github.bumptech.glide:glide:4.12.0 -> 4.16.0
+|         |    |    +--- com.github.bumptech.glide:gifdecoder:4.16.0
+|         |    |    |    \--- androidx.annotation:annotation:1.5.0 -> 1.6.0 (*)
+|         |    |    +--- com.github.bumptech.glide:disklrucache:4.16.0
+|         |    |    +--- com.github.bumptech.glide:annotations:4.16.0
+|         |    |    +--- androidx.fragment:fragment:1.3.6 -> 1.6.2 (*)
+|         |    |    +--- androidx.vectordrawable:vectordrawable-animated:1.1.0 (*)
+|         |    |    +--- androidx.exifinterface:exifinterface:1.3.6 (*)
+|         |    |    \--- androidx.tracing:tracing:1.0.0 -> 1.1.0 (*)
+|         |    \--- com.github.bumptech.glide:okhttp3-integration:4.12.0
+|         |         +--- com.github.bumptech.glide:glide:4.12.0 -> 4.16.0 (*)
+|         |         +--- com.squareup.okhttp3:okhttp:3.9.1 -> 4.11.0 (*)
+|         |         \--- androidx.annotation:annotation:1.0.0 -> 1.6.0 (*)
+|         +--- org.wordpress.react-native-libraries.v5:react-native-reanimated:3.6.2
+|         |    +--- com.facebook.yoga:proguard-annotations:1.19.0
+|         |    +--- androidx.transition:transition:1.1.0 -> 1.4.1 (*)
+|         |    \--- androidx.core:core:1.9.0 -> 1.12.0 (*)
+|         +--- org.wordpress.react-native-libraries.v5:react-native-gesture-handler:2.14.1
+|         |    +--- org.wordpress.react-native-libraries.v5:react-native-reanimated:3.6.2 (*)
+|         |    +--- androidx.appcompat:appcompat:1.6.1 (*)
+|         |    +--- androidx.core:core-ktx:1.9.0 -> 1.12.0 (*)
+|         |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.21 -> 1.9.22 (*)
+|         +--- org.wordpress.react-native-libraries.v5:react-native-linear-gradient:2.7.3
+|         +--- org.wordpress.gutenberg-mobile:react-native-aztec:v1.115.0-alpha5
+|         |    +--- androidx.legacy:legacy-support-v4:1.0.0 (*)
+|         |    +--- androidx.gridlayout:gridlayout:1.0.0
+|         |    |    +--- androidx.core:core:1.0.0 -> 1.12.0 (*)
+|         |    |    \--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
+|         |    +--- androidx.cardview:cardview:1.0.0 (*)
+|         |    +--- androidx.appcompat:appcompat:1.2.0 -> 1.6.1 (*)
+|         |    +--- androidx.recyclerview:recyclerview:1.1.0 -> 1.3.0 (*)
+|         |    +--- org.wordpress:aztec:v1.9.0 -> v2.0 (*)
+|         |    +--- org.wordpress.aztec:wordpress-shortcodes:v1.9.0 -> v2.0 (*)
+|         |    +--- org.wordpress.aztec:wordpress-comments:v1.9.0 -> v2.0 (*)
+|         |    +--- org.wordpress.aztec:glide-loader:v1.9.0
+|         |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 -> 1.9.10 (*)
+|         |    |    +--- org.wordpress:aztec:v1.9.0 -> v2.0 (*)
+|         |    |    \--- com.github.bumptech.glide:glide:4.10.0 -> 4.16.0 (*)
+|         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0 -> 1.9.10 (*)
+|         \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0 -> 1.9.10 (*)
+|    \--- com.automattic:Automattic-Tracks-Android:3.5.0 (*)
-\--- com.automattic:Automattic-Tracks-Android:{strictly 3.4.0} -> 3.4.0 (*)
+\--- com.automattic:Automattic-Tracks-Android:{strictly 3.5.0} -> 3.5.0 (*)

Please review and act accordingly

@fluiddot fluiddot enabled auto-merge March 11, 2024 18:02
@fluiddot fluiddot disabled auto-merge March 11, 2024 18:04
@fluiddot
Copy link
Contributor Author

fluiddot commented Mar 11, 2024

I checked the APK generated for the installable build and noticed that the source map file is being included. Since it's not needed and the size is big (around 20MB), we should avoid include it. For this reason, I'm holding off the merge until we address this. In theory, https://github.com/wordpress-mobile/WordPress-Android/pull/20359/files#diff-276cc53d974bad3212f8e1f709d32ea3f8d380c4dccb10419505d283fb41f2d7R290 should prevent adding the file but seems it's not working.

This can be checked by profiling the APK shared in #20359 (comment) in Android Studio

Copy link

sonarcloud bot commented Mar 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Following #20359 (comment) , we had to make an adjustment in order to avoid including the source map file (index.android.bundle.map) in the app. This file is only needed in the build process to upload it to Sentry and shouldn't be in the resulting APK.

Originally, we tried using exclude '**/*.bundle.map' in this file (32db175) but for some reason, it was still adding the source map file. As a second approach, we are now copying the bundle and source map files to a separate folder and deleting the source map to avoid inclusion. The new folder will be used in the upload_gutenberg_sourcemaps function when uploading the files to Sentry.

@AliSoftware since you already took a look at the original approach (https://github.com/wordpress-mobile/WordPress-Android/pull/20359/files#r1510915719), I wonder if you could double-check that this approach is valid. Thanks for your help 🙇 !

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I was focused on doing a CI deployment today, and only getting to this PR now, but I see it's already merged 🙂

I only skimmed the new code in build.gradle but your explanations above makes sense to me so I think the approach sounds good 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I was focused on doing a CI deployment today, and only getting to this PR now, but I see it's already merged 🙂

No worries @AliSoftware. Yes, we finally decided to merge the PR (internal ref: p1710254914686709/1710180482.367029-slack-C06G8EGHE1H) to unblock other potential PRs, as the counterpart Gutenberg changes were already merged. In any case, if we identify improvements to be made to this approach, we'll be happy to apply them in a separate PR.

I only skimmed the new code in build.gradle but your explanations above makes sense to me so I think the approach sounds good 👍

Great, thanks for taking a look and validating the approach 🙇 !

org_slug = sentry_properties[:'defaults.org']

# Bundle and source map files are copied to a specific folder as part of the build process.
bundle_source_map_path = File.join(PROJECT_ROOT_FOLDER, 'WordPress', 'build', 'react-native-bundle-source-map')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This folder is created in:

copy {
from(outputDir)
into("${buildDir}/react-native-bundle-source-map")
include("*.bundle", "*.bundle.map")
}

@fluiddot fluiddot merged commit aeb40f8 into trunk Mar 12, 2024
20 checks passed
@fluiddot fluiddot deleted the rnmobile/add/log-exception-to-crash-logging branch March 12, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. Observability Telemetry and Crash Logs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants