feat(selfhost): prepare Postgres cutover tooling#1986
Conversation
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-01 06:04:32 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 7 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 3492a42 | Commit Preview URL Branch Preview URL |
Jul 01 2026, 05:42 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1986 +/- ##
=======================================
Coverage 95.62% 95.62%
=======================================
Files 218 218
Lines 24317 24317
Branches 8819 8819
=======================================
Hits 23253 23253
Misses 436 436
Partials 628 628 🚀 New features to boost your workflow:
|
pg-queue.ts and sqlite-queue.ts call withOtelSpan for the admission-deferred span (like server.ts does) but import only withReviewSpan, so tsc fails with 'Cannot find name withOtelSpan' on main — #1922 added the calls and #1986 landed close behind, green separately but broken together. Add the missing import from ./otel. Behavior-preserving (the span was already intended); unblocks CI.
Summary
Prepare the self-host stack for a safe SQLite to Postgres cutover without changing the default runtime mode.
What changed
Why
Postgres is the safer backend for higher-concurrency self-host operation, queue claiming, and future multi-instance scaling. This keeps current SQLite deployments untouched until an operator explicitly sets
DATABASE_URLand runs the one-time migration.Validation
git diff --checknpm run db:migrations:checknpm run typechecknpm run ui:typechecknpm run ui:lintnpm run ui:openapi:checknpm run ui:buildnpm run test:coveragenpx vitest run test/unit/selfhost-grafana-reporting.test.tsnpm run selfhost:postgres:migrate -- --help--executecopied sample app and queue rows intopgvector/pg16.sqlite,psql, andpostgresql16-clientare available inalpine:3.20.Notes
--execute.