fix: clarify optional git mirror stage status
This commit is contained in:
+7
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user