fix(plugins): pin official external channel source (#70997)

This commit is contained in:
Vincent Koc
2026-04-24 00:35:03 -07:00
committed by GitHub
parent a437666a37
commit c1b9aa7d96
3 changed files with 22 additions and 4 deletions

View File

@@ -18,8 +18,9 @@
"order": 45
},
"install": {
"npmSpec": "@wecom/wecom-openclaw-plugin",
"defaultChoice": "npm"
"npmSpec": "@wecom/wecom-openclaw-plugin@2026.4.23",
"defaultChoice": "npm",
"expectedIntegrity": "sha512-bnzfdIEEu1/LFvcdyjaTkyxt27w6c7dqhkPezU62OWaqmcdFsUGR3T55USK/O9pIKsNcnL1Tnu1pqKYCWHFgWQ=="
}
}
}

View File

@@ -39,6 +39,6 @@ describeOfficialFallbackChannelCatalogContract({
describeChannelCatalogEntryContract({
channelId: "wecom",
npmSpec: "@wecom/wecom-openclaw-plugin",
npmSpec: "@wecom/wecom-openclaw-plugin@2026.4.23",
alias: "wework",
});

View File

@@ -6,6 +6,7 @@ import {
OFFICIAL_CHANNEL_CATALOG_RELATIVE_PATH,
writeOfficialChannelCatalog,
} from "../scripts/write-official-channel-catalog.mjs";
import { describePluginInstallSource } from "../src/plugins/install-source-info.js";
import { bundledPluginRoot } from "./helpers/bundled-plugin-paths.js";
import { cleanupTempDirs, makeTempRepoRoot, writeJsonFile } from "./helpers/temp-repo.js";
@@ -78,8 +79,10 @@ describe("buildOfficialChannelCatalog", () => {
label: "WeCom",
}),
install: {
npmSpec: "@wecom/wecom-openclaw-plugin",
npmSpec: "@wecom/wecom-openclaw-plugin@2026.4.23",
defaultChoice: "npm",
expectedIntegrity:
"sha512-bnzfdIEEu1/LFvcdyjaTkyxt27w6c7dqhkPezU62OWaqmcdFsUGR3T55USK/O9pIKsNcnL1Tnu1pqKYCWHFgWQ==",
},
}),
}),
@@ -106,6 +109,20 @@ describe("buildOfficialChannelCatalog", () => {
);
});
it("keeps official external catalog npm sources exactly pinned", () => {
const repoRoot = makeRepoRoot("openclaw-official-channel-catalog-policy-");
const entries = buildOfficialChannelCatalog({ repoRoot }).entries.filter(
(entry) => entry.source === "external",
);
expect(entries.length).toBeGreaterThan(0);
for (const entry of entries) {
const installSource = describePluginInstallSource(entry.openclaw?.install ?? {});
expect(installSource.warnings).toEqual([]);
expect(installSource.npm?.pinState).toBe("exact-with-integrity");
}
});
it("writes the official catalog under dist", () => {
const repoRoot = makeRepoRoot("openclaw-official-channel-catalog-write-");
writeJson(path.join(repoRoot, "extensions", "whatsapp", "package.json"), {