@celilo/cli 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CELILO_CORE_MODULES.md +5 -4
- package/CELILO_SUBSYSTEMS.md +34 -2
- package/drizzle/0024_module_pause.sql +20 -0
- package/drizzle/meta/_journal.json +8 -1
- package/package.json +5 -6
- package/src/__integration__/container-services-cli.integration.test.ts +8 -2
- package/src/api/remote-client.test.ts +6 -5
- package/src/api/serve.ts +41 -7
- package/src/api-clients/proxmox.ts +34 -0
- package/src/cli/commands/alerts-sweep.ts +2 -0
- package/src/cli/commands/events.test.ts +66 -0
- package/src/cli/commands/events.ts +106 -3
- package/src/cli/commands/module-deploy.ts +2 -2
- package/src/cli/commands/module-health.ts +1 -0
- package/src/cli/commands/module-import.ts +3 -3
- package/src/cli/commands/module-list.ts +12 -1
- package/src/cli/commands/module-pause.ts +317 -0
- package/src/cli/commands/module-remove.ts +78 -40
- package/src/cli/commands/module-status.ts +3 -4
- package/src/cli/commands/module-update.test.ts +1 -1
- package/src/cli/commands/proxmox-template-selection.ts +1 -1
- package/src/cli/commands/status.ts +25 -3
- package/src/cli/completion.ts +5 -0
- package/src/cli/fuel-gauge.ts +4 -4
- package/src/cli/index.ts +49 -20
- package/src/cli/json-output.test.ts +162 -0
- package/src/cli/prompts.ts +53 -74
- package/src/cli/service-credential.ts +3 -3
- package/src/cli/stdout-is-undecorated.test.ts +94 -0
- package/src/cli/types.ts +7 -2
- package/src/db/schema.ts +73 -15
- package/src/hooks/run-named-hook.ts +28 -0
- package/src/services/alerting/suppression.test.ts +5 -0
- package/src/services/alerting/suppression.ts +18 -1
- package/src/services/alerting/sweep-runner.test.ts +1 -0
- package/src/services/alerting/sweep-runner.ts +11 -1
- package/src/services/bus-interview.ts +2 -2
- package/src/services/bus-secret-flow.test.ts +1 -1
- package/src/services/dns-registrations.ts +12 -0
- package/src/services/fleet-checks.test.ts +46 -0
- package/src/services/fleet-checks.ts +63 -6
- package/src/services/module-deploy.ts +1 -1
- package/src/services/module-pause-observability.test.ts +224 -0
- package/src/services/module-pause-quiescence.test.ts +163 -0
- package/src/services/module-pause.test.ts +573 -0
- package/src/services/module-pause.ts +544 -0
- package/src/services/remove-guard.test.ts +175 -0
- package/src/services/remove-guard.ts +109 -0
- package/src/services/terminal-responder.ts +16 -16
- package/src/services/update/dep-graph.test.ts +33 -4
- package/src/services/update/dep-graph.ts +39 -17
- package/src/services/zone-detector.ts +2 -39
- package/src/test-utils/cli.ts +15 -14
- package/src/test-utils/integration-guard.ts +26 -0
- package/src/test-utils/setup-test-db.ts +13 -23
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { unlink } from 'node:fs/promises';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
3
|
import { migrate } from 'drizzle-orm/bun-sqlite/migrator';
|
|
5
|
-
import { type DbClient, createDbClient } from '../db/client';
|
|
4
|
+
import { type DbClient, createDbClient, findMigrationsFolder } from '../db/client';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
for (const candidate of candidates) {
|
|
20
|
-
const metaPath = join(candidate, 'meta', '_journal.json');
|
|
21
|
-
if (existsSync(metaPath)) {
|
|
22
|
-
return candidate;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
throw new Error(`Could not find drizzle migrations folder. Tried: ${candidates.join(', ')}`);
|
|
27
|
-
}
|
|
6
|
+
// `findMigrationsFolder` is imported from db/client rather than redefined here.
|
|
7
|
+
// This file used to carry its own copy, and the copy had drifted: it listed
|
|
8
|
+
// only CWD-RELATIVE candidates (`./drizzle`, `process.cwd()/drizzle`, …) and was
|
|
9
|
+
// missing the `join(currentDir, '../../drizzle')` fallback that resolves
|
|
10
|
+
// relative to the source file.
|
|
11
|
+
//
|
|
12
|
+
// The effect was invisible from `apps/celilo` and total from the repo root —
|
|
13
|
+
// which is where CLAUDE.md says to run the gate. Every suite using
|
|
14
|
+
// setupTestDatabase threw here, left `db` unassigned, and then failed again in
|
|
15
|
+
// its own afterEach on `db.$client`, so one missing path candidate presented as
|
|
16
|
+
// hundreds of unrelated-looking assertion failures (celilo: 668 across the
|
|
17
|
+
// repo, 341 in apps/celilo/src alone).
|
|
28
18
|
|
|
29
19
|
/**
|
|
30
20
|
* Setup test database with real migrations
|