From f53759cb155e6db43034ac5b790b3e445e92e75e Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 11 Aug 2026 21:15:26 +0300 Subject: [PATCH] fix(deploy): include edge channel contract in manager release --- ...-device-manager-control-plane-artifact.mjs | 43 ++++++++++--------- infra/deploy-runner/nodedc-deploy | 3 ++ ..._device_manager_control_plane_artifacts.py | 5 +++ .../test_device_plane_registry.py | 1 + 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/infra/deploy-runner/build-device-manager-control-plane-artifact.mjs b/infra/deploy-runner/build-device-manager-control-plane-artifact.mjs index 34380e0..432d50b 100644 --- a/infra/deploy-runner/build-device-manager-control-plane-artifact.mjs +++ b/infra/deploy-runner/build-device-manager-control-plane-artifact.mjs @@ -12,7 +12,7 @@ const devicePlaneRoot = resolve(platformRoot, "device-plane"); const designRoot = resolve(process.env.NODEDC_DEVICE_MANAGER_SOURCE_ROOT || resolve(platformRoot, "../NODEDC_DESIGN_GUIDELINE")); const managerRoot = resolve(designRoot, "apps/device-manager"); const artifactDir = resolve(process.env.NODEDC_DEPLOY_ARTIFACT_DIR || resolve(scriptDir, "../deploy-artifacts")); -const [patchId = "device-manager-release-20260811-013", ...extra] = process.argv.slice(2); +const [patchId = "device-manager-release-20260811-014", ...extra] = process.argv.slice(2); if (extra.length || !/^[A-Za-z0-9._-]{1,96}$/.test(patchId)) throw new Error("usage: build-device-manager-control-plane-artifact.mjs [patch-id]"); const entries = [ @@ -21,6 +21,7 @@ const entries = [ "package-lock.json", "docker-compose.device-manager.yml", "packages/device-protocol-contract", + "packages/device-edge-channel-contract", "packages/arusnavi-b2-adapter", "services/device-control-core", "services/device-gateway/package.json", @@ -61,26 +62,28 @@ try { } await copySafe(resolve(devicePlaneRoot, entry), join(payload, entry), devicePlaneRoot); } - const coreImport = spawnSync( - process.execPath, - [ - "--input-type=module", - "--eval", - `import(${JSON.stringify(pathToFileURL(join( - payload, - "services/device-control-core/src/sensitive-reference-management.mjs", - )).href)})`, - ], - { - cwd: payload, - encoding: "utf8", - maxBuffer: 16 * 1024 * 1024, - }, - ); - if (coreImport.status !== 0) { - throw new Error( - `device_control_core_staged_module_import_failed:${coreImport.stderr || coreImport.stdout}`, + for (const modulePath of [ + "services/device-control-core/src/sensitive-reference-management.mjs", + "packages/device-edge-channel-contract/src/index.mjs", + ]) { + const coreImport = spawnSync( + process.execPath, + [ + "--input-type=module", + "--eval", + `import(${JSON.stringify(pathToFileURL(join(payload, modulePath)).href)})`, + ], + { + cwd: payload, + encoding: "utf8", + maxBuffer: 16 * 1024 * 1024, + }, ); + if (coreImport.status !== 0) { + throw new Error( + `device_control_core_staged_module_import_failed:${modulePath}:${coreImport.stderr || coreImport.stdout}`, + ); + } } const compose = await readFile(join(payload, "docker-compose.device-manager.yml"), "utf8"); for (const required of [ diff --git a/infra/deploy-runner/nodedc-deploy b/infra/deploy-runner/nodedc-deploy index 71f9745..4816cb6 100755 --- a/infra/deploy-runner/nodedc-deploy +++ b/infra/deploy-runner/nodedc-deploy @@ -298,6 +298,7 @@ DEVICE_PLANE_MANAGER_RELEASE_V2_ENTRIES = ( "package-lock.json", DEVICE_PLANE_MANAGER_COMPOSE_REL, "packages/device-protocol-contract", + "packages/device-edge-channel-contract", "packages/arusnavi-b2-adapter", "services/device-control-core", "services/device-gateway/package.json", @@ -3531,6 +3532,7 @@ def allowed_payload_path(component, rel): DEVICE_PLANE_MANAGER_RECONCILIATION_REL, DEVICE_PLANE_MANAGER_V2_RECONCILIATION_REL, "packages/device-protocol-contract", + "packages/device-edge-channel-contract", "packages/arusnavi-b2-adapter", "services/device-control-core", "services/device-gateway", @@ -3541,6 +3543,7 @@ def allowed_payload_path(component, rel): return True if rel.startswith(( "packages/device-protocol-contract/", + "packages/device-edge-channel-contract/", "packages/arusnavi-b2-adapter/", "services/device-control-core/", "services/device-gateway/", diff --git a/infra/deploy-runner/test_device_manager_control_plane_artifacts.py b/infra/deploy-runner/test_device_manager_control_plane_artifacts.py index f8975f4..a725c5d 100644 --- a/infra/deploy-runner/test_device_manager_control_plane_artifacts.py +++ b/infra/deploy-runner/test_device_manager_control_plane_artifacts.py @@ -205,6 +205,11 @@ class DeviceManagerControlPlaneArtifactsTest(unittest.TestCase): "payload/services/device-control-core/src/credential-reference.mjs", names, ) + self.assertIn( + "payload/packages/device-edge-channel-contract/src/index.mjs", + names, + ) + self.assertIn("packages/device-edge-channel-contract", entries) self.assertFalse(any(name.endswith(".test.mjs") for name in names)) self.assertEqual(result["services"], ["device-control-core", "device-manager"]) self.assertNotIn("device-postgres", result["services"]) diff --git a/infra/deploy-runner/test_device_plane_registry.py b/infra/deploy-runner/test_device_plane_registry.py index 9a2b3c5..4e4e4b4 100644 --- a/infra/deploy-runner/test_device_plane_registry.py +++ b/infra/deploy-runner/test_device_plane_registry.py @@ -107,6 +107,7 @@ class DevicePlaneRegistryTest(unittest.TestCase): ".dockerignore", "docker-compose.device-plane.yml", "packages/device-protocol-contract/src/index.mjs", + "packages/device-edge-channel-contract/src/index.mjs", "services/device-control-core/Dockerfile", "services/device-gateway/src/runtime.mjs", ):