fix: clarify optional git mirror stage status

This commit is contained in:
Codex
2026-07-03 18:27:10 +00:00
parent dc488302b8
commit d2213bab59
2 changed files with 9 additions and 1 deletions
+7 -1
View File
@@ -2366,7 +2366,13 @@ function stageTimingsFromNativePayload(payload: Record<string, unknown> | null):
if (sourceSyncStage !== null) stages.push(sourceSyncStage);
const gitMirror = asOptionalRecord(payload.gitMirror);
if (gitMirror !== null) {
const status = gitMirror.pendingFlush === true ? "pending-flush" : gitMirror.githubInSync === true && gitMirror.sourceSnapshotReady === true ? "ready" : "not-ready";
const hasGitopsBranch = stringOrNull(gitMirror.gitopsBranch) !== null;
const sourceReady = gitMirror.sourceSnapshotReady === true;
const status = gitMirror.pendingFlush === true
? "pending-flush"
: hasGitopsBranch
? gitMirror.githubInSync === true && sourceReady ? "ready" : "not-ready"
: sourceReady ? "source-ready" : "source-not-ready";
stages.push(stageTiming("git-mirror", status, null, null, "git-mirror-cache", stringOrNull(gitMirror.gitopsBranch) ?? stringOrNull(gitMirror.sourceBranch)));
}
const tekton = asOptionalRecord(payload.tekton);