Skip to content

fix(selfhost): upload self-host source maps to PostHog, not Sentry#8619

Merged
JSONbored merged 1 commit into
mainfrom
claude/selfhost-posthog-sourcemaps
Jul 25, 2026
Merged

fix(selfhost): upload self-host source maps to PostHog, not Sentry#8619
JSONbored merged 1 commit into
mainfrom
claude/selfhost-posthog-sourcemaps

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Companion to #8617: self-host's error tracking already replaced Sentry with PostHog, but nothing uploaded source maps to PostHog — the release pipeline still ran the old @sentry/cli steps against a Sentry project the code no longer reports to. Any real PostHog error from self-host would have shown unsymbolicated minified stack traces.

Also fixes a currently-broken step: .github/workflows/release-selfhost.yml's "Validate Sentry release" step calls review-enrichment/scripts/validate-sentry-release.mjs, which #8615 already deleted. Any official release cut since #8615 merged would fail on that step.

  • Replaced the release workflow's inject/upload/finalize Sentry steps with posthog-cli's simpler inject/upload — no separate release-create/set-commits/finalize calls; PostHog release metadata is a byproduct of the upload itself.
  • Reused review-enrichment/scripts/validate-posthog-release.mjs for the post-upload validation (same retry-poll pattern the old Sentry validation step used, now pointed at a script that actually exists).
  • Renamed SENTRY_RELEASEPOSTHOG_RELEASE throughout scripts/deploy-selfhost-prebuilt.sh (the operator-facing local sourcemap upload path) and scripts/selfhost-post-update-check.sh, matching what src/selfhost/posthog.ts's resolvePostHogRelease already reads.
  • Replaced the stale "Sentry error tracking" block in .env.example (self-host has had zero SENTRY_* code paths since fix(selfhost): replace Sentry with PostHog for error tracking #8617) with the real PostHog vars, plus the CLI-specific POSTHOG_CLI_API_KEY/POSTHOG_CLI_PROJECT_ID/POSTHOG_CLI_HOST used only by this upload step.
  • Deferred (independent, task-tracked separately): the Grafana Sentry-issues dashboard and scripts/setup-sentry-datasource.sh — noted as pending removal in both .env.example and the operations docs.

Required before the next release

POSTHOG_CLI_API_KEY (secret) and POSTHOG_CLI_PROJECT_ID (variable) are not yet configured in either the release or release-beta GitHub environment (confirmed via the API — both currently report zero secrets/variables). The workflow hard-fails on github.repository == 'JSONbored/loopover' without them, mirroring the old Sentry gate's behavior. These need to be added under Settings → Environments before cutting the next official or beta image.

Test plan

  • npm run typecheck — clean
  • Full npm run test:ci gate (includes actionlint on the modified workflow YAML) — 1153 test files / 21513 tests passed, 0 failures
  • npm audit --audit-level=moderate — unaffected (no dependency changes in this PR)

Replaces the self-host release pipeline's @sentry/cli sourcemap inject/
upload/finalize steps with posthog-cli's simpler inject/upload (no
separate release-create/set-commits/finalize lifecycle -- PostHog release
metadata is a byproduct of the upload itself). Fixes a currently-broken
step in the process: "Validate Sentry release" called
review-enrichment/scripts/validate-sentry-release.mjs, which #8615 already
deleted -- any official release cut since then would have failed there.

Renames SENTRY_RELEASE -> POSTHOG_RELEASE throughout
scripts/deploy-selfhost-prebuilt.sh (the operator-facing local sourcemap
upload path) and scripts/selfhost-post-update-check.sh, matching what
src/selfhost/posthog.ts's resolvePostHogRelease already reads. Replaces
the stale "Sentry error tracking" block in .env.example (self-host has had
zero SENTRY_* code paths since #8617) with the real PostHog vars, plus the
CLI-specific POSTHOG_CLI_API_KEY/POSTHOG_CLI_PROJECT_ID/POSTHOG_CLI_HOST
used only by this upload step.

Requires POSTHOG_CLI_API_KEY (secret) and POSTHOG_CLI_PROJECT_ID (var) to
be configured in the release and release-beta GitHub environments before
the next official/beta image build -- neither exists yet.
@JSONbored JSONbored self-assigned this Jul 25, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored
JSONbored merged commit 49ba70f into main Jul 25, 2026
1 check passed
@JSONbored
JSONbored deleted the claude/selfhost-posthog-sourcemaps branch July 25, 2026 12:21
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant