fix(release): preserve frozen upgrade scenario closure (#142007)

* fix(release): preserve frozen scenario imports

* test(release): keep helper mount assertion behavioral
This commit is contained in:
Dallin Romney 2026-09-08 01:44:44 -07:00 • committed by GitHub
parent c8cb22a899
commit cbf23a1eba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 81 additions and 3 deletions

View file

@ -90,8 +90,26 @@ if [ "$UPGRADE_TARGET_TRAIN" = extended-stable ]; then
exit 2
fi
UPGRADE_RUNNER="$UPGRADE_SCENARIO_DIR/run.sh"
UPGRADE_NPM_PUBLISH_PLAN="$(openclaw_resolve_frozen_target_file \
"$ROOT_DIR" scripts/lib/npm-publish-plan.mjs)"
UPGRADE_WINDOWS_HELPERS="$(openclaw_resolve_frozen_target_file \
"$ROOT_DIR" scripts/windows-cmd-helpers.mjs)"
DOCKER_E2E_WINDOWS_HELPERS_PATH="$UPGRADE_WINDOWS_HELPERS"
UPGRADE_BOUNDED_RESPONSE="$(openclaw_resolve_frozen_target_file \
"$ROOT_DIR" scripts/lib/bounded-response.mjs)"
UPGRADE_PLUGIN_INDEX="$(openclaw_resolve_frozen_target_file \
"$ROOT_DIR" scripts/e2e/lib/plugin-index-sqlite.mjs)"
UPGRADE_ENV_LIMITS="$(openclaw_resolve_frozen_target_file \
"$ROOT_DIR" scripts/e2e/lib/env-limits.mjs)"
UPGRADE_TEXT_FILE_UTILS="$(openclaw_resolve_frozen_target_file \
"$ROOT_DIR" scripts/e2e/lib/text-file-utils.mjs)"
UPGRADE_SCENARIO_ARGS+=(
-v "$UPGRADE_SCENARIO_DIR:/app/scripts/e2e/lib/upgrade-survivor:ro"
-v "$UPGRADE_NPM_PUBLISH_PLAN:/app/scripts/lib/npm-publish-plan.mjs:ro"
-v "$UPGRADE_BOUNDED_RESPONSE:/app/scripts/lib/bounded-response.mjs:ro"
-v "$UPGRADE_PLUGIN_INDEX:/app/scripts/e2e/lib/plugin-index-sqlite.mjs:ro"
-v "$UPGRADE_ENV_LIMITS:/app/scripts/e2e/lib/env-limits.mjs:ro"
-v "$UPGRADE_TEXT_FILE_UTILS:/app/scripts/e2e/lib/text-file-utils.mjs:ro"
)
fi

View file

@ -339,6 +339,7 @@ Error={{printf "%.4096s" .State.Error}}' "$container_id" 2>&1
docker_e2e_harness_mount_args() {
local harness_root="${DOCKER_E2E_HARNESS_ROOT_DIR:-$ROOT_DIR}"
local windows_helpers="${DOCKER_E2E_WINDOWS_HELPERS_PATH:-$harness_root/scripts/windows-cmd-helpers.mjs}"
DOCKER_E2E_HARNESS_ARGS=(
-v "$harness_root/scripts/e2e:/app/scripts/e2e:ro"
-v "$harness_root/scripts/docker/verify-fs-safe-native.mjs:/app/scripts/docker/verify-fs-safe-native.mjs:ro"
@ -350,7 +351,7 @@ docker_e2e_harness_mount_args() {
-v "$harness_root/test/e2e/qa-lab:/app/test/e2e/qa-lab:ro"
-v "$harness_root/test/helpers:/app/test/helpers:ro"
-v "$harness_root/scripts/prepublish-plugin-registry-artifact.mjs:/app/scripts/prepublish-plugin-registry-artifact.mjs:ro"
-v "$harness_root/scripts/windows-cmd-helpers.mjs:/app/scripts/windows-cmd-helpers.mjs:ro"
-v "$windows_helpers:/app/scripts/windows-cmd-helpers.mjs:ro"
)
}

View file

@ -5930,6 +5930,12 @@ grep -Fxq preserved "$TMPDIR/caller-fd"
"scripts/e2e/lib/upgrade-survivor",
'UPGRADE_RUNNER="$UPGRADE_SCENARIO_DIR/run.sh"',
'-v "$UPGRADE_SCENARIO_DIR:/app/scripts/e2e/lib/upgrade-survivor:ro"',
'-v "$UPGRADE_NPM_PUBLISH_PLAN:/app/scripts/lib/npm-publish-plan.mjs:ro"',
'DOCKER_E2E_WINDOWS_HELPERS_PATH="$UPGRADE_WINDOWS_HELPERS"',
'-v "$UPGRADE_BOUNDED_RESPONSE:/app/scripts/lib/bounded-response.mjs:ro"',
'-v "$UPGRADE_PLUGIN_INDEX:/app/scripts/e2e/lib/plugin-index-sqlite.mjs:ro"',
'-v "$UPGRADE_ENV_LIMITS:/app/scripts/e2e/lib/env-limits.mjs:ro"',
'-v "$UPGRADE_TEXT_FILE_UTILS:/app/scripts/e2e/lib/text-file-utils.mjs:ro"',
'-v "$UPGRADE_RUNNER:/tmp/openclaw-upgrade-survivor-run.sh:ro"',
]);
expect(upgradeRunner).not.toContain("UPGRADE_ASSERTION_ARGS");
@ -7124,7 +7130,6 @@ process.exit(73);
"--allow-unreleased-changelog",
'local harness_root="${DOCKER_E2E_HARNESS_ROOT_DIR:-$ROOT_DIR}"',
'-v "$harness_root/scripts/prepublish-plugin-registry-artifact.mjs:/app/scripts/prepublish-plugin-registry-artifact.mjs:ro"',
'-v "$harness_root/scripts/windows-cmd-helpers.mjs:/app/scripts/windows-cmd-helpers.mjs:ro"',
'-v "$harness_root/packages/gateway-client/src:/app/packages/gateway-client/src:ro"',
'-v "$harness_root/packages/normalization-core/package.json:/app/packages/normalization-core/package.json:ro"',
'-v "$harness_root/packages/normalization-core/src:/app/packages/normalization-core/src:ro"',
@ -7158,6 +7163,26 @@ done
]);
});
it("selects one release-owned Windows helper mount", () => {
const script = repoRootShell`
export DOCKER_E2E_HARNESS_ROOT_DIR=/trusted-harness
export DOCKER_E2E_WINDOWS_HELPERS_PATH=/selected/scripts/windows-cmd-helpers.mjs
source "$ROOT_DIR/scripts/lib/docker-e2e-package.sh"
docker_e2e_harness_mount_args
for ((index = 1; index < \${#DOCKER_E2E_HARNESS_ARGS[@]}; index += 2)); do
printf "%s\\n" "\${DOCKER_E2E_HARNESS_ARGS[$index]}"
done
`;
const mounts = execFileSync("bash", ["-lc", script], { encoding: "utf8" })
.trim()
.split("\n")
.filter((mount) => mount.endsWith(":/app/scripts/windows-cmd-helpers.mjs:ro"));
expect(mounts).toEqual([
"/selected/scripts/windows-cmd-helpers.mjs:/app/scripts/windows-cmd-helpers.mjs:ro",
]);
});
it("preserves pnpm lookup paths for scheduled Docker child lanes", () => {
const scheduler = readFileSync(DOCKER_ALL_SCHEDULER_PATH, "utf8");
expect(scheduler).toContain("--allow-unreleased-changelog");

View file

@ -40,6 +40,17 @@ function selectFrozenUpgradeOracle(
'throw new Error("selected oracle has no serving-turn command");\n',
);
writeFileSync(join(selectedScenario, "run.sh"), "# selected scenario runner\n");
for (const path of [
"scripts/lib/npm-publish-plan.mjs",
"scripts/windows-cmd-helpers.mjs",
"scripts/lib/bounded-response.mjs",
"scripts/e2e/lib/plugin-index-sqlite.mjs",
"scripts/e2e/lib/env-limits.mjs",
"scripts/e2e/lib/text-file-utils.mjs",
]) {
mkdirSync(join(selectedRoot, path, ".."), { recursive: true });
writeFileSync(join(selectedRoot, path), "// selected release helper\n");
}
const git = (...args: string[]) =>
execFileSync("git", ["-C", selectedRoot, ...args], { encoding: "utf8" }).trim();
git("init", "--quiet");
@ -1003,7 +1014,30 @@ describe("upgrade survivor assertions", () => {
);
expect(proof.mounts).toEqual(
selected
? ["-v", `${proof.selectedScenario}:/app/scripts/e2e/lib/upgrade-survivor:ro`]
? [
"-v",
`${proof.selectedScenario}:/app/scripts/e2e/lib/upgrade-survivor:ro`,
"-v",
expect.stringMatching(
/npm-publish-plan\.mjs:\/app\/scripts\/lib\/npm-publish-plan\.mjs:ro$/u,
),
"-v",
expect.stringMatching(
/bounded-response\.mjs:\/app\/scripts\/lib\/bounded-response\.mjs:ro$/u,
),
"-v",
expect.stringMatching(
/plugin-index-sqlite\.mjs:\/app\/scripts\/e2e\/lib\/plugin-index-sqlite\.mjs:ro$/u,
),
"-v",
expect.stringMatching(
/env-limits\.mjs:\/app\/scripts\/e2e\/lib\/env-limits\.mjs:ro$/u,
),
"-v",
expect.stringMatching(
/text-file-utils\.mjs:\/app\/scripts\/e2e\/lib\/text-file-utils\.mjs:ro$/u,
),
]
: [],
);
} finally {