diff --git a/scripts/src/hwlab-node-impl.ts b/scripts/src/hwlab-node-impl.ts index e3fae2d7..373aa6ec 100644 --- a/scripts/src/hwlab-node-impl.ts +++ b/scripts/src/hwlab-node-impl.ts @@ -3070,12 +3070,26 @@ function withNodeRuntimeControlPlanePlanRendered(result: Record function withNodeRuntimeControlPlaneStatusRendered(result: Record, scoped: ReturnType): RenderedCliResult { const pipelineRun = record(result.pipelineRun); + const pipelineRunDiagnostics = record(pipelineRun.diagnostics); const argo = record(result.argo); const runtime = record(result.runtime); const publicProbe = record(result.publicProbe); const gitMirror = record(result.gitMirror); const next = record(result.next); const diagnostic = record(publicProbe.diagnostic); + const notReadyWorkloads = Array.isArray(runtime.notReadyWorkloads) ? runtime.notReadyWorkloads.map((item) => webObserveText(item)).filter(Boolean) : []; + const runtimeDetail = [ + `workloads=${webObserveText(runtime.workloadReady)}`, + `pg=${webObserveText(runtime.externalPostgresReady ?? runtime.localPostgresReady)}`, + ...(notReadyWorkloads.length > 0 ? [`notReady=${webObserveShort(notReadyWorkloads.join(","), 80)}`] : []), + ].join(" "); + const failedTaskRuns = Array.isArray(pipelineRunDiagnostics.failedTaskRuns) ? pipelineRunDiagnostics.failedTaskRuns.map(compactNodeRuntimeTaskRunDiagnostic).filter(Boolean) : []; + const pendingTaskRuns = Array.isArray(pipelineRunDiagnostics.pendingTaskRuns) ? pipelineRunDiagnostics.pendingTaskRuns.map(compactNodeRuntimeTaskRunDiagnostic).filter(Boolean) : []; + const pipelineDetail = [ + webObserveShort(webObserveText(pipelineRun.reason ?? pipelineRun.message), 50), + ...(failedTaskRuns.length > 0 ? [`failed=${webObserveShort(failedTaskRuns.join(","), 80)}`] : []), + ...(pendingTaskRuns.length > 0 ? [`pending=${webObserveShort(pendingTaskRuns.join(","), 80)}`] : []), + ].filter(Boolean).join(" "); const status = result.ok === true ? "ok" : result.ok === false ? "failed" : "-"; const renderedText = [ "hwlab nodes control-plane status", @@ -3095,9 +3109,9 @@ function withNodeRuntimeControlPlaneStatusRendered(result: Record, scoped: ReturnType): Record { const pipelineRun = record(status.pipelineRun); const pipelineRunDiagnostics = record(status.pipelineRunDiagnostics); @@ -4168,6 +4191,7 @@ function summarizeNodeRuntimeControlPlaneStatus(status: Record, const gitMirrorCompact = record(gitMirror.compact); const workloadReadiness = Array.isArray(runtime.workloadReadiness) ? runtime.workloadReadiness.map(record) : []; const readyWorkloads = workloadReadiness.filter((item) => item.ready === true).length; + const notReadyWorkloads = workloadReadiness.filter((item) => item.ready !== true).map((item) => item.ref).filter(Boolean); const workloadCount = typeof runtime.workloadCount === "number" ? runtime.workloadCount : workloadReadiness.length; const webProbe = record(publicProbes.web); const apiProbe = record(publicProbes.apiHealth); @@ -4218,6 +4242,7 @@ function summarizeNodeRuntimeControlPlaneStatus(status: Record, ready: runtime.ready === true, workloadCount, workloadReady: `${readyWorkloads}/${workloadReadiness.length}`, + notReadyWorkloads, localPostgresAbsent: runtime.localPostgresAbsent === true, localPostgresExpectedAbsent: runtime.localPostgresExpectedAbsent === true, localPostgresReady: runtime.localPostgresReady === true,