fix: freeze dev ports and edge health
This commit is contained in:
@@ -3,7 +3,7 @@ import { constants as fsConstants } from "node:fs";
|
||||
import { access, readFile, writeFile } from "node:fs/promises";
|
||||
import { request as httpRequest } from "node:http";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { spawn } from "node:child_process";
|
||||
|
||||
import {
|
||||
@@ -470,30 +470,40 @@ async function checkCloudApiDb(deploy, workloads, blockers) {
|
||||
);
|
||||
}
|
||||
|
||||
let health = null;
|
||||
try {
|
||||
const modulePath = pathToFileURL(path.join(repoRoot, "internal/cloud/server.mjs")).href;
|
||||
const { buildHealthPayload } = await import(modulePath);
|
||||
health = buildHealthPayload();
|
||||
if (health.db?.ready !== true) {
|
||||
addBlocker(
|
||||
blockers,
|
||||
"runtime_blocker",
|
||||
"cloud-api-db",
|
||||
`cloud-api health reports DB config blocked; missing ${health.db?.missingEnv?.join(", ") ?? "unknown DB env"}`
|
||||
);
|
||||
const configReady = missingManifest.length === 0 && missingK8s.length === 0 && missingSecretRefs.length === 0;
|
||||
const health = {
|
||||
status: configReady ? "degraded" : "blocked",
|
||||
ready: false,
|
||||
configReady,
|
||||
connected: false,
|
||||
connectionChecked: false,
|
||||
fields: requiredEnv.map((env) => ({
|
||||
name: env.name,
|
||||
present: env.manifestPresent && env.k8sPresent && (!env.secretRef || env.secretRef.present),
|
||||
redacted: env.redacted
|
||||
})),
|
||||
missingEnv: uniqueStrings([...missingManifest, ...missingK8s]),
|
||||
secretRefs: requiredEnv
|
||||
.filter((env) => env.secretRef)
|
||||
.map((env) => ({
|
||||
env: env.name,
|
||||
secretName: env.secretRef.secretName,
|
||||
secretKey: env.secretRef.secretKey,
|
||||
present: env.secretRef.present,
|
||||
redacted: true
|
||||
})),
|
||||
safety: {
|
||||
liveDbEvidence: false
|
||||
}
|
||||
} catch (error) {
|
||||
addBlocker(blockers, "observability_blocker", "cloud-api-health", `Cannot inspect cloud-api health payload: ${error.message}`);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
status: missingManifest.length === 0 && missingK8s.length === 0 && missingSecretRefs.length === 0 ? "contract-ready" : "contract-blocked",
|
||||
status: configReady ? "contract-ready" : "contract-blocked",
|
||||
requiredEnv,
|
||||
missingManifest,
|
||||
missingK8s,
|
||||
missingSecretRefs,
|
||||
runtimeHealth: health?.db ? summarizeDbContract(health.db) : null,
|
||||
runtimeHealth: summarizeDbContract(health),
|
||||
secretMaterialRead: false,
|
||||
valuesRedacted: true,
|
||||
liveDbEvidence: false,
|
||||
|
||||
Reference in New Issue
Block a user