Merge pull request #1492 from pikasTech/fix/1476-sentinel-status-drilldown

fix: expose sentinel follower tekton status
This commit is contained in:
Lyon
2026-07-03 15:47:31 +08:00
committed by GitHub
2 changed files with 36 additions and 0 deletions
+3
View File
@@ -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
+33
View File
@@ -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,