fix(selfhost): unset POSTHOG_CLI_HOST when blank, don't pass empty#8622
Conversation
posthog-cli treats a present-but-empty POSTHOG_CLI_HOST as an explicit
(invalid) URL rather than "unset, use the default" -- confirmed live:
orb-v3.4.0-beta.8's release build failed with `Oops! Invalid Host: "Host
must be a valid URL"` because the workflow always sets the env var to
`secrets.POSTHOG_CLI_HOST`, which resolves to an empty string (not an
absent var) when the secret doesn't exist. Mirrors the old SENTRY_URL
handling this replaced (`if [ -z "${SENTRY_URL:-}" ]; then unset
SENTRY_URL; fi`). scripts/deploy-selfhost-prebuilt.sh's own
${host:+-e POSTHOG_CLI_HOST=...} already avoided this correctly.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8622 +/- ##
==========================================
+ Coverage 92.76% 93.64% +0.87%
==========================================
Files 797 701 -96
Lines 79355 56878 -22477
Branches 24034 20151 -3883
==========================================
- Hits 73616 53262 -20354
+ Misses 4592 2647 -1945
+ Partials 1147 969 -178
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-25 14:37:34 UTC
Review summary Nits — 3 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
The previous commit's own comment named the old SENTRY_URL var literally,
which trips this file's own docs-selfhost-posthog-release.test.ts
assertion (not.toContain("SENTRY_")) added when Sentry was removed from
this pipeline. Same guard, reworded without the literal substring.
Summary
Third fix in this same chain (#8619 → #8621 → this): confirmed live that
orb-v3.4.0-beta.8's release build failed withOops! Invalid Host: "Host must be a valid URL"fromposthog-cliitself.POSTHOG_CLI_API_KEY/POSTHOG_CLI_PROJECT_IDboth resolved correctly this time (the #8621 fix worked) — butPOSTHOG_CLI_HOSTisn't configured as a secret (US-cloud default, correctly left unset), andsecrets.POSTHOG_CLI_HOSTresolves to an empty string, not an absent variable, when a secret name doesn't exist.posthog-clitreats a present-but-empty host as an explicit invalid URL rather than "use the default."Mirrors the old
SENTRY_URLhandling this pipeline replaced (if [ -z "${SENTRY_URL:-}" ]; then unset SENTRY_URL; fi).scripts/deploy-selfhost-prebuilt.sh's own${host:+-e POSTHOG_CLI_HOST=...}conditional expansion already avoided this correctly — only the GitHub Actions YAML (which has no equivalent conditional-env-inclusion syntax) needed the explicitunset.Test plan
python3 -c "import yaml; yaml.safe_load(...)"— valid YAMLnpm run actionlint— clean