fix: expose follower closeout gates
This commit is contained in:
@@ -188,6 +188,7 @@ function compactTargetDebugResult(parsed: Record<string, unknown> | null): Recor
|
||||
aligned: status.aligned === true ? true : status.aligned === false ? false : null,
|
||||
pipelineRun: stringOrNull(status.pipelineRun),
|
||||
message: stringOrNull(status.message),
|
||||
gates: asOptionalRecord(status.gates),
|
||||
},
|
||||
decision: decision === null ? null : {
|
||||
phase: stringOrNull(decision.phase),
|
||||
@@ -269,6 +270,7 @@ function stateSnapshot(read: K8sStateRead, followerId: string): Record<string, u
|
||||
}
|
||||
|
||||
function compactAdapterStatus(live: AdapterSummary): Record<string, unknown> {
|
||||
const payload = asOptionalRecord(live.payload);
|
||||
return {
|
||||
ok: live.ok,
|
||||
phase: live.phase,
|
||||
@@ -278,6 +280,48 @@ function compactAdapterStatus(live: AdapterSummary): Record<string, unknown> {
|
||||
pipelineRun: live.pipelineRun,
|
||||
inFlightJob: live.inFlightJob,
|
||||
message: live.message,
|
||||
gates: compactStatusGates(payload),
|
||||
};
|
||||
}
|
||||
|
||||
function compactStatusGates(payload: Record<string, unknown> | null): Record<string, unknown> | null {
|
||||
if (payload === null) return null;
|
||||
const gitMirror = asOptionalRecord(payload.gitMirror);
|
||||
const tekton = asOptionalRecord(payload.tekton);
|
||||
const argo = asOptionalRecord(payload.argo);
|
||||
const runtime = asOptionalRecord(payload.runtime);
|
||||
return {
|
||||
gitMirror: gitMirror === null ? null : {
|
||||
ok: gitMirror.ok === true,
|
||||
sourceSnapshotReady: gitMirror.sourceSnapshotReady === true,
|
||||
pendingFlush: gitMirror.pendingFlush === true,
|
||||
githubInSync: gitMirror.githubInSync === true,
|
||||
localSource: stringOrNull(gitMirror.localSource),
|
||||
githubSource: stringOrNull(gitMirror.githubSource),
|
||||
localGitops: stringOrNull(gitMirror.localGitops),
|
||||
githubGitops: stringOrNull(gitMirror.githubGitops),
|
||||
},
|
||||
tekton: tekton === null ? null : {
|
||||
name: stringOrNull(tekton.name),
|
||||
succeeded: tekton.succeeded === true ? true : tekton.succeeded === false ? false : null,
|
||||
reason: stringOrNull(tekton.reason),
|
||||
startTime: stringOrNull(tekton.startTime),
|
||||
completionTime: stringOrNull(tekton.completionTime),
|
||||
durationSeconds: numberOrNull(tekton.durationSeconds),
|
||||
},
|
||||
argo: argo === null ? null : {
|
||||
syncStatus: stringOrNull(argo.syncStatus),
|
||||
healthStatus: stringOrNull(argo.healthStatus),
|
||||
revision: stringOrNull(argo.revision),
|
||||
ready: argo.ready === true,
|
||||
},
|
||||
runtime: runtime === null ? null : {
|
||||
ready: runtime.ready === true,
|
||||
targetSha: stringOrNull(runtime.targetSha),
|
||||
expectedSha: stringOrNull(runtime.expectedSha),
|
||||
aligned: runtime.aligned === true ? true : runtime.aligned === false ? false : null,
|
||||
},
|
||||
errors: Array.isArray(payload.errors) ? payload.errors.map(String).slice(0, 5) : [],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user