fix(qa): ship scenario pack and isolate completion cache

This commit is contained in:
Vincent Koc
2026-04-11 12:42:23 +01:00
parent 8a8fdc971c
commit 636fe1c2db
5 changed files with 182 additions and 7 deletions

View File

@@ -36,6 +36,7 @@ const requiredPathGroups = [
...listPluginSdkDistArtifacts(),
...listBundledPluginPackArtifacts(),
...listStaticExtensionAssetOutputs(),
...listRequiredQaScenarioPackPaths(),
"scripts/npm-runner.mjs",
"scripts/postinstall-bundled-plugins.mjs",
"dist/plugin-sdk/compat.js",
@@ -59,6 +60,14 @@ const appcastPath = resolve("appcast.xml");
const laneBuildMin = 1_000_000_000;
const laneFloorAdoptionDateKey = 20260227;
export function listRequiredQaScenarioPackPaths(): string[] {
const scenariosDir = resolve("qa/scenarios");
return readdirSync(scenariosDir, { withFileTypes: true })
.filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
.map((entry) => `qa/scenarios/${entry.name}`)
.toSorted((left, right) => left.localeCompare(right));
}
function collectBundledExtensions(): BundledExtension[] {
const extensionsDir = resolve("extensions");
const entries = readdirSync(extensionsDir, { withFileTypes: true }).filter((entry) =>
@@ -199,6 +208,32 @@ function runPackedBundledChannelEntrySmoke(): void {
},
},
);
const homeDir = join(tmpRoot, "home");
const stateDir = join(tmpRoot, "state");
mkdirSync(homeDir, { recursive: true });
execFileSync(
process.execPath,
[join(packageRoot, "openclaw.mjs"), "completion", "--write-state"],
{
cwd: packageRoot,
stdio: "inherit",
env: {
...process.env,
HOME: homeDir,
OPENCLAW_STATE_DIR: stateDir,
OPENCLAW_SUPPRESS_NOTES: "1",
OPENCLAW_DISABLE_BUNDLED_ENTRY_SOURCE_FALLBACK: "1",
},
},
);
const completionFiles = readdirSync(join(stateDir, "completions")).filter(
(entry) => !entry.startsWith("."),
);
if (completionFiles.length === 0) {
throw new Error("release-check: packed completion smoke produced no completion files.");
}
} finally {
rmSync(tmpRoot, { recursive: true, force: true });
}