-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #22655
Conversation
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
upload_gutenberg_sourcemaps( | ||
sentry_project_slug: SENTRY_PROJECT_SLUG_WORDPRESS, | ||
release_version: release_version_current, | ||
build_version: build_code_current, | ||
app_identifier: WORDPRESS_BUNDLE_IDENTIFIER | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This source map will be used for the App Store builds (beta and production) of the WordPress app.
upload_gutenberg_sourcemaps( | ||
sentry_project_slug: SENTRY_PROJECT_SLUG_JETPACK, | ||
release_version: release_version_current, | ||
build_version: build_code_current, | ||
app_identifier: JETPACK_BUNDLE_IDENTIFIER | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This source map will be used for the App Store builds (beta and production) of the Jetpack app.
upload_gutenberg_sourcemaps( | ||
sentry_project_slug: SENTRY_PROJECT_SLUG_WORDPRESS, | ||
release_version: release_version_current_internal, | ||
build_version: build_code_current_internal, | ||
app_identifier: 'org.wordpress.internal' | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This source map will be used for the internal builds of the WordPress app. As far as I checked, this version is seems no longer used.
fastlane/lanes/build.rb
Outdated
upload_gutenberg_sourcemaps( | ||
sentry_project_slug: sentry_project_slug, | ||
release_version: release_version_current, | ||
build_version: build_number, | ||
app_identifier: app_identifier | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This source map will be used for the alpha builds (i.e. installable builds in PRs). The app is determined by the app_identifier
parameter.
fastlane/lanes/build.rb
Outdated
# The bundle and source map files are the same for all architectures. | ||
gutenberg_bundle = File.join(PROJECT_ROOT_FOLDER, "Pods/Gutenberg/Frameworks/Gutenberg.xcframework/ios-arm64/Gutenberg.framework") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As specified in the inline comment, the bundle and source map files are included for each architecture. However, both files are the same, as the JavaScript code isn't affected by the architecture. Hence, we can use the files from any of the architectures.
@@ -13,6 +13,7 @@ DEST="$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH" | |||
# Update the matching .inputs.xcfilelist when changing these | |||
XCFRAMEWORK_BUNDLE_ROOT="$PODS_XCFRAMEWORKS_BUILD_DIR/Gutenberg/Gutenberg.framework" | |||
PODS_BUNDLE_ROOT="$PODS_ROOT/Gutenberg/bundle/ios" | |||
LOCAL_BUNDLE="$PODS_ROOT/../../gutenberg-mobile/bundle/ios" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When testing a production version of the JS bundle in local builds, I noticed we don't have a quick way to use a local bundle. For this reason, I added a third option to fetch the bundle by pointing to a local path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The option to fetch the bundle form $PODS_ROOT/Gutenberg/bundle/ios
seems to be deprecated as the library is provided with the XCFramework. We could remove it.
# Conflicts: # Gutenberg/config.yml # Podfile.lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test build worked from wordpress-mobile/gutenberg-mobile#6654) worked as expected.
Looks like there are some linting issues but otherwise looks good to go.
Nice work @fluiddot !
The only remaining |
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 GBM XCFramework.
To test:
Follow testing instructions from wordpress-mobile/gutenberg-mobile#6655.
Regression Notes
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.
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.
What automated tests I added (or what prevented me from doing so)
N/A
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: