feat: load branch follower reuse config from source repos

This commit is contained in:
Codex
2026-07-03 20:42:46 +00:00
parent 19d270b44b
commit b0cb23b0e0
8 changed files with 435 additions and 13 deletions
+11
View File
@@ -369,6 +369,7 @@ function compactAdapterStatus(live: AdapterSummary): Record<string, unknown> {
function compactStatusGates(payload: Record<string, unknown> | null): Record<string, unknown> | null {
if (payload === null) return null;
const gitMirror = asOptionalRecord(payload.gitMirror);
const reuseConfig = asOptionalRecord(payload.reuseConfig);
const tekton = asOptionalRecord(payload.tekton);
const taskRuns = asOptionalRecord(payload.taskRuns);
const argo = asOptionalRecord(payload.argo);
@@ -384,6 +385,16 @@ function compactStatusGates(payload: Record<string, unknown> | null): Record<str
localGitops: stringOrNull(gitMirror.localGitops),
githubGitops: stringOrNull(gitMirror.githubGitops),
},
reuseConfig: reuseConfig === null ? null : {
ok: reuseConfig.ok === true,
present: reuseConfig.present === true,
path: stringOrNull(reuseConfig.path),
sourceCommit: stringOrNull(reuseConfig.sourceCommit),
stageRef: stringOrNull(reuseConfig.stageRef),
sha256: stringOrNull(reuseConfig.sha256),
serviceCount: numberOrNull(reuseConfig.serviceCount),
errors: Array.isArray(reuseConfig.errors) ? reuseConfig.errors.map(String).slice(0, 5) : [],
},
tekton: tekton === null ? null : {
name: stringOrNull(tekton.name),
succeeded: tekton.succeeded === true ? true : tekton.succeeded === false ? false : null,