fix(cli): doctor recognizes embedded file:// Postgres; quiet bundled-SPA Vite log#1033
Conversation
…SPA Vite log Three dev-experience fixes surfaced by an end-to-end test of the published 9.3.0 CLI from a fresh /tmp install: - doctor: the scaffold default is DATABASE_URL=file://. (embedded PG), but checkDatabaseAndPgvector fed that straight to postgres(), which parses host "." and fails with `getaddrinfo ENOTFOUND .` — so `lobu doctor` false-failed the DB check on every default project. Branch on isExternalDatabaseUrl() and report `local embedded Postgres (data: <root>/.lobu/pgdata)` for the embedded case, reusing the helpers dev.ts already exports. - server (dev-vite): a bundled CLI sets WEB_DIST_DIR to the prebuilt SPA, which the Hono app serves statically. mountViteDev still probed for packages/owletto source, failed, and logged a misleading "frontend will not be available" error stack even though the frontend was being served. Skip Vite (with an info log) when WEB_DIST_DIR is set. - sdk-e2e.sh: add `lobu validate` and `lobu doctor` assertions to the gate. The doctor assertion guards the regression above (no false connect failure on the embedded file:// default); it's mode-aware so an external DATABASE_URL run still connects for real.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR improves local development diagnostics and deployment flexibility. The ChangesCLI and Development Improvements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
bug_free 86, simplicity 91, slop 0, bugs 0, 0 blockers Typecheck/unit passed. [env] integration aborted because DATABASE_URL points at database 'postgres', tripping the test-db safety guard; failing files are not in diff. Explored Full verdict JSON{
"bug_free_confidence": 86,
"bugs": 0,
"slop": 0,
"simplicity": 91,
"blockers": [],
"change_type": "fix",
"behavior_change_risk": "low",
"tests_adequate": true,
"suggested_fixes": [],
"notes": "Typecheck/unit passed. [env] integration aborted because DATABASE_URL points at database 'postgres', tripping the test-db safety guard; failing files are not in diff. Explored `lobu doctor` with DATABASE_URL=file://. (embedded DB ok, no ENOTFOUND) and imported mountViteDev with NODE_ENV=development WEB_DIST_DIR set (returned null/skip).",
"categories": {
"src": 34,
"tests": 22,
"docs": 7,
"config": 6,
"deps": 22,
"migrations": 0,
"ci": 7,
"generated": 0
}
}Local review gate — branch protection can require the |
What
Three dev-experience fixes surfaced while end-to-end testing the published 9.3.0 CLI from a fresh
/tmpinstall (bun install @lobu/cli@9.3.0, embedded Postgres, mock provider — exercising every CLI feature).1.
lobu doctorno longer false-fails the DB check on embedded Postgreslobu initscaffoldsDATABASE_URL=file://.(embedded PG) as the default, butdoctorfed that straight intopostgres(), which parses host"."and dies withgetaddrinfo ENOTFOUND .:So every default project showed a scary DB failure on first
lobu doctor. Now it branches onisExternalDatabaseUrl()(already exported bydev.ts) and reports the embedded backend:2. Quiet the misleading "frontend will not be available" log in
lobu runA bundled CLI sets
WEB_DIST_DIRto the prebuilt SPA, which the Hono app serves statically.mountViteDevstill probed forpackages/owlettosource, failed, and logged a full error stack claiming the frontend was unavailable — even though it was being served fine (HTTP 200). Now it skips Vite (with an info log) whenWEB_DIST_DIRis set.3. Add
validate+doctorcoverage tosdk-e2e.shThe gate now asserts
lobu validateaccepts the fixture config andlobu doctorreports a healthy DB — the doctor assertion guards regression #1 (mode-aware: an externalDATABASE_URLrun still connects for real).Validation
make build-packages+cli buildgreen;tsc --noEmitclean for cli + server.scripts/sdk-e2e.sh(with the new assertions) passes end-to-end, including the two new checks, the apply/prune lifecycle, a real worker turn, connector sync, watcher reaction, idempotent re-apply, and the@lobu/clientSSE round-trip."frontend will not be available"warning is gone; the new"Serving prebuilt SPA from WEB_DIST_DIR"info log appears.All three are pre-existing issues (not introduced by 9.3.0); the published release itself works correctly end-to-end.
Summary by CodeRabbit
New Features
Tests