Skip to content

Commit 07ec13a

Browse files
committed
fix(release): ignore inherited bundled plugin build filters
1 parent cd775c7 commit 07ec13a

2 files changed

Lines changed: 52 additions & 1 deletion

File tree

‎scripts/openclaw-npm-postpublish-verify.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ type InstalledBundledExtensionManifestRecord = {
6060
const MAX_BUNDLED_EXTENSION_MANIFEST_BYTES = 1024 * 1024;
6161
const LEGACY_CONTEXT_ENGINE_UNRESOLVED_RUNTIME_MARKER =
6262
"Failed to load legacy context engine runtime.";
63-
const PACKAGED_BUNDLED_PLUGIN_ARTIFACTS = new Set(listBundledPluginPackArtifacts());
63+
// Package verification always covers the complete published inventory, even
64+
// when the invoking build inherited a plugin-selection filter.
65+
const PACKAGED_BUNDLED_PLUGIN_ARTIFACTS = new Set(
66+
listBundledPluginPackArtifacts({
67+
env: { ...process.env, OPENCLAW_BUNDLED_PLUGIN_BUILD_IDS: undefined },
68+
}),
69+
);
6470
const PUBLISHED_BUNDLED_RUNTIME_SIDECAR_PATHS = BUNDLED_RUNTIME_SIDECAR_PATHS.filter(
6571
(relativePath) => PACKAGED_BUNDLED_PLUGIN_ARTIFACTS.has(relativePath),
6672
);

‎test/openclaw-npm-postpublish-verify.test.ts‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { spawnSync } from "node:child_process";
12
import { generateKeyPairSync, sign } from "node:crypto";
23
// OpenClaw npm postpublish tests validate postpublish verification behavior.
34
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
@@ -687,6 +688,50 @@ describe("collectInstalledPackageErrors", () => {
687688
}
688689
});
689690

691+
it("verifies every bundled manifest when the build filter exists before module initialization", () => {
692+
const packageRoot = makeInstalledPackageRoot();
693+
694+
try {
695+
const probe = spawnSync(
696+
process.execPath,
697+
[
698+
"--import",
699+
"tsx",
700+
"--eval",
701+
[
702+
'import { collectInstalledBundledExtensionManifestErrors } from "./scripts/openclaw-npm-postpublish-verify.ts";',
703+
`process.stdout.write(JSON.stringify(collectInstalledBundledExtensionManifestErrors(${JSON.stringify(packageRoot)})));`,
704+
].join("\n"),
705+
],
706+
{
707+
cwd: process.cwd(),
708+
encoding: "utf8",
709+
env: { ...process.env, OPENCLAW_BUNDLED_PLUGIN_BUILD_IDS: "ollama" },
710+
timeout: 30_000,
711+
},
712+
);
713+
714+
expect(probe.error).toBeUndefined();
715+
expect(probe.status, probe.stderr).toBe(0);
716+
expect(JSON.parse(probe.stdout)).toEqual(
717+
expect.arrayContaining(
718+
["ollama", "lmstudio"].map(
719+
(providerId) =>
720+
`installed bundled extension manifest missing: ${join(
721+
packageRoot,
722+
"dist",
723+
"extensions",
724+
providerId,
725+
"package.json",
726+
)}.`,
727+
),
728+
),
729+
);
730+
} finally {
731+
rmSync(packageRoot, { recursive: true, force: true });
732+
}
733+
});
734+
690735
it("does not require excluded external or private plugin package manifests", () => {
691736
const packageRoot = makeInstalledPackageRoot();
692737

0 commit comments

Comments
 (0)