fix(release): preserve frozen ClawHub request contracts

This commit is contained in:
Dallin Romney
2026-08-20 22:00:00 -07:00
parent 3186e22382
commit a7ee38bc42
5 changed files with 45 additions and 12 deletions
+11 -2
View File
@@ -9,6 +9,15 @@ export function legacyPackageAcceptanceCompat(version) {
);
}
if (isDirectRunUrl(process.argv[1], import.meta.url)) {
console.log(legacyPackageAcceptanceCompat(process.argv[2]) ? "1" : "0");
export function clawhubReleaseSecurityMode(version) {
// 2026.6.35 shipped before the ClawHub release-security endpoint existed.
return version === "2026.6.35" ? "absent" : "required";
}
if (isDirectRunUrl(process.argv[1], import.meta.url)) {
if (process.argv[2] === "--clawhub-release-security-mode") {
console.log(clawhubReleaseSecurityMode(process.argv[3]));
} else {
console.log(legacyPackageAcceptanceCompat(process.argv[2]) ? "1" : "0");
}
}
+3 -6
View File
@@ -1669,16 +1669,13 @@ phase prepare-update-restart-probe prepare_update_restart_probe
phase configure-plugin-registry configure_plugin_registry
phase update-candidate update_candidate
if [ -n "${OPENCLAW_CLAWHUB_URL:-}" ]; then
clawhub_security_mode="required"
clawhub_security_mode="$(
node scripts/e2e/lib/package-compat.mjs --clawhub-release-security-mode "$candidate_version"
)"
prepublish_package="@openclaw/whatsapp"
if configured_plugin_installs_enabled; then
prepublish_package="@openclaw/matrix"
fi
# 2026.6.35 predates the release-security endpoint. The trusted fixture still
# asserts its exact older request contract instead of accepting arbitrary IO.
if [ "$candidate_version" = "2026.6.35" ]; then
clawhub_security_mode="absent"
fi
phase assert-prepublish-requests node \
"${OPENCLAW_UPGRADE_SURVIVOR_CLAWHUB_FIXTURE_SERVER:-scripts/e2e/lib/clawhub-fixture-server.cjs}" \
assert-prepublish-requests "$OPENCLAW_CLAWHUB_URL" "$prepublish_package" "$candidate_version" "$clawhub_security_mode"
+8 -1
View File
@@ -503,6 +503,10 @@ node scripts/e2e/lib/upgrade-survivor/assertions.mjs seed
openclaw_e2e_install_package "$OPENCLAW_UPGRADE_SURVIVOR_ARTIFACT_ROOT/install.log" "upgrade survivor package" "$npm_config_prefix"
command -v openclaw >/dev/null
package_version="$(node -p "JSON.parse(require(\"node:fs\").readFileSync(process.argv[1] + \"/lib/node_modules/openclaw/package.json\", \"utf8\")).version" "$npm_config_prefix")"
candidate_version="$(
tar -xOf "${OPENCLAW_CURRENT_PACKAGE_TGZ:?missing OPENCLAW_CURRENT_PACKAGE_TGZ}" package/package.json |
node -e "let raw=[]; process.stdin.on(\"data\", (chunk) => raw.push(chunk)); process.stdin.on(\"end\", () => process.stdout.write(JSON.parse(Buffer.concat(raw)).version));"
)"
OPENCLAW_PACKAGE_ACCEPTANCE_LEGACY_COMPAT="$(
node scripts/e2e/lib/package-compat.mjs "$package_version"
)"
@@ -540,8 +544,11 @@ if [ "$update_status" -ne 0 ]; then
exit "$update_status"
fi
if [ -n "${OPENCLAW_CLAWHUB_URL:-}" ]; then
clawhub_security_mode="$(
node scripts/e2e/lib/package-compat.mjs --clawhub-release-security-mode "$candidate_version"
)"
node "$OPENCLAW_UPGRADE_SURVIVOR_CLAWHUB_FIXTURE_SERVER" \
assert-prepublish-requests "$OPENCLAW_CLAWHUB_URL" "@openclaw/whatsapp" "$package_version"
assert-prepublish-requests "$OPENCLAW_CLAWHUB_URL" "@openclaw/whatsapp" "$candidate_version" "$clawhub_security_mode"
fi
if [ "$UPDATE_RESTART_MODE" = "auto-auth" ]; then
@@ -38,6 +38,18 @@ const EXECUTABLE_ENTRYPOINTS = [
script: "scripts/e2e/lib/package-compat.mjs",
status: 0,
},
{
args: ["--clawhub-release-security-mode", "2026.6.35"],
output: "absent",
script: "scripts/e2e/lib/package-compat.mjs",
status: 0,
},
{
args: ["--clawhub-release-security-mode", "2026.8.1"],
output: "required",
script: "scripts/e2e/lib/package-compat.mjs",
status: 0,
},
{
args: [],
output: "docker_e2e_count=",
+11 -3
View File
@@ -2536,7 +2536,15 @@ docker_e2e_docker_run_cmd run demo
expect(publishedRunner.indexOf("phase update-candidate update_candidate")).toBeLessThan(
publishedRunner.indexOf("phase assert-prepublish-requests node"),
);
expect(publishedRunner).toContain('if [ "$candidate_version" = "2026.6.35" ]; then');
expectTextToIncludeAll(runner, [
'tar -xOf "${OPENCLAW_CURRENT_PACKAGE_TGZ:?missing OPENCLAW_CURRENT_PACKAGE_TGZ}" package/package.json',
'"${OPENCLAW_CURRENT_PACKAGE_TGZ:?missing OPENCLAW_CURRENT_PACKAGE_TGZ}"',
'package-compat.mjs --clawhub-release-security-mode "$candidate_version"',
'assert-prepublish-requests "$OPENCLAW_CLAWHUB_URL" "@openclaw/whatsapp" "$candidate_version" "$clawhub_security_mode"',
]);
expect(publishedRunner).toContain(
'package-compat.mjs --clawhub-release-security-mode "$candidate_version"',
);
expect(publishedRunner).toContain('prepublish_package="@openclaw/whatsapp"');
expect(publishedRunner).toContain("if configured_plugin_installs_enabled; then");
expect(publishedRunner).toContain('prepublish_package="@openclaw/matrix"');
@@ -2557,12 +2565,12 @@ docker_e2e_docker_run_cmd run demo
);
expect(runner.indexOf('openclaw "${update_args[@]}"')).toBeLessThan(
runner.indexOf(
'assert-prepublish-requests "$OPENCLAW_CLAWHUB_URL" "@openclaw/whatsapp" "$package_version"',
'assert-prepublish-requests "$OPENCLAW_CLAWHUB_URL" "@openclaw/whatsapp" "$candidate_version" "$clawhub_security_mode"',
),
);
expect(
runner.indexOf(
'assert-prepublish-requests "$OPENCLAW_CLAWHUB_URL" "@openclaw/whatsapp" "$package_version"',
'assert-prepublish-requests "$OPENCLAW_CLAWHUB_URL" "@openclaw/whatsapp" "$candidate_version" "$clawhub_security_mode"',
),
).toBeLessThan(runner.indexOf("openclaw doctor --fix --non-interactive"));
expect(runner).toContain(