mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 05:12:33 +00:00
fix(sentry): auto-send React events; collapse core→tauri for desktop (#1086)
Co-authored-by: Steven Enamakel <enamakel@tinyhumans.ai>
This commit is contained in:
co-authored by
Steven Enamakel
parent
1a30a0ab4d
commit
a084ebf45c
@@ -280,6 +280,10 @@ jobs:
|
||||
CORE_MANIFEST: ${{ steps.core-paths.outputs.core_manifest }}
|
||||
CORE_BIN_NAME: ${{ steps.core-paths.outputs.core_bin_name }}
|
||||
OPENHUMAN_APP_ENV: staging
|
||||
# Bake the short SHA into the CLI binary so build_release_tag() in
|
||||
# src/main.rs produces openhuman@<version>+<sha> — matching the
|
||||
# Sentry release tag used when uploading the standalone CLI symbols.
|
||||
OPENHUMAN_BUILD_SHA: ${{ needs.prepare-build.outputs.short_sha }}
|
||||
- name: Stage sidecar for Tauri bundler
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -331,24 +335,31 @@ jobs:
|
||||
run: |
|
||||
NODE_OPTIONS="--max-old-space-size=8192" cargo tauri build --debug -c "$TAURI_CONFIG_OVERRIDE" $MATRIX_ARGS
|
||||
|
||||
# Upload Rust debug info to Sentry so backend + Tauri-shell stack
|
||||
# traces symbolicate in the staging Sentry project too. Frontend
|
||||
# source maps are handled by sentry-vite-plugin in the build step
|
||||
# above; this is the Rust half. Symbols are keyed by debug-ID, so
|
||||
# it's safe to run per-matrix-target without collisions — Sentry
|
||||
# merges artifacts across platforms.
|
||||
- name: Upload core sidecar debug symbols to Sentry
|
||||
# Upload Rust debug info to Sentry so all Rust stack traces
|
||||
# symbolicate in the staging Sentry projects. Frontend source maps
|
||||
# are handled by sentry-vite-plugin in the build step above; this
|
||||
# is the Rust half.
|
||||
#
|
||||
# Two distinct binaries → two distinct Sentry projects:
|
||||
# - **Tauri shell** (`app/src-tauri/target/<triple>/debug`) — the
|
||||
# actual desktop app users run. Core lives in-process here as a
|
||||
# linked path dep, so the shell's DWARF covers core code too.
|
||||
# Events all route to `openhuman-tauri` (one `sentry::init` per
|
||||
# process, in `app/src-tauri/src/lib.rs::run()`).
|
||||
# - **Standalone CLI** (`target/<triple>/debug`) — the separate
|
||||
# `openhuman-core` binary built by "Build sidecar core binary".
|
||||
# Has its own `sentry::init` in `src/main.rs` and reports to
|
||||
# `openhuman-core`. Currently unused at runtime in the desktop
|
||||
# build but kept symbolicated for any operator running it.
|
||||
# Symbols are keyed by debug-ID so cross-platform / cross-binary
|
||||
# uploads don't collide — Sentry just merges them.
|
||||
- name: Upload Tauri shell debug symbols to Sentry (tauri project)
|
||||
if: env.SENTRY_AUTH_TOKEN != ''
|
||||
shell: bash
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
|
||||
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT_CORE }}
|
||||
# Must match the release tag the running core binary reports
|
||||
# (`openhuman@<version>+<short_sha>`, see `build_release_tag` in
|
||||
# src/main.rs). Uses short_sha (12 chars) — see the prepare-build
|
||||
# outputs comment. If this drifts, DIFs attach to a different
|
||||
# release than events and stack traces stay un-symbolicated.
|
||||
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT_TAURI }}
|
||||
SENTRY_RELEASE:
|
||||
openhuman@${{ needs.prepare-build.outputs.version }}+${{
|
||||
needs.prepare-build.outputs.short_sha }}
|
||||
@@ -356,26 +367,35 @@ jobs:
|
||||
MATRIX_TARGET: ${{ matrix.settings.target }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Two DIF locations on staging:
|
||||
# - `app/src-tauri/target/<triple>/debug` — Tauri shell binary
|
||||
# (which links the core as a path dep, so its DWARF covers core
|
||||
# too).
|
||||
# - `target/<triple>/debug` — standalone `openhuman-core` CLI
|
||||
# binary built by the "Build sidecar core binary" step earlier
|
||||
# and published as a separate artifact. Crashes from operators
|
||||
# running the standalone CLI need its DIFs to symbolicate.
|
||||
# Symbols are keyed by debug-ID so cross-platform / cross-binary
|
||||
# uploads don't collide — Sentry just merges them.
|
||||
for dif_dir in \
|
||||
"app/src-tauri/target/${MATRIX_TARGET}/debug" \
|
||||
"target/${MATRIX_TARGET}/debug"; do
|
||||
if [ -d "$dif_dir" ]; then
|
||||
echo "==> Uploading symbols from $dif_dir to ${SENTRY_PROJECT}"
|
||||
bash scripts/upload_sentry_symbols.sh "$VERSION" "$dif_dir"
|
||||
else
|
||||
echo "==> Skipping $dif_dir (not present)"
|
||||
fi
|
||||
done
|
||||
dif_dir="app/src-tauri/target/${MATRIX_TARGET}/debug"
|
||||
if [ -d "$dif_dir" ]; then
|
||||
echo "==> Uploading symbols from $dif_dir to ${SENTRY_PROJECT}"
|
||||
bash scripts/upload_sentry_symbols.sh "$VERSION" "$dif_dir"
|
||||
else
|
||||
echo "==> Skipping $dif_dir (not present)"
|
||||
fi
|
||||
|
||||
- name: Upload standalone core CLI debug symbols to Sentry (core project)
|
||||
if: env.SENTRY_AUTH_TOKEN != ''
|
||||
shell: bash
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
|
||||
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT_CORE }}
|
||||
SENTRY_RELEASE:
|
||||
openhuman@${{ needs.prepare-build.outputs.version }}+${{
|
||||
needs.prepare-build.outputs.short_sha }}
|
||||
VERSION: ${{ needs.prepare-build.outputs.version }}
|
||||
MATRIX_TARGET: ${{ matrix.settings.target }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
dif_dir="target/${MATRIX_TARGET}/debug"
|
||||
if [ -d "$dif_dir" ]; then
|
||||
echo "==> Uploading symbols from $dif_dir to ${SENTRY_PROJECT}"
|
||||
bash scripts/upload_sentry_symbols.sh "$VERSION" "$dif_dir"
|
||||
else
|
||||
echo "==> Skipping $dif_dir (not present)"
|
||||
fi
|
||||
|
||||
- name: Upload staging desktop bundles
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
@@ -514,14 +514,19 @@ jobs:
|
||||
NODE_OPTIONS="--max-old-space-size=8192" cargo tauri build -c "$TAURI_CONFIG_OVERRIDE" $MATRIX_ARGS
|
||||
fi
|
||||
|
||||
# Upload Rust debug info to Sentry so backend + Tauri-shell stack traces
|
||||
# symbolicate in production. The frontend source maps are handled by
|
||||
# sentry-vite-plugin in the build step above; this is the Rust half.
|
||||
# Core sidecar and Tauri shell go to **separate Sentry projects**
|
||||
# (matching their separate DSNs) so events show up in the right place.
|
||||
# Symbols are keyed by debug-ID, so it's safe to run per-matrix-target
|
||||
# without collisions — Sentry merges artifacts across platforms.
|
||||
- name: Upload core sidecar debug symbols to Sentry
|
||||
# Upload Rust debug info to Sentry so all Rust stack traces (Tauri
|
||||
# shell + linked-in core) symbolicate in production. The frontend
|
||||
# source maps are handled by sentry-vite-plugin in the build step
|
||||
# above; this is the Rust half.
|
||||
#
|
||||
# Since #1061 the core lives in-process as a library linked into the
|
||||
# Tauri shell binary — there is exactly one Rust process and one
|
||||
# `sentry::init` call (in `app/src-tauri/src/lib.rs::run()`), so all
|
||||
# Rust events route to `openhuman-tauri`. Upload DIFs to that same
|
||||
# project so they actually attach to the right events. Symbols are
|
||||
# keyed by debug-ID, so it's safe to run per-matrix-target without
|
||||
# collisions — Sentry merges artifacts across platforms.
|
||||
- name: Upload Rust debug symbols to Sentry (tauri project)
|
||||
if:
|
||||
needs.prepare-build.outputs.release_enabled == 'true' && env.SENTRY_AUTH_TOKEN
|
||||
!= ''
|
||||
@@ -529,12 +534,13 @@ jobs:
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
|
||||
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT_CORE }}
|
||||
# Must match the release tag the running core binary reports
|
||||
# (`openhuman@<version>+<short_sha>`, see `build_release_tag` in
|
||||
# src/main.rs). Uses short_sha (12 chars) — see the prepare-build
|
||||
# outputs comment. If this drifts, DIFs attach to a different
|
||||
# release than events and stack traces stay un-symbolicated.
|
||||
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT_TAURI }}
|
||||
# Must match the release tag the running binary reports
|
||||
# (`openhuman@<version>+<short_sha>`, see `build_sentry_release_tag`
|
||||
# in `app/src-tauri/src/lib.rs`). Uses short_sha (12 chars) — see
|
||||
# the prepare-build outputs comment. If this drifts, DIFs attach
|
||||
# to a different release than events and stack traces stay
|
||||
# un-symbolicated.
|
||||
SENTRY_RELEASE:
|
||||
openhuman@${{ needs.prepare-build.outputs.version }}+${{
|
||||
needs.prepare-build.outputs.short_sha }}
|
||||
@@ -545,12 +551,12 @@ jobs:
|
||||
# Core is linked into the Tauri binary as a path dep, so all Rust
|
||||
# debug info — core + shell — lives under the shell's target dir.
|
||||
# upload-dif scans recursively.
|
||||
deps_dir="app/src-tauri/target/${MATRIX_TARGET}/release/deps"
|
||||
if [ -d "$deps_dir" ]; then
|
||||
echo "==> Uploading symbols from $deps_dir to ${SENTRY_PROJECT}"
|
||||
bash scripts/upload_sentry_symbols.sh "$VERSION" "$deps_dir"
|
||||
dif_dir="app/src-tauri/target/${MATRIX_TARGET}/release"
|
||||
if [ -d "$dif_dir" ]; then
|
||||
echo "==> Uploading symbols from $dif_dir to ${SENTRY_PROJECT}"
|
||||
bash scripts/upload_sentry_symbols.sh "$VERSION" "$dif_dir"
|
||||
else
|
||||
echo "==> Skipping $deps_dir (not present)"
|
||||
echo "==> Skipping $dif_dir (not present)"
|
||||
fi
|
||||
|
||||
# tauri-action previously uploaded non-macOS installer assets directly
|
||||
|
||||
Reference in New Issue
Block a user