mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:00:42 +00:00
ci: make package acceptance legacy-safe
This commit is contained in:
@@ -312,5 +312,9 @@ WRAPPER
|
||||
assert_entrypoint "$unit_path" "$npm_entry"
|
||||
}
|
||||
|
||||
run_wrapper_flow
|
||||
if "$npm_bin" gateway install --help 2>&1 | grep -q -- "--wrapper"; then
|
||||
run_wrapper_flow
|
||||
else
|
||||
echo "Skipping wrapper persistence; package gateway install does not support --wrapper."
|
||||
fi
|
||||
'
|
||||
|
||||
@@ -560,8 +560,9 @@ const path = require("node:path");
|
||||
|
||||
const indexPath = path.join(process.env.HOME, ".openclaw", "plugins", "installs.json");
|
||||
const index = JSON.parse(fs.readFileSync(indexPath, "utf8"));
|
||||
const installRecords = index.installRecords ?? index.records ?? {};
|
||||
for (const id of ["marketplace-shortcut", "marketplace-direct"]) {
|
||||
const record = index.installRecords?.[id];
|
||||
const record = installRecords[id];
|
||||
if (!record) throw new Error(`missing install record for ${id}`);
|
||||
if (record.source !== "marketplace") {
|
||||
throw new Error(`unexpected source for ${id}: ${record.source}`);
|
||||
@@ -845,7 +846,8 @@ if (inspect.plugin?.id !== pluginId) {
|
||||
|
||||
const indexPath = path.join(process.env.HOME, ".openclaw", "plugins", "installs.json");
|
||||
const index = JSON.parse(fs.readFileSync(indexPath, "utf8"));
|
||||
const record = index.installRecords?.[pluginId];
|
||||
const installRecords = index.installRecords ?? index.records ?? {};
|
||||
const record = installRecords[pluginId];
|
||||
if (!record) throw new Error(`missing ClawHub install record for ${pluginId}`);
|
||||
if (record.source !== "clawhub") {
|
||||
throw new Error(`unexpected ClawHub install source for ${pluginId}: ${record.source}`);
|
||||
@@ -890,7 +892,8 @@ if ((list.plugins || []).some((entry) => entry.id === pluginId)) {
|
||||
|
||||
const indexPath = path.join(process.env.HOME, ".openclaw", "plugins", "installs.json");
|
||||
const index = fs.existsSync(indexPath) ? JSON.parse(fs.readFileSync(indexPath, "utf8")) : {};
|
||||
if (index.installRecords?.[pluginId]) {
|
||||
const installRecords = index.installRecords ?? index.records ?? {};
|
||||
if (installRecords[pluginId]) {
|
||||
throw new Error(`ClawHub install record still present after uninstall: ${pluginId}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,11 +45,33 @@ tar -xzf "$package_tgz" -C "$git_root" --strip-components=1
|
||||
# absent from the trimmed tarball install; that should not block update preflight.
|
||||
node - <<'"'"'NODE'"'"'
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
const packageJsonPath = "/tmp/openclaw-git/package.json";
|
||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
||||
const fixtureUiBuildSource = `const fs=require("node:fs");fs.mkdirSync("dist/control-ui",{recursive:true});fs.writeFileSync("dist/control-ui/index.html","<!doctype html><title>fixture</title>\\n")`;
|
||||
const fixtureUiBuildCommand = `node -e ${JSON.stringify(fixtureUiBuildSource)}`;
|
||||
packageJson.pnpm = { ...packageJson.pnpm, allowUnusedPatches: true };
|
||||
const nextPnpm = { ...packageJson.pnpm, allowUnusedPatches: true };
|
||||
const patchedDependencies = nextPnpm.patchedDependencies;
|
||||
if (
|
||||
patchedDependencies &&
|
||||
typeof patchedDependencies === "object" &&
|
||||
!Array.isArray(patchedDependencies)
|
||||
) {
|
||||
const keptPatches = Object.fromEntries(
|
||||
Object.entries(patchedDependencies).filter(([, patchFile]) => {
|
||||
return (
|
||||
typeof patchFile === "string" &&
|
||||
fs.existsSync(path.resolve(path.dirname(packageJsonPath), patchFile))
|
||||
);
|
||||
}),
|
||||
);
|
||||
if (Object.keys(keptPatches).length > 0) {
|
||||
nextPnpm.patchedDependencies = keptPatches;
|
||||
} else {
|
||||
delete nextPnpm.patchedDependencies;
|
||||
}
|
||||
}
|
||||
packageJson.pnpm = nextPnpm;
|
||||
packageJson.scripts = {
|
||||
...packageJson.scripts,
|
||||
build: "node -e \"console.log(\\\"fixture build skipped\\\")\"",
|
||||
|
||||
@@ -215,6 +215,14 @@ export const mainLanes = [
|
||||
resources: ["npm", "service"],
|
||||
weight: 6,
|
||||
}),
|
||||
lane(
|
||||
"plugins-offline",
|
||||
"OPENCLAW_PLUGINS_E2E_CLAWHUB=0 OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:plugins",
|
||||
{
|
||||
resources: ["npm", "service"],
|
||||
weight: 6,
|
||||
},
|
||||
),
|
||||
npmLane("plugin-update", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:plugin-update"),
|
||||
serviceLane("config-reload", "OPENCLAW_SKIP_DOCKER_BUILD=1 pnpm test:docker:config-reload"),
|
||||
...bundledScenarioLanes,
|
||||
|
||||
Reference in New Issue
Block a user