fix: make pac history read large namespaces
This commit is contained in:
@@ -425,8 +425,9 @@ async function history(config: UniDeskConfig, options: HistoryOptions): Promise<
|
||||
const result = await capture(config, target.route, ["sh"], remoteScript("history", pac, target, firstRepository, firstConsumer, { ...options, confirm: false, dryRun: true, wait: false }, secrets, "", selectedConsumers));
|
||||
const parsed = parseJsonOutput(result.stdout);
|
||||
const remote = parsed ?? compactCapture(result, { full: true });
|
||||
const historyErrors = arrayRecords(record(remote).historyErrors);
|
||||
return {
|
||||
ok: result.exitCode === 0 && parsed?.ok !== false,
|
||||
ok: result.exitCode === 0 && parsed?.ok !== false && historyErrors.length === 0,
|
||||
action: "platform-infra-pipelines-as-code-history",
|
||||
mutation: false,
|
||||
target: targetSummary(target),
|
||||
@@ -440,6 +441,7 @@ async function history(config: UniDeskConfig, options: HistoryOptions): Promise<
|
||||
consumers: selectedConsumers.map((consumer) => consumer.id),
|
||||
detailId: options.detailId,
|
||||
rows: arrayRecords(record(remote).rows),
|
||||
historyErrors,
|
||||
remote,
|
||||
next: nextCommands(target.id, options.consumerId ?? pac.defaults.consumerId, pac.defaults.consumerId),
|
||||
};
|
||||
@@ -786,12 +788,18 @@ function renderStatus(result: Record<string, unknown>): RenderedCliResult {
|
||||
function renderHistory(result: Record<string, unknown>): RenderedCliResult {
|
||||
const rows = arrayRecords(result.rows);
|
||||
const config = record(result.config);
|
||||
const historyErrors = arrayRecords(result.historyErrors);
|
||||
const detailId = stringValue(result.detailId);
|
||||
const timeHeader = `TIME(${stringValue(config.displayTimeZone)})`;
|
||||
const lines = [
|
||||
"PLATFORM-INFRA PIPELINES-AS-CODE HISTORY",
|
||||
`DATA: ${stringValue(config.source)}`,
|
||||
`ROWS: ${stringValue(rows.length)} LIMIT_PER_CONSUMER: ${stringValue(config.limitPerConsumer)}`,
|
||||
`ROWS: ${stringValue(rows.length)} LIMIT_PER_CONSUMER: ${stringValue(config.limitPerConsumer)} READ_ERRORS: ${stringValue(historyErrors.length)}`,
|
||||
...(historyErrors.length === 0 ? [] : [
|
||||
"",
|
||||
"READ ERRORS",
|
||||
...table(["CONTEXT", "STATUS", "ERROR"], historyErrors.map((item) => [stringValue(item.context), stringValue(item.status), compactLine(stringValue(item.error ?? item.stderr))])),
|
||||
]),
|
||||
"",
|
||||
"TRIGGERS",
|
||||
...(rows.length === 0 ? ["-"] : table([timeHeader, "CONSUMER", "REPO", "STATUS", "DUR_S", "COMMIT", "ENV_REUSE", "ID"], rows.map((row) => [
|
||||
|
||||
Reference in New Issue
Block a user