From 0c474007e57bcd0bd2f655854663c3f3e3348253 Mon Sep 17 00:00:00 2001 From: lyon Date: Wed, 17 Jun 2026 22:41:41 +0800 Subject: [PATCH] fix: track gitops render source in runtime readiness --- deploy/deploy.yaml | 2 +- scripts/gitops-render.mjs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/deploy/deploy.yaml b/deploy/deploy.yaml index 989d07ce..cd0834e7 100644 --- a/deploy/deploy.yaml +++ b/deploy/deploy.yaml @@ -291,7 +291,7 @@ lanes: - skills/hwlab-agent-runtime/ env: HWLAB_METRICS_NAMESPACE: hwlab-v03 - HWLAB_OBSERVABILITY_CONFIG_REVISION: PJ2026-01060505-20260617-render-env + HWLAB_OBSERVABILITY_CONFIG_REVISION: PJ2026-01060505-20260617-render-source observable: true hwlab-user-billing: runtimeKind: go-service diff --git a/scripts/gitops-render.mjs b/scripts/gitops-render.mjs index d17eb579..7c4283be 100644 --- a/scripts/gitops-render.mjs +++ b/scripts/gitops-render.mjs @@ -1038,11 +1038,13 @@ function transformWorkloads({ workloads, deploy, catalog, source, sourceBranch = label(item.metadata, { ...stableRuntimeLabels, "hwlab.pikastech.local/gitops-target": gitopsTarget, + "hwlab.pikastech.local/gitops-render-source-commit": source.full, "hwlab.pikastech.local/source-commit": source.full, "unidesk.ai/node-staging": profile === "dev" ? "true" : "false" }); annotate(item.metadata, { "hwlab.pikastech.local/gitops-note": profile === "v02" ? "HWLAB v0.2 GitOps target." : profile === "prod" ? "node PROD GitOps target." : "node DEV GitOps target.", + "hwlab.pikastech.local/gitops-render-source-commit": source.full, "hwlab.pikastech.local/source-commit": source.full }); if (item.kind === "Job") { @@ -1064,6 +1066,7 @@ function transformWorkloads({ workloads, deploy, catalog, source, sourceBranch = label(podTemplate.metadata ??= {}, { ...stableRuntimeLabels, "hwlab.pikastech.local/gitops-target": gitopsTarget, + "hwlab.pikastech.local/gitops-render-source-commit": source.full, "hwlab.pikastech.local/source-commit": templateSourceCommit, "hwlab.pikastech.local/artifact-source-commit": templateArtifactCommit }); @@ -1080,6 +1083,7 @@ function transformWorkloads({ workloads, deploy, catalog, source, sourceBranch = }; } annotate(podTemplate.metadata, { + "hwlab.pikastech.local/gitops-render-source-commit": source.full, "hwlab.pikastech.local/source-commit": templateSourceCommit, "hwlab.pikastech.local/artifact-source-commit": templateArtifactCommit, "hwlab.pikastech.local/rendered-by": "scripts/gitops-render.mjs" @@ -2939,7 +2943,11 @@ async function runtimeItems() { } function runtimeSourceCommit(item) { - return item.spec?.template?.metadata?.labels?.["hwlab.pikastech.local/source-commit"] || + return item.spec?.template?.metadata?.labels?.["hwlab.pikastech.local/gitops-render-source-commit"] || + item.spec?.template?.metadata?.annotations?.["hwlab.pikastech.local/gitops-render-source-commit"] || + item.metadata?.labels?.["hwlab.pikastech.local/gitops-render-source-commit"] || + item.metadata?.annotations?.["hwlab.pikastech.local/gitops-render-source-commit"] || + item.spec?.template?.metadata?.labels?.["hwlab.pikastech.local/source-commit"] || item.spec?.template?.metadata?.annotations?.["hwlab.pikastech.local/source-commit"] || item.metadata?.labels?.["hwlab.pikastech.local/source-commit"] || item.metadata?.annotations?.["hwlab.pikastech.local/source-commit"] ||