-
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
Changes from 23 commits
d6202c3
1cd609b
804b772
89645c2
edbc5da
481a47d
9f0b36c
c034cc5
6fbfb59
cbc74d2
1b900e2
9ea8dbd
8566c1b
037244d
f4fd4a8
18269e4
e58b8b1
a1a692f
a355e40
d7cbf8b
f2791d6
3f5b7cb
a2259f1
eb83b4c
d496af0
eff477f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,13 @@ | |
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH] | ||
) | ||
|
||
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 | ||
) | ||
Comment on lines
+172
to
+177
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
next unless options[:create_release] | ||
|
||
archive_zip_path = File.join(PROJECT_ROOT_FOLDER, 'WordPress.xarchive.zip') | ||
|
@@ -217,6 +224,13 @@ | |
project_slug: SENTRY_PROJECT_SLUG_JETPACK, | ||
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH] | ||
) | ||
|
||
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 | ||
) | ||
Comment on lines
+228
to
+233
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
end | ||
|
||
# Builds the "WordPress Internal" app and uploads it to App Center | ||
|
@@ -266,6 +280,13 @@ | |
project_slug: SENTRY_PROJECT_SLUG_WORDPRESS, | ||
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH] | ||
) | ||
|
||
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' | ||
) | ||
Comment on lines
+284
to
+289
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
end | ||
|
||
# Builds the WordPress app for a Prototype Build ("WordPress Alpha" scheme), and uploads it to App Center | ||
|
@@ -283,7 +304,8 @@ | |
output_app_name: 'WordPress Alpha', | ||
appcenter_app_name: 'WPiOS-One-Offs', | ||
app_icon: ':wordpress:', # Use Buildkite emoji | ||
sentry_project_slug: SENTRY_PROJECT_SLUG_WORDPRESS | ||
sentry_project_slug: SENTRY_PROJECT_SLUG_WORDPRESS, | ||
app_identifier: 'org.wordpress.alpha' | ||
) | ||
end | ||
|
||
|
@@ -302,7 +324,8 @@ | |
output_app_name: 'Jetpack Alpha', | ||
appcenter_app_name: 'jetpack-installable-builds', | ||
app_icon: ':jetpack:', # Use Buildkite emoji | ||
sentry_project_slug: SENTRY_PROJECT_SLUG_JETPACK | ||
sentry_project_slug: SENTRY_PROJECT_SLUG_JETPACK, | ||
app_identifier: 'com.jetpack.alpha' | ||
) | ||
end | ||
|
||
|
@@ -334,7 +357,8 @@ def generate_prototype_build_number | |
# Builds a Prototype Build for WordPress or Jetpack, then uploads it to App Center and comment with a link to it on the PR. | ||
# | ||
# rubocop:disable Metrics/AbcSize | ||
def build_and_upload_prototype_build(scheme:, output_app_name:, appcenter_app_name:, app_icon:, sentry_project_slug:) | ||
# rubocop:disable Metrics/ParameterLists | ||
def build_and_upload_prototype_build(scheme:, output_app_name:, appcenter_app_name:, app_icon:, sentry_project_slug:, app_identifier:) | ||
configuration = 'Release-Alpha' | ||
|
||
# Get the current build version, and update it if needed | ||
|
@@ -385,6 +409,13 @@ def build_and_upload_prototype_build(scheme:, output_app_name:, appcenter_app_na | |
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH] | ||
) | ||
|
||
upload_gutenberg_sourcemaps( | ||
sentry_project_slug:, | ||
release_version: release_version_current, | ||
build_version: build_number, | ||
app_identifier: | ||
) | ||
|
||
# Post PR Comment | ||
comment_body = prototype_build_details_comment( | ||
app_display_name: output_app_name, | ||
|
@@ -410,6 +441,7 @@ def build_and_upload_prototype_build(scheme:, output_app_name:, appcenter_app_na | |
buildkite_annotate(context: "appcenter-info-#{output_app_name}", style: 'info', message: "#{output_app_name} [App Center Build](#{appcenter_install_url}) Info:\n\n#{list}") | ||
end | ||
# rubocop:enable Metrics/AbcSize | ||
# rubocop:enable Metrics/ParameterLists | ||
|
||
def inject_buildkite_analytics_environment(xctestrun_path:) | ||
require 'plist' | ||
|
@@ -464,4 +496,41 @@ def upload_build_to_app_center( | |
notify_testers: false | ||
) | ||
end | ||
|
||
def upload_gutenberg_sourcemaps(sentry_project_slug:, release_version:, build_version:, app_identifier:) | ||
# 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') | ||
|
||
Dir.mktmpdir do |sourcemaps_folder| | ||
# It's important that the bundle and source map files have specific names, otherwise, Sentry | ||
# won't symbolicate the stack traces. | ||
FileUtils.cp(File.join(gutenberg_bundle, 'App.js'), File.join(sourcemaps_folder, 'main.jsbundle')) | ||
FileUtils.cp(File.join(gutenberg_bundle, 'App.composed.js.map'), File.join(sourcemaps_folder, 'main.jsbundle.map')) | ||
|
||
# To generate the full release version string to attach the source maps, we need to specify: | ||
# - App identifier | ||
# - Release version | ||
# - Build version | ||
# This conforms to the following format: <app_identifier>@<release_version>+<build_version> | ||
# Here are a couple of examples: | ||
# - Prototype build: [email protected]+pr22654-07765b3 | ||
# - App Store build: [email protected]+24.1.0.3 | ||
|
||
sentry_upload_sourcemap( | ||
auth_token: get_required_env('SENTRY_AUTH_TOKEN'), | ||
org_slug: SENTRY_ORG_SLUG, | ||
project_slug: sentry_project_slug, | ||
version: release_version, | ||
dist: build_version, | ||
build: build_version, | ||
app_identifier:, | ||
# When the React native bundle is generated, the source map file references | ||
# include the local machine path, with the `rewrite` and `strip_common_prefix` | ||
# options Sentry automatically strips this part. | ||
rewrite: true, | ||
strip_common_prefix: true, | ||
sourcemap: sourcemaps_folder | ||
) | ||
end | ||
end | ||
end |
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.