fix: keep branch follower output bounded

This commit is contained in:
Codex
2026-07-03 18:48:40 +00:00
parent 668d8317a3
commit 4df3d5d8bd
4 changed files with 334 additions and 252 deletions
+62 -11
View File
@@ -141,20 +141,72 @@ function compactNativePayload(payload) {
const value = recordOrNull(payload);
if (value === null) return null;
return {
source: recordOrNull(value.source),
sourceSync: recordOrNull(value.sourceSync),
gitMirror: recordOrNull(value.gitMirror),
tekton: recordOrNull(value.tekton),
gitMirror: compactGitMirror(value.gitMirror),
tekton: compactTekton(value.tekton),
taskRuns: compactTaskRuns(value.taskRuns),
planArtifacts: compactPlanArtifacts(value.planArtifacts),
argo: recordOrNull(value.argo),
runtime: recordOrNull(value.runtime),
argo: compactArgo(value.argo),
runtime: compactRuntime(value.runtime),
errors: arrayStrings(value.errors).slice(0, 5),
statusAuthority: stringOrNull(value.statusAuthority),
parsedDownstreamCliOutput: false,
};
}
function compactGitMirror(gitMirror) {
const value = recordOrNull(gitMirror);
if (value === null) return null;
return {
ok: value.ok === true,
sourceSnapshotReady: value.sourceSnapshotReady === true,
pendingFlush: value.pendingFlush === true,
githubInSync: value.githubInSync === true,
sourceBranch: stringOrNull(value.sourceBranch),
gitopsBranch: stringOrNull(value.gitopsBranch),
localSource: stringOrNull(value.localSource),
githubSource: stringOrNull(value.githubSource),
localGitops: stringOrNull(value.localGitops),
githubGitops: stringOrNull(value.githubGitops),
};
}
function compactTekton(tekton) {
const value = recordOrNull(tekton);
if (value === null) return null;
return {
name: stringOrNull(value.name),
succeeded: value.succeeded === true ? true : value.succeeded === false ? false : null,
reason: stringOrNull(value.reason),
startTime: stringOrNull(value.startTime),
completionTime: stringOrNull(value.completionTime),
durationSeconds: numberOrNull(value.durationSeconds),
};
}
function compactArgo(argo) {
const value = recordOrNull(argo);
if (value === null) return null;
return {
name: stringOrNull(value.name),
syncStatus: stringOrNull(value.syncStatus),
healthStatus: stringOrNull(value.healthStatus),
revision: stringOrNull(value.revision),
ready: value.ready === true,
};
}
function compactRuntime(runtime) {
const value = recordOrNull(runtime);
if (value === null) return null;
return {
namespace: stringOrNull(value.namespace),
ready: value.ready === true,
targetSha: stringOrNull(value.targetSha),
expectedSha: stringOrNull(value.expectedSha),
aligned: value.aligned === true ? true : value.aligned === false ? false : null,
};
}
function compactTaskRuns(taskRuns) {
const value = recordOrNull(taskRuns);
if (value === null) return null;
@@ -165,7 +217,6 @@ function compactTaskRuns(taskRuns) {
failedCount: numberOrNull(value.failedCount),
activeCount: numberOrNull(value.activeCount),
performance: recordOrNull(value.performance),
items: arrayRecords(value.items).slice(0, 16),
};
}
@@ -178,10 +229,10 @@ function compactPlanArtifacts(planArtifacts) {
eventFound: value.eventFound === true,
degradedReason: stringOrNull(value.degradedReason),
sourceCommitId: stringOrNull(value.sourceCommitId),
affectedServices: arrayStrings(value.affectedServices).slice(0, 40),
rolloutServices: arrayStrings(value.rolloutServices).slice(0, 40),
buildServices: arrayStrings(value.buildServices).slice(0, 40),
reusedServices: arrayStrings(value.reusedServices).slice(0, 40),
affectedServicesCount: arrayStrings(value.affectedServices).length,
rolloutServicesCount: arrayStrings(value.rolloutServices).length,
buildServicesCount: arrayStrings(value.buildServices).length,
reusedServicesCount: arrayStrings(value.reusedServices).length,
buildSkippedCount: numberOrNull(value.buildSkippedCount),
summary: stringOrNull(value.summary),
disclosure: stringOrNull(value.disclosure),