Compare commits

..
2 Commits
Author SHA1 Message Date
openhands 8c47c3c158 test(catalog): add read-only live audit consistency harness
CI / check (push) Successful in 1m12s
CI / deploy (push) Successful in 1m26s
Runs the full catalog audit (runCatalogAudit) against the live hotel DB with
no repair/sql options — a pure read pass — and cross-checks the emitted
summary against independent DB + asset-dir measurements: row totals, duplicate
classname groups, orphaned catalog references and missing catalog / nitro /
icon counts must match exactly, with zero error events and a final
'batch_complete'.

Guarded by RUN_CATALOG_AUDIT_LIVE=1 so CI never runs it; loads the real .env
because vitest fakes DATABASE_URL.
2026-09-07 17:13:44 +02:00
openhands 2650d325ec fix(scripts): drop unlisted dotenv dep in schema generator
generate-drizzle-schema.mjs imported 'dotenv/config' but dotenv is not a
dependency, failing knip and crashing 'pnpm db:schema:generate'. Load .env
with Node's built-in process.loadEnvFile like the other scripts do
(scripts/load-env.ts), never overriding vars already set in the shell.
2026-09-07 17:13:34 +02:00
2 changed files with 229 additions and 2 deletions

No files matched your search

+8 -2
View File
@@ -8,8 +8,7 @@
// drizzle-kit (`pnpm db:generate` / studio / introspect) is draft/browse tooling only.
//
// Usage: pnpm db:schema:generate
import "dotenv/config";
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
@@ -31,6 +30,13 @@ const ROOT = resolve(__dirname, "..");
const SCHEMA_TS = resolve(ROOT, "src/db/schema.ts");
const OUT = SCHEMA_TS;
// Load .env like the TS scripts do (process.loadEnvFile never overrides
// variables already present in the shell).
for (const name of [".env.local", ".env"]) {
const file = resolve(ROOT, name);
if (existsSync(file)) process.loadEnvFile(file);
}
// ---------- Parse existing Drizzle schema (naming source of truth) ----------
const schemaSource = readFileSync(SCHEMA_TS, "utf-8");
File diff suppressed because it is too large. Load diff