chore: remove acceptance debug channels from the P2 operator path

This commit is contained in:
2026-08-11 20:04:04 +02:00
parent 7aaffe6e68
commit de5de36f9a
4 changed files with 3 additions and 29 deletions
-2
View File
@@ -780,8 +780,6 @@ async function writeInstallationFiles(ctx) {
"workspace-maintenance": { "workspace-maintenance": {
image: ctx.coreImageTag, image: ctx.coreImageTag,
environment: { environment: {
P2_CHILD_DEBUG: "1",
THT_P2_DEBUG: "1",
THT_EVIDENCE_PRIVATE_HOST_ALLOWLIST: "host.docker.internal", THT_EVIDENCE_PRIVATE_HOST_ALLOWLIST: "host.docker.internal",
}, },
extra_hosts: ["host.docker.internal:host-gateway"], extra_hosts: ["host.docker.internal:host-gateway"],
+2 -18
View File
@@ -149,17 +149,8 @@ export async function runWorkspaceMaintenanceCli(
const result = failureResult(command, (() => { const result = failureResult(command, (() => {
try { return JSON.parse(io.stdin).workspaceId ?? ""; } catch { return ""; } try { return JSON.parse(io.stdin).workspaceId ?? ""; } catch { return ""; }
})(), failureCode); })(), failureCode);
if (process.env.P2_CHILD_DEBUG === "1") {
const detail = String((error as Error).message ?? "").replace(/[\r\n]+/g, " ").slice(0, 2048);
result.warnings = detail.length > 0 ? [detail] : undefined;
}
io.writeStdout(boundedJson(result)); io.writeStdout(boundedJson(result));
if (process.env.P2_CHILD_DEBUG === "1") { io.writeStderr(sanitizeStderr(error));
const detail = String((error as Error).message ?? "").replace(/[\r\n]+/g, " ").slice(0, 2048);
io.writeStderr(`workspace maintenance failed: ${detail}\n`);
} else {
io.writeStderr(sanitizeStderr(error));
}
const message = String((error as Error).message ?? ""); const message = String((error as Error).message ?? "");
const requestError = error instanceof SyntaxError const requestError = error instanceof SyntaxError
|| message === "invalid request" || message === "invalid request"
@@ -275,14 +266,7 @@ function createProductionService(): WorkspacePreprocessingService {
let stderr = ""; let stderr = "";
child.stdout?.on("data", (chunk: Buffer) => { stdout += chunk.toString("utf8"); }); child.stdout?.on("data", (chunk: Buffer) => { stdout += chunk.toString("utf8"); });
child.stderr?.on("data", (chunk: Buffer) => { stderr += chunk.toString("utf8"); }); child.stderr?.on("data", (chunk: Buffer) => { stderr += chunk.toString("utf8"); });
child.on("close", (code) => { child.on("close", (code) => resolve({ exitCode: code ?? 0, stdout, stderr: stderr.slice(0, 64 * 1024) }));
const capped = { exitCode: code ?? 0, stdout, stderr: stderr.slice(0, 64 * 1024) };
if (process.env.P2_CHILD_DEBUG === "1" && (code ?? 0) !== 0) {
capped.stdout = stdout.slice(0, 4096);
capped.stderr = stderr.slice(0, 4096);
}
resolve(capped);
});
child.on("error", (error) => resolve({ exitCode: 1, stdout, stderr: String(error.message).slice(0, 4096) })); child.on("error", (error) => resolve({ exitCode: 1, stdout, stderr: String(error.message).slice(0, 4096) }));
}); });
} finally { } finally {
@@ -430,13 +430,7 @@ export class WorkspacePreprocessingService {
private async runJsonStage(runtime: ActiveRuntime, argv: string[]): Promise<Record<string, unknown>> { private async runJsonStage(runtime: ActiveRuntime, argv: string[]): Promise<Record<string, unknown>> {
const result = await this.deps.runChild({ argv, configPath: runtime.configLease.path }); const result = await this.deps.runChild({ argv, configPath: runtime.configLease.path });
if (result.exitCode !== 0) { if (result.exitCode !== 0) throw new Error("workspace child failed");
if (process.env.P2_CHILD_DEBUG === "1") {
const detail = `${result.stderr ?? ""}${result.stdout ?? ""}`.replace(/[\r\n]+/g, " ").slice(0, 2048);
throw new Error(`workspace child failed: ${detail}`);
}
throw new Error("workspace child failed");
}
return JSON.parse(result.stdout) as Record<string, unknown>; return JSON.parse(result.stdout) as Record<string, unknown>;
} }
-2
View File
@@ -262,8 +262,6 @@ def dwh_cmd(
result = run_dwh_from_config(config, steps=selected, resume=resume) result = run_dwh_from_config(config, steps=selected, resume=resume)
except Exception as exc: # noqa: BLE001 except Exception as exc: # noqa: BLE001
payload = {"status": "failed", "error": "DWH preprocessing failed"} payload = {"status": "failed", "error": "DWH preprocessing failed"}
if os.environ.get("THT_P2_DEBUG") == "1":
payload["error"] = f"DWH preprocessing failed: {type(exc).__name__}: {exc}"
if json_output: if json_output:
typer.echo(json.dumps(payload, sort_keys=True)) typer.echo(json.dumps(payload, sort_keys=True))
else: else: