From cf5da81a3fd0a4d9b9adba1b03ae8a96c353a9c6 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 3 Jul 2026 07:47:04 +0000 Subject: [PATCH] fix: expose sentinel follower tekton status --- config/cicd-branch-followers.yaml | 3 +++ scripts/src/cicd.ts | 33 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/config/cicd-branch-followers.yaml b/config/cicd-branch-followers.yaml index 8e1422f0..bee1c341 100644 --- a/config/cicd-branch-followers.yaml +++ b/config/cicd-branch-followers.yaml @@ -232,6 +232,9 @@ followers: gitMirrorNamespace: devops-infra gitMirrorDeployment: git-mirror-http repoPath: /cache/pikasTech/unidesk.git + tekton: + namespace: devops-infra + pipelineRunPrefix: hwlab-web-probe-sentinel-jd01-web-probe-sentinel argo: namespace: argocd application: hwlab-web-probe-sentinel-jd01 diff --git a/scripts/src/cicd.ts b/scripts/src/cicd.ts index 8cf0a72b..baf61dc9 100644 --- a/scripts/src/cicd.ts +++ b/scripts/src/cicd.ts @@ -865,6 +865,39 @@ async function runFollowerDrillDown(registry: BranchFollowerRegistry, options: P } const follower = registry.followers.find((item) => item.id === options.followerId); if (follower === undefined) throw new Error(`unknown follower ${options.followerId}`); + if (!options.controller) { + const refresh = runControllerReconcileJob(registry, options, { dryRun: true, wait: true, recordState: true }); + const k8s = readK8sState(registry, options); + const stored = k8s.stateByFollower[follower.id] ?? {}; + const storedSource = asOptionalRecord(stored.source); + const storedTarget = asOptionalRecord(stored.target); + const command = asOptionalRecord(stored.command); + const native = asOptionalRecord(command?.payload); + return { + ok: refresh.ok && k8s.ok && Object.keys(stored).length > 0, + action: options.action, + follower: follower.id, + adapter: follower.adapter, + statusAuthority: "k8s-native-state-configmap", + parsedDownstreamCliOutput: false, + summary: { + phase: stringOrNull(stored.phase) ?? "Observed", + observedSha: stringOrNull(storedSource?.observedSha), + targetSha: stringOrNull(storedTarget?.targetSha), + pipelineRun: stringOrNull(stored.pipelineRun) ?? stringOrNull(stored.inFlightJob), + aligned: null, + message: stringOrNull(stored.decision) ?? "no controller state yet", + }, + native, + refresh, + errors: k8s.errors, + next: { + status: `bun scripts/cli.ts cicd branch-follower status --follower ${follower.id}`, + liveStatus: `bun scripts/cli.ts cicd branch-follower status --follower ${follower.id} --live`, + runOnceDryRun: `bun scripts/cli.ts cicd branch-follower run-once --follower ${follower.id} --dry-run`, + }, + }; + } const live = await readAdapterStatus(registry, follower, options); return { ok: live.ok,