mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-21 20:30:47 +02:00
fix: exclude Windows validator from runtime artifacts
This commit is contained in:
@@ -1049,6 +1049,10 @@ export function runtimeReleaseComponentForPath(value) {
|
|||||||
const relative = component.slice(browserRoot.length);
|
const relative = component.slice(browserRoot.length);
|
||||||
if (relative === ".links" || relative.startsWith(".links/")) return null;
|
if (relative === ".links" || relative.startsWith(".links/")) return null;
|
||||||
const top = relative.split("/")[0];
|
const top = relative.split("/")[0];
|
||||||
|
// Playwright downloads winldd on Windows only to validate browser DLL
|
||||||
|
// dependencies during installation. It is not required to launch Chromium
|
||||||
|
// from the completed managed runtime, so keep it out of release artifacts.
|
||||||
|
if (/^winldd-\d/.test(top)) return null;
|
||||||
if (top.startsWith("chromium_headless_shell-") || top.startsWith("ffmpeg-")) return "browser-headless";
|
if (top.startsWith("chromium_headless_shell-") || top.startsWith("ffmpeg-")) return "browser-headless";
|
||||||
if (/^chromium-\d/.test(top)) return "browser-visible";
|
if (/^chromium-\d/.test(top)) return "browser-visible";
|
||||||
throw installError(`Unknown managed browser payload path: ${component}`, "INSTALL_BROWSER_PAYLOAD_INVALID");
|
throw installError(`Unknown managed browser payload path: ${component}`, "INSTALL_BROWSER_PAYLOAD_INVALID");
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const BOOTSTRAP_RUNTIME_VERSION = "2.0.0";
|
|||||||
// Keep the runtime compatibility version separate from the immutable release
|
// Keep the runtime compatibility version separate from the immutable release
|
||||||
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
||||||
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
||||||
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.3";
|
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.4";
|
||||||
export const OFFICIAL_MANIFEST_URL =
|
export const OFFICIAL_MANIFEST_URL =
|
||||||
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
||||||
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const BOOTSTRAP_RUNTIME_VERSION = "2.0.0";
|
|||||||
// Keep the runtime compatibility version separate from the immutable release
|
// Keep the runtime compatibility version separate from the immutable release
|
||||||
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
||||||
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
||||||
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.3";
|
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.4";
|
||||||
export const OFFICIAL_MANIFEST_URL =
|
export const OFFICIAL_MANIFEST_URL =
|
||||||
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
||||||
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const BOOTSTRAP_RUNTIME_VERSION = "2.0.0";
|
|||||||
// Keep the runtime compatibility version separate from the immutable release
|
// Keep the runtime compatibility version separate from the immutable release
|
||||||
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
||||||
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
||||||
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.3";
|
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.4";
|
||||||
export const OFFICIAL_MANIFEST_URL =
|
export const OFFICIAL_MANIFEST_URL =
|
||||||
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
||||||
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const BOOTSTRAP_RUNTIME_VERSION = "2.0.0";
|
|||||||
// Keep the runtime compatibility version separate from the immutable release
|
// Keep the runtime compatibility version separate from the immutable release
|
||||||
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
||||||
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
||||||
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.3";
|
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.4";
|
||||||
export const OFFICIAL_MANIFEST_URL =
|
export const OFFICIAL_MANIFEST_URL =
|
||||||
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
||||||
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const BOOTSTRAP_RUNTIME_VERSION = "2.0.0";
|
|||||||
// Keep the runtime compatibility version separate from the immutable release
|
// Keep the runtime compatibility version separate from the immutable release
|
||||||
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
||||||
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
||||||
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.3";
|
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.4";
|
||||||
export const OFFICIAL_MANIFEST_URL =
|
export const OFFICIAL_MANIFEST_URL =
|
||||||
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
||||||
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const BOOTSTRAP_RUNTIME_VERSION = "2.0.0";
|
|||||||
// Keep the runtime compatibility version separate from the immutable release
|
// Keep the runtime compatibility version separate from the immutable release
|
||||||
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
||||||
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
||||||
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.3";
|
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.4";
|
||||||
export const OFFICIAL_MANIFEST_URL =
|
export const OFFICIAL_MANIFEST_URL =
|
||||||
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
||||||
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const BOOTSTRAP_RUNTIME_VERSION = "2.0.0";
|
|||||||
// Keep the runtime compatibility version separate from the immutable release
|
// Keep the runtime compatibility version separate from the immutable release
|
||||||
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
// channel. Release candidates carry the 2.0.0 runtime contract while letting
|
||||||
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
// fresh-machine production journeys run before the stable v2.0.0 tag exists.
|
||||||
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.3";
|
export const BOOTSTRAP_RELEASE_TAG = "v2.0.0-rc.4";
|
||||||
export const OFFICIAL_MANIFEST_URL =
|
export const OFFICIAL_MANIFEST_URL =
|
||||||
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
`https://github.com/time-attack/gstack/releases/download/${BOOTSTRAP_RELEASE_TAG}/gstack-runtime-manifest.json`;
|
||||||
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
const CAPABILITIES = new Set(["browser", "browser-visible", "design", "pdf", "diagram", "ios"]);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
defaultBunBuilder,
|
defaultBunBuilder,
|
||||||
installManagedRuntime,
|
installManagedRuntime,
|
||||||
normalizeManagedBrowserTree,
|
normalizeManagedBrowserTree,
|
||||||
|
runtimeReleaseComponentForPath,
|
||||||
runtimeNativePackagePaths,
|
runtimeNativePackagePaths,
|
||||||
uninstallManagedRuntime,
|
uninstallManagedRuntime,
|
||||||
runCommand,
|
runCommand,
|
||||||
@@ -31,6 +32,16 @@ const REPO_ROOT = path.resolve(import.meta.dir, "..");
|
|||||||
const FULL_RUNTIME_TEST_TIMEOUT_MS = process.platform === "win32" ? 120_000 : 30_000;
|
const FULL_RUNTIME_TEST_TIMEOUT_MS = process.platform === "win32" ? 120_000 : 30_000;
|
||||||
|
|
||||||
describe("GStack 2 managed runtime installer", () => {
|
describe("GStack 2 managed runtime installer", () => {
|
||||||
|
test("release staging excludes Playwright bookkeeping and Windows dependency validators", () => {
|
||||||
|
expect(runtimeReleaseComponentForPath(".gstack-runtime-browsers/.links/example")).toBeNull();
|
||||||
|
expect(runtimeReleaseComponentForPath(".gstack-runtime-browsers/winldd-1007/DEPENDENCIES_VALIDATED")).toBeNull();
|
||||||
|
expect(runtimeReleaseComponentForPath(".gstack-runtime-browsers/winldd-1007/winldd.exe")).toBeNull();
|
||||||
|
expect(runtimeReleaseComponentForPath(".gstack-runtime-browsers/chromium_headless_shell-1208/chrome.exe"))
|
||||||
|
.toBe("browser-headless");
|
||||||
|
expect(() => runtimeReleaseComponentForPath(".gstack-runtime-browsers/unknown-1/payload"))
|
||||||
|
.toThrow("Unknown managed browser payload path");
|
||||||
|
});
|
||||||
|
|
||||||
test("browser link normalization accepts internal macOS-style links and rejects escape graphs", async () => {
|
test("browser link normalization accepts internal macOS-style links and rejects escape graphs", async () => {
|
||||||
if (process.platform === "win32") return;
|
if (process.platform === "win32") return;
|
||||||
const root = await fs.mkdtemp(path.join(os.tmpdir(), "gstack-browser-links-"));
|
const root = await fs.mkdtemp(path.join(os.tmpdir(), "gstack-browser-links-"));
|
||||||
|
|||||||
Reference in New Issue
Block a user