feat(control-plane): wire tenant containers to the central PostHog key#8601
Conversation
|
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 #8601 +/- ##
==========================================
- Coverage 92.54% 91.99% -0.56%
==========================================
Files 796 796
Lines 79855 79874 +19
Branches 24136 24138 +2
==========================================
- Hits 73905 73479 -426
- Misses 4804 5312 +508
+ Partials 1146 1083 -63
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-25 02:19:52 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionPartially addressed 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.
|
What
Wire the hosted fleet to report to the central PostHog project (#7875): every tenant container
the control-plane starts now carries the central project key, so the self-host image's own error
tracking points at the loopover-owned project instead of nothing. Reuses the existing tenant-env
injection seam (the same mechanism
PINNED_VERSION_ENV_VAR#4898 andTENANT_SECRET_ENV_VAR#8202 already use) rather than inventing a new one — the key is a control-plane secret, injected
into
envVarsat the single point in a container's lifecycle where env vars are applied.Change (
control-plane/only, additive)container-driver.ts: newCENTRAL_POSTHOG_KEY_ENV_VAR(LOOPOVER_CENTRAL_POSTHOG_KEY,product-agnostic like its siblings) + optional
centralPosthogKeyonContainerDriverConfig.createTenantContainerinjects it intoenvVarswhen set, merged with any per-tenant vars.driver-factory.ts: threadsenv.CENTRAL_POSTHOG_KEY(via the existingnonBlankguard)into the real container driver's config; blank/unset ⇒ omitted.
worker.ts: forwardsenv.CENTRAL_POSTHOG_KEYintocreateTenantProvisioningDriver.env.d.ts: declares theCENTRAL_POSTHOG_KEY?secret.index.ts: re-exports the new env-var constant.Absent key ⇒ byte-identical tenant behavior (no env var injected). Self-host / operator-set
key behavior is untouched — this is additive for the hosted path only.
Validation
CENTRAL_POSTHOG_KEY_ENV_VAR; it merges withpinned-version + bootstrap-secret vars into one
start()call;createTenantProvisioningDriverthreads it from
env; a blank value is omitted (tenant start byte-identical).npm run control-plane:test→ 205/205 pass (build + node:test). Both branches of the newkey-present / key-absent logic covered.
Closes #7876