From a2888f8f7ddbd759ff50d8e13958e046f4822d6e Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Wed, 15 Apr 2026 00:32:44 +0100 Subject: [PATCH] fix(ci): exclude private qa sidecars from install verify --- scripts/openclaw-npm-postpublish-verify.ts | 6 +++++- test/openclaw-npm-postpublish-verify.test.ts | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/scripts/openclaw-npm-postpublish-verify.ts b/scripts/openclaw-npm-postpublish-verify.ts index 197d2e00abe..bd8f3385016 100644 --- a/scripts/openclaw-npm-postpublish-verify.ts +++ b/scripts/openclaw-npm-postpublish-verify.ts @@ -15,6 +15,7 @@ import { isAbsolute, join, relative } from "node:path"; import { pathToFileURL } from "node:url"; import { formatErrorMessage } from "../src/infra/errors.ts"; import { BUNDLED_RUNTIME_SIDECAR_PATHS } from "../src/plugins/runtime-sidecar-paths.ts"; +import { listBundledPluginPackArtifacts } from "./lib/bundled-plugin-build-entries.mjs"; import { collectBundledPluginRootRuntimeMirrorErrors, collectRootDistBundledRuntimeMirrors, @@ -43,6 +44,9 @@ type InstalledBundledExtensionManifestRecord = { const MAX_BUNDLED_EXTENSION_MANIFEST_BYTES = 1024 * 1024; const LEGACY_CONTEXT_ENGINE_UNRESOLVED_RUNTIME_MARKER = "Failed to load legacy context engine runtime."; +const PUBLISHED_BUNDLED_RUNTIME_SIDECAR_PATHS = BUNDLED_RUNTIME_SIDECAR_PATHS.filter( + (relativePath) => listBundledPluginPackArtifacts().includes(relativePath), +); export type PublishedInstallScenario = { name: string; @@ -90,7 +94,7 @@ export function collectInstalledPackageErrors(params: { ); } - for (const relativePath of BUNDLED_RUNTIME_SIDECAR_PATHS) { + for (const relativePath of PUBLISHED_BUNDLED_RUNTIME_SIDECAR_PATHS) { if (!existsSync(join(params.packageRoot, relativePath))) { errors.push(`installed package is missing required bundled runtime sidecar: ${relativePath}`); } diff --git a/test/openclaw-npm-postpublish-verify.test.ts b/test/openclaw-npm-postpublish-verify.test.ts index 51522df0e9f..0069f14e80a 100644 --- a/test/openclaw-npm-postpublish-verify.test.ts +++ b/test/openclaw-npm-postpublish-verify.test.ts @@ -2,6 +2,7 @@ import { mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from "node import { tmpdir } from "node:os"; import { dirname, join } from "node:path"; import { describe, expect, it } from "vitest"; +import { listBundledPluginPackArtifacts } from "../scripts/lib/bundled-plugin-build-entries.mjs"; import { buildPublishedInstallCommandArgs, buildPublishedInstallScenarios, @@ -13,6 +14,10 @@ import { } from "../scripts/openclaw-npm-postpublish-verify.ts"; import { BUNDLED_RUNTIME_SIDECAR_PATHS } from "../src/plugins/runtime-sidecar-paths.ts"; +const PUBLISHED_BUNDLED_RUNTIME_SIDECAR_PATHS = BUNDLED_RUNTIME_SIDECAR_PATHS.filter( + (relativePath) => listBundledPluginPackArtifacts().includes(relativePath), +); + describe("buildPublishedInstallScenarios", () => { it("uses a single fresh scenario for plain stable releases", () => { expect(buildPublishedInstallScenarios("2026.3.23")).toEqual([ @@ -70,13 +75,21 @@ describe("collectInstalledPackageErrors", () => { ); expect(errors).toEqual( expect.arrayContaining( - BUNDLED_RUNTIME_SIDECAR_PATHS.map( + PUBLISHED_BUNDLED_RUNTIME_SIDECAR_PATHS.map( (relativePath) => `installed package is missing required bundled runtime sidecar: ${relativePath}`, ), ), ); - expect(errors.length).toBeGreaterThanOrEqual(1 + BUNDLED_RUNTIME_SIDECAR_PATHS.length); + expect(errors).not.toEqual( + expect.arrayContaining([ + "installed package is missing required bundled runtime sidecar: dist/extensions/qa-channel/runtime-api.js", + "installed package is missing required bundled runtime sidecar: dist/extensions/qa-lab/runtime-api.js", + ]), + ); + expect(errors.length).toBeGreaterThanOrEqual( + 1 + PUBLISHED_BUNDLED_RUNTIME_SIDECAR_PATHS.length, + ); }); });