fix: address Codex PR review findings

This commit is contained in:
gitea committed 2026-10-25 22:32:45 +08:00
1 parent 0f164b6de5
commit a7974abb08
44 files changed
+3317 -667

No files matched your search

+11 -4
View File
@@ -404,6 +404,13 @@ export async function handleJob(parsed: CliParsedArgs, runtime: CliRuntime): Pro
})),
]);
const workflowDetail = await getWorkflowDetail(client, job.pipelineId).catch(() => undefined);
const workflowStateLabel = !workflowDetail
? "未知(无法读取工作流详情)"
: workflowDetail.state === 1
? "🟢 启用中"
: workflowDetail.state === 0
? "⚪ 已停用"
: "未知";
const failedExecutions = await enrichFailedExecutions(client, jobId, failedPage.items);
const conditionDiagnoses = explainConditionBranches(tree);
@@ -451,7 +458,7 @@ export async function handleJob(parsed: CliParsedArgs, runtime: CliRuntime): Pro
jobId,
pipelineId: job.pipelineId,
workflowName: workflowDetail?.pipelineName || workflowDetail?.label,
workflowState: workflowDetail?.state === 1 ? "🟢 启用中" : "⚪ 已停用",
workflowState: workflowStateLabel,
jobStatus: job.state ?? job.status,
totalTasks: timeline.length,
executedTasks: tree.length,
@@ -480,7 +487,7 @@ export async function handleJob(parsed: CliParsedArgs, runtime: CliRuntime): Pro
"Job ID": job.id,
"工作流 ID": job.pipelineId,
...(workflowDetail ? { "工作流名称": workflowDetail.pipelineName || workflowDetail.label } : {}),
"工作流状态": workflowDetail?.state === 1 ? "🟢 启用中" : "⚪ 已停用",
"工作流状态": workflowStateLabel,
"Job 状态": job.state ?? job.status,
"定义总步骤数": timeline.length,
"已调度步骤数": tree.length,
@@ -509,7 +516,7 @@ export async function handleJob(parsed: CliParsedArgs, runtime: CliRuntime): Pro
id: workflowDetail.id,
name: workflowDetail.pipelineName || workflowDetail.label,
state: workflowDetail.state,
stateLabel: workflowDetail.state === 1 ? "🟢 启用中" : "⚪ 已停用",
stateLabel: workflowStateLabel,
totalTasks: workflowDetail.tasks?.length ?? tree.length,
}
: undefined,
@@ -571,7 +578,7 @@ export async function handleJob(parsed: CliParsedArgs, runtime: CliRuntime): Pro
"Job ID": job.id,
"工作流 ID (pipelineId)": job.pipelineId,
...(workflowDetail ? { "工作流名称": workflowDetail.pipelineName || workflowDetail.label } : {}),
"工作流状态": workflowDetail?.state === 1 ? "🟢 启用中" : "⚪ 已停用",
"工作流状态": workflowStateLabel,
"Job 状态 (state)": formatJobStatusLabel(job.status, job.state),
"开始时间": job.startTime || "-",
"结束时间": job.endTime || "-",