Skip to content

build: upload GutenbergKit source maps to Sentry#25800

Draft
dcalhoun wants to merge 4 commits into
trunkfrom
build/upload-gutenbergkit-sentry-sourcemaps
Draft

build: upload GutenbergKit source maps to Sentry#25800
dcalhoun wants to merge 4 commits into
trunkfrom
build/upload-gutenbergkit-sentry-sourcemaps

Conversation

@dcalhoun

Copy link
Copy Markdown
Member

Description

GutenbergKit editor exceptions currently surface in Sentry with minified,
unreadable JS frames (e.g. editor-CZ39QhNu.js:1:326003, see
JETPACK-IOS-1KAQ). This makes
them hard to triage.

GutenbergKit produces the editor JS but the host app publishes the exceptions to
Sentry, so the host must upload GutenbergKit's source maps — exactly as we
already do for the React Native (gutenberg-mobile) bundle via
upload_gutenberg_sourcemaps. GutenbergKit now publishes its source maps
alongside its XCFramework
(GutenbergKit#554);
this PR fetches and uploads them.

How it works

  • New upload_gutenberg_kit_sourcemaps fastlane helper resolves the
    GutenbergKit version from Modules/Package.resolved, downloads the matching
    GutenbergKitSourceMaps.zip from the CDN, and uploads it to Sentry.
  • Because the editor JS runs inside the host app, its exceptions carry the host
    app's release/dist, so the maps upload under the same
    <app_identifier>@<release_version>+<build_version> coordinates as the RN
    maps, with rewrite/strip_common_prefix.
  • Wired into the same App Store, prototype, and TestFlight lanes that already
    upload the RN source maps.
  • The version resolver also handles a pr-build/<N> snapshot-branch pin
    (mapping to gutenbergkit/pr-builds/<N>/) so the pipeline can be verified
    against a GutenbergKit PR build before a release exists.
  • The upload is best-effort: a GutenbergKit version without published maps is
    logged and skipped rather than failing the build.

This is the iOS half of a cross-repo effort; a follow-up will add the equivalent
to WordPress-Android.

Note

Depends on GutenbergKit#554
(produces + publishes the maps). Draft until that lands and end-to-end
symbolication is verified against a prototype build.

Testing instructions

Verified locally: rubocop passes and fastlane lanes loads with no errors.
The version resolver was unit-tested against both a released-version pin and a
pr-build/<N> branch pin.

End-to-end verification (in progress): pin GutenbergKit to PR #554's
pr-build/554 branch, run a prototype build, trigger a GutenbergKit editor
exception, and confirm the resulting Sentry event de-minifies. sentry-cli sourcemaps explain <event-id> confirms the release/dist match.

@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number33267
VersionPR #25800
Bundle IDorg.wordpress.alpha
Commit6da41d9
Installation URL2uv4tgjbek4rg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number33267
VersionPR #25800
Bundle IDcom.jetpack.alpha
Commit6da41d9
Installation URL2og17ikh8oq5g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

dcalhoun added a commit that referenced this pull request Jul 17, 2026
Prototype builds set `VERSION_SHORT` to `pr_or_branch`, so the app's runtime
Sentry release is `<app_identifier>@<pr_or_branch>+<build_number>` (e.g.
`com.jetpack.alpha@PR #25800+33210`). The source-map uploads were keyed to
`release_version_current` (the marketing version, e.g. `27.0`), which never
matches that runtime release — so prototype-build events stayed unsymbolicated.

Pass `pr_or_branch` as the release version for both the GutenbergKit and the
existing React Native source-map uploads on prototype builds. This fixes
GutenbergKit symbolication and also a pre-existing gap in the React Native
prototype upload.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dcalhoun and others added 4 commits July 20, 2026 10:21
GutenbergKit editor exceptions currently surface in Sentry with minified,
unreadable frames. GutenbergKit now publishes its JS source maps alongside its
XCFramework, so fetch them (by the resolved GutenbergKit version) and upload
them to Sentry during the app builds — mirroring how `upload_gutenberg_sourcemaps`
handles the React Native bundle.

Because GutenbergKit's editor JS runs inside the host app, its exceptions carry
the host app's release/dist, so the maps upload under the same
`<app_identifier>@<release_version>+<build_version>` coordinates. The maps are
fetched from the CDN rather than the XCFramework because SwiftPM binary-target
contents aren't surfaced to the app build. The upload is best-effort: a
GutenbergKit version published before its source-map feature simply has no
artifact to fetch, so it's logged and skipped.

Wired into the same App Store, prototype, and TestFlight lanes that already
upload the React Native source maps.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Support host builds that pin GutenbergKit to a `pr-build/<N>` snapshot branch,
not only released versions. Derive the CDN path segment from the resolved pin:
a released `version` maps to `gutenbergkit/<version>/`, while a `pr-build/<N>`
branch maps to `gutenbergkit/pr-builds/<N>/` (where PR builds publish their
maps). This lets us verify the pipeline against a GutenbergKit PR build before a
release exists. Unrelated branches and bare revisions have no published maps, so
they skip gracefully.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Prototype builds set `VERSION_SHORT` to `pr_or_branch`, so the app's runtime
Sentry release is `<app_identifier>@<pr_or_branch>+<build_number>` (e.g.
`com.jetpack.alpha@PR #25800+33210`). The source-map uploads were keyed to
`release_version_current` (the marketing version, e.g. `27.0`), which never
matches that runtime release — so prototype-build events stayed unsymbolicated.

Pass `pr_or_branch` as the release version for both the GutenbergKit and the
existing React Native source-map uploads on prototype builds. This fixes
GutenbergKit symbolication and also a pre-existing gap in the React Native
prototype upload.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Conform GutenbergKit's `GutenbergJSException.DebugImage` to the crash-logging
service's `JSDebugImage` protocol, so the editor's source-map Debug IDs reach the
Sentry event's `debug_meta`. This lets Sentry symbolicate GutenbergKit editor
exceptions by Debug ID, independent of the WebView's on-device file paths.

The existing `JSException` conformance picks up the debug images automatically
via the protocol's associated type; the legacy React Native path is unaffected
(it provides no debug images and uses the empty default).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dcalhoun
dcalhoun force-pushed the build/upload-gutenbergkit-sentry-sourcemaps branch from 6da41d9 to 12bfd75 Compare July 20, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants