ci: shard release validation reruns

This commit is contained in:
Peter Steinberger
2026-04-27 23:38:09 +01:00
parent d2320e4d4b
commit 39e3d8d31d
13 changed files with 295 additions and 58 deletions

View File

@@ -69,7 +69,6 @@ const BUNDLED_RUNTIME_DEPS_OWNERLESS_LOCK_STALE_MS = 30_000;
const BUNDLED_RUNTIME_DEPS_INSTALL_PROGRESS_INTERVAL_MS = 5_000;
const BUNDLED_RUNTIME_MIRROR_MATERIALIZED_EXTENSIONS = new Set([".cjs", ".js", ".mjs"]);
const BUNDLED_EXTENSION_DIST_DIR = "extensions";
const BUNDLED_RUNTIME_MIRROR_PLUGIN_REGION_RE = /(?:^|\n)\/\/#region extensions\/[^/\s]+(?:\/|$)/u;
const MIRRORED_CORE_RUNTIME_DEP_NAMES = ["tslog"] as const;
const MIRRORED_PACKAGE_RUNTIME_DEP_PLUGIN_ID = "openclaw-core";
@@ -82,14 +81,7 @@ export type BundledRuntimeDepsNpmRunner = {
};
export function shouldMaterializeBundledRuntimeMirrorDistFile(sourcePath: string): boolean {
if (!BUNDLED_RUNTIME_MIRROR_MATERIALIZED_EXTENSIONS.has(path.extname(sourcePath))) {
return false;
}
try {
return BUNDLED_RUNTIME_MIRROR_PLUGIN_REGION_RE.test(fs.readFileSync(sourcePath, "utf8"));
} catch {
return false;
}
return BUNDLED_RUNTIME_MIRROR_MATERIALIZED_EXTENSIONS.has(path.extname(sourcePath));
}
export function materializeBundledRuntimeMirrorDistFile(

View File

@@ -20,7 +20,7 @@ afterEach(() => {
});
describe("prepareBundledPluginRuntimeRoot", () => {
it("materializes plugin-owned root chunks in external mirrors", () => {
it("materializes root JavaScript chunks in external mirrors", () => {
const packageRoot = makeTempRoot();
const stageDir = makeTempRoot();
const pluginRoot = path.join(packageRoot, "dist", "extensions", "browser");
@@ -42,6 +42,11 @@ describe("prepareBundledPluginRuntimeRoot", () => {
].join("\n"),
"utf8",
);
fs.writeFileSync(
path.join(packageRoot, "dist", "shared-runtime.js"),
"export const shared = 'mirrored-without-region';\n",
"utf8",
);
fs.writeFileSync(
path.join(pluginRoot, "index.js"),
`import { marker } from "../../pw-ai.js"; export default { id: "browser", marker };\n`,
@@ -106,6 +111,9 @@ describe("prepareBundledPluginRuntimeRoot", () => {
expect(fs.existsSync(staleMirrorChunk)).toBe(true);
expect(fs.lstatSync(staleMirrorChunk).isSymbolicLink()).toBe(false);
expect(fs.readFileSync(staleMirrorChunk, "utf8")).toContain("playwright-core");
expect(fs.lstatSync(path.join(installRoot, "dist", "shared-runtime.js")).isSymbolicLink()).toBe(
false,
);
});
it("does not copy staged runtime mirror dist files onto themselves", () => {

View File

@@ -1714,7 +1714,7 @@ module.exports = {
expect(registry?.plugins.find((entry) => entry.id === "alpha")?.status).toBe("loaded");
});
it("materializes plugin-owned root chunks in external runtime mirrors", () => {
it("materializes root JavaScript chunks in external runtime mirrors", () => {
const packageRoot = makeTempDir();
const stageDir = makeTempDir();
const bundledDir = path.join(packageRoot, "dist", "extensions");
@@ -1736,6 +1736,11 @@ module.exports = {
].join("\n"),
"utf-8",
);
fs.writeFileSync(
path.join(packageRoot, "dist", "shared-runtime.js"),
"export const shared = 'mirrored-without-region';\n",
"utf-8",
);
fs.writeFileSync(
path.join(pluginRoot, "index.js"),
[
@@ -1829,6 +1834,9 @@ module.exports = {
expect(reloadedRegistry.plugins.find((entry) => entry.id === "browser")?.status).toBe("loaded");
expect(fs.existsSync(stagedMirrorChunk)).toBe(true);
expect(
fs.lstatSync(path.join(actualInstallRoot, "dist", "shared-runtime.js")).isSymbolicLink(),
).toBe(false);
});
it("loads bundled plugins with plugin-sdk imports from an external stage dir", () => {