From 6f8d99759490b4446d0989593f8e12df04609c57 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 10 Jul 2026 13:01:34 +0200 Subject: [PATCH] fix(deploy): declare web realtime capabilities --- deploy/deploy.yaml | 2 ++ scripts/gitops-render.test.ts | 5 +++++ scripts/runtime-realtime-capabilities-config.test.mjs | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/deploy/deploy.yaml b/deploy/deploy.yaml index e3560705..52feebd5 100644 --- a/deploy/deploy.yaml +++ b/deploy/deploy.yaml @@ -617,6 +617,8 @@ lanes: HWLAB_CLOUD_WEB_DISPLAY_TIME_ZONE: Asia/Shanghai HWLAB_CLOUD_WEB_DISPLAY_TIME_LOCALE: zh-CN HWLAB_CLOUD_WEB_DISPLAY_TIME_LABEL: 北京时间 + HWLAB_WORKBENCH_LIVE_KAFKA_SSE_ENABLED: "true" + HWLAB_WORKBENCH_PROJECTION_REALTIME_ENABLED: "false" HWLAB_CLOUD_WEB_OPENCODE_UPSTREAM_URL: http://opencode-server.hwlab-v03.svc.cluster.local:4096 HWLAB_CLOUD_WEB_OPENCODE_USERNAME: secretRef:hwlab-opencode-server-auth/username HWLAB_CLOUD_WEB_OPENCODE_PASSWORD: secretRef:hwlab-opencode-server-auth/password diff --git a/scripts/gitops-render.test.ts b/scripts/gitops-render.test.ts index fe9e3412..b1248245 100644 --- a/scripts/gitops-render.test.ts +++ b/scripts/gitops-render.test.ts @@ -649,6 +649,11 @@ test("v03 render keeps node identity as data instead of generated structure", as assert.equal(cloudApiEnv.get("HWLAB_KAFKA_PROJECTOR_GROUP_ID"), "hwlab-v03-agentrun-event-projector"); assert.equal(cloudApiEnv.get("HWLAB_KAFKA_HWLAB_EVENT_GROUP_ID"), "hwlab-v03-workbench-live-sse"); assert.equal(cloudApiEnv.has("HWLAB_SESSION_COOKIE_DOMAIN"), false); + const cloudWeb = (workloadsJson.items ?? []).find((item) => item.kind === "Deployment" && item.metadata?.name === "hwlab-cloud-web"); + const cloudWebContainer = collectContainersFromItem(cloudWeb).find((container) => container.name === "hwlab-cloud-web"); + const cloudWebEnv = new Map((cloudWebContainer?.env ?? []).map((entry) => [entry.name, entry.value])); + assert.equal(cloudWebEnv.get("HWLAB_WORKBENCH_LIVE_KAFKA_SSE_ENABLED"), "true"); + assert.equal(cloudWebEnv.get("HWLAB_WORKBENCH_PROJECTION_REALTIME_ENABLED"), "false"); assert.match(cloudApiEnv.get("HWLAB_ENVIRONMENT_IMAGE") ?? "", /hwlab-cloud-api-env:env-stale/u); assert.deepEqual(cloudApiEnvEntries.get("HWLAB_SECRET_PLANE_SMOKE")?.valueFrom?.secretKeyRef, { name: "hwlab-secret-plane-smoke", key: "password", optional: true }); assert.ok((cloudApi?.spec?.template?.spec?.volumes ?? []).some((volume) => volume.name === "hwpod-preinstalled-specs" && volume.configMap?.name === "hwlab-v03-hwpod-preinstalled-specs")); diff --git a/scripts/runtime-realtime-capabilities-config.test.mjs b/scripts/runtime-realtime-capabilities-config.test.mjs index 7eb44244..2a336105 100644 --- a/scripts/runtime-realtime-capabilities-config.test.mjs +++ b/scripts/runtime-realtime-capabilities-config.test.mjs @@ -23,7 +23,9 @@ const LIVE_KAFKA_CONTRACT = Object.freeze({ test("v03 YAML keeps pure Kafka realtime capabilities independently composable", async () => { const deploy = await readStructuredFile(process.cwd(), "deploy/deploy.yaml"); const cloudApi = deploy.lanes?.v03?.services?.find((service) => service.serviceId === "hwlab-cloud-api"); + const cloudWeb = deploy.lanes?.v03?.serviceDeclarations?.["hwlab-cloud-web"]; assert.ok(cloudApi, "deploy.lanes.v03.services must declare hwlab-cloud-api"); + assert.ok(cloudWeb, "deploy.lanes.v03.serviceDeclarations must declare hwlab-cloud-web"); for (const [name, expected] of Object.entries(PRODUCT_CAPABILITIES)) { assert.equal(cloudApi.env?.[name], expected, `${name} must be explicitly YAML-owned`); @@ -34,4 +36,6 @@ test("v03 YAML keeps pure Kafka realtime capabilities independently composable", assert.equal(cloudApi.env?.HWLAB_SESSION_COOKIE_DOMAIN, undefined, "internal and public origins require host-scoped session cookies"); assert.notEqual(cloudApi.env?.HWLAB_KAFKA_AGENTRUN_EVENT_GROUP_ID, "hwlab-v03-agentrun-event-bridge"); + assert.equal(cloudWeb.env?.HWLAB_WORKBENCH_LIVE_KAFKA_SSE_ENABLED, "true"); + assert.equal(cloudWeb.env?.HWLAB_WORKBENCH_PROJECTION_REALTIME_ENABLED, "false"); });