fix(selfhost): upload self-host source maps to PostHog, not Sentry#8619
Merged
Conversation
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.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/clisteps 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 callsreview-enrichment/scripts/validate-sentry-release.mjs, which #8615 already deleted. Any official release cut since #8615 merged would fail on that step.posthog-cli's simpler inject/upload — no separate release-create/set-commits/finalize calls; PostHog release metadata is a byproduct of the upload itself.review-enrichment/scripts/validate-posthog-release.mjsfor the post-upload validation (same retry-poll pattern the old Sentry validation step used, now pointed at a script that actually exists).SENTRY_RELEASE→POSTHOG_RELEASEthroughoutscripts/deploy-selfhost-prebuilt.sh(the operator-facing local sourcemap upload path) andscripts/selfhost-post-update-check.sh, matching whatsrc/selfhost/posthog.ts'sresolvePostHogReleasealready reads..env.example(self-host has had zeroSENTRY_*code paths since fix(selfhost): replace Sentry with PostHog for error tracking #8617) with the real PostHog vars, plus the CLI-specificPOSTHOG_CLI_API_KEY/POSTHOG_CLI_PROJECT_ID/POSTHOG_CLI_HOSTused only by this upload step.scripts/setup-sentry-datasource.sh— noted as pending removal in both.env.exampleand the operations docs.Required before the next release
POSTHOG_CLI_API_KEY(secret) andPOSTHOG_CLI_PROJECT_ID(variable) are not yet configured in either thereleaseorrelease-betaGitHub environment (confirmed via the API — both currently report zero secrets/variables). The workflow hard-fails ongithub.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— cleannpm run test:cigate (includesactionlinton the modified workflow YAML) — 1153 test files / 21513 tests passed, 0 failuresnpm audit --audit-level=moderate— unaffected (no dependency changes in this PR)