chore: remove acceptance debug channels from the P2 operator path
This commit is contained in:
@@ -780,8 +780,6 @@ async function writeInstallationFiles(ctx) {
|
||||
"workspace-maintenance": {
|
||||
image: ctx.coreImageTag,
|
||||
environment: {
|
||||
P2_CHILD_DEBUG: "1",
|
||||
THT_P2_DEBUG: "1",
|
||||
THT_EVIDENCE_PRIVATE_HOST_ALLOWLIST: "host.docker.internal",
|
||||
},
|
||||
extra_hosts: ["host.docker.internal:host-gateway"],
|
||||
|
||||
@@ -149,17 +149,8 @@ export async function runWorkspaceMaintenanceCli(
|
||||
const result = failureResult(command, (() => {
|
||||
try { return JSON.parse(io.stdin).workspaceId ?? ""; } catch { return ""; }
|
||||
})(), 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));
|
||||
if (process.env.P2_CHILD_DEBUG === "1") {
|
||||
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));
|
||||
}
|
||||
io.writeStderr(sanitizeStderr(error));
|
||||
const message = String((error as Error).message ?? "");
|
||||
const requestError = error instanceof SyntaxError
|
||||
|| message === "invalid request"
|
||||
@@ -275,14 +266,7 @@ function createProductionService(): WorkspacePreprocessingService {
|
||||
let stderr = "";
|
||||
child.stdout?.on("data", (chunk: Buffer) => { stdout += chunk.toString("utf8"); });
|
||||
child.stderr?.on("data", (chunk: Buffer) => { stderr += chunk.toString("utf8"); });
|
||||
child.on("close", (code) => {
|
||||
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("close", (code) => resolve({ exitCode: code ?? 0, stdout, stderr: stderr.slice(0, 64 * 1024) }));
|
||||
child.on("error", (error) => resolve({ exitCode: 1, stdout, stderr: String(error.message).slice(0, 4096) }));
|
||||
});
|
||||
} finally {
|
||||
|
||||
@@ -430,13 +430,7 @@ export class WorkspacePreprocessingService {
|
||||
|
||||
private async runJsonStage(runtime: ActiveRuntime, argv: string[]): Promise<Record<string, unknown>> {
|
||||
const result = await this.deps.runChild({ argv, configPath: runtime.configLease.path });
|
||||
if (result.exitCode !== 0) {
|
||||
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");
|
||||
}
|
||||
if (result.exitCode !== 0) throw new Error("workspace child failed");
|
||||
return JSON.parse(result.stdout) as Record<string, unknown>;
|
||||
}
|
||||
|
||||
|
||||
@@ -262,8 +262,6 @@ def dwh_cmd(
|
||||
result = run_dwh_from_config(config, steps=selected, resume=resume)
|
||||
except Exception as exc: # noqa: BLE001
|
||||
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:
|
||||
typer.echo(json.dumps(payload, sort_keys=True))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user