Migrate harness from in-memory stores to CloudNativePG
Some checks failed
CI / lint-and-test (push) Successful in 22s
Deploy Production / deploy (push) Failing after 21s
CI / build (push) Failing after 1m51s

Replace all in-memory Map-backed stores (credentials, models, agents,
tasks, iterations, usage) with Drizzle ORM queries against the
homelab-pg PostgreSQL cluster. All store functions are now async.

- Add 6 harness_* tables to @homelab/db schema
- Generate and apply initial Drizzle migration
- Add lazy DB connection proxy to avoid build-time errors
- Wire DATABASE_URL from sealed secret into harness deployment
- Update all API routes, orchestrator, executor, and boot to await
  async store operations
This commit is contained in:
Julia McGhee
2026-03-21 20:17:00 +00:00
parent df351439d6
commit 3fe75a8e04
28 changed files with 1245 additions and 304 deletions

View File

@@ -1,4 +1,4 @@
import { getCredentialsByProvider } from "./credentials";
import { getRawCredentialsByProvider } from "./credentials";
export interface RepoResult {
provider: "github" | "gitlab";
@@ -21,7 +21,7 @@ export async function searchRepos(query: string): Promise<RepoResult[]> {
}
async function searchGitHub(query: string): Promise<RepoResult[]> {
const creds = getCredentialsByProvider("github");
const creds = await getRawCredentialsByProvider("github");
if (creds.length === 0) return [];
const results: RepoResult[] = [];
@@ -61,7 +61,7 @@ async function searchGitHub(query: string): Promise<RepoResult[]> {
}
async function searchGitLab(query: string): Promise<RepoResult[]> {
const creds = getCredentialsByProvider("gitlab");
const creds = await getRawCredentialsByProvider("gitlab");
if (creds.length === 0) return [];
const results: RepoResult[] = [];