-
Notifications
You must be signed in to change notification settings - Fork 140
feat(runner): isolate runtime deps to fix workspace monorepo failures #1381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Michael Price (michael-pr)
merged 32 commits into
main
from
wiz-10907-potential-incompatibility-with-other-monorepo-and-single
Jun 26, 2026
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
6e6b2c6
feat(runner): add runtimeEnv managed-deps domain
michael-pr 9b51d57
fix(runner): harden managed runtime readiness checks
michael-pr 225c519
refactor(runner): defer runtime install + share resolveDepsRoot helper
michael-pr 445f49a
refactor(runner): dedupe runtime-deps helpers and extract flowsRun de…
michael-pr e9b905f
feat(runner): support QAWOLF_RUNTIME_DIR to relocate managed runtime
michael-pr 6a5ba87
test(runner): assert resolve() in QAWOLF_RUNTIME_DIR absolute-path case
michael-pr e4722c6
feat(runner): add `install clear` to reset managed runtime cache
michael-pr a7ba8f4
fix(cli): keep install clear confirm on the Clack timeline
michael-pr 7d5bf2e
fix(cli): use arrow-key confirm for destructive prompts
michael-pr e69f87f
fix(cli): show a spinner while clearing the runtime cache
michael-pr 9a37746
fix(runner): resolve flow imports via managed-deps symlink and binary…
michael-pr 0c5813e
fix(runner): use Windows junction for managed-deps symlink and assert…
michael-pr b22b080
fix(runner): isolate per-run staging and guard managed-runtime deletion
michael-pr de77600
feat(runner): resolve flow deps via layered run-dir with prefer-pinne…
michael-pr 2ad2ff6
fix(runner): share executor instance in binary bundle and surface flo…
michael-pr 390a4ab
fix(runner): prevent staged-flow basename collisions and harden run-d…
michael-pr 99e06f3
refactor(cli): extract shared runStagedFlows orchestrator
michael-pr 6a0e593
refactor(runner): dedupe npm-install spawn into canonical helper
michael-pr 714316a
refactor(runner): decompose shimFlowsDeps into orchestrator + helpers
michael-pr 0a99329
fix(runner): scope inner hop to pinned packages to stop transitive sh…
michael-pr 3156574
fix(runner): relocate run staging out of managed base to fix install …
michael-pr 833c6ce
fix(runner): register run cleanup before setup and drain npm stdout
michael-pr bdfe7c9
fix(runner): abort managed install when a flow-dep shim fails to build
michael-pr 72a8bf1
test(runner): extract shared scaffoldManagedRuntime test helper
michael-pr 49cd1c8
build(runner): support embedded worker bundle in compiled binary
michael-pr 4646917
fix(runner): thread worker env through dispatch layer
michael-pr 82cbb58
refactor(runner): extract flow execution dispatcher
michael-pr 1b6b2ce
docs(runner): runtime deps target design
michael-pr 28d187d
chore(runner): untrack runtime-deps design doc as local-only
michael-pr c6d51e6
docs(runner): apply comment-style to runtime-deps changes
michael-pr 38f4903
chore(runner): add minor changeset for layered runtime-deps resolution
michael-pr e4ead06
test(runner): cover error formatter, staged-run orchestrator, and ins…
michael-pr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@qawolf/cli": minor | ||
| --- | ||
|
|
||
| Resolve flow runtime dependencies through a layered, project-isolated `node_modules` so flows run correctly in monorepos, single-package projects, and empty directories across both the Node and compiled-binary channels. The CLI-owned executor is always pinned and never pollutes or is shadowed by the surrounding project, while the flow's own declared dependencies still resolve. Adds `qawolf install clear` to wipe the managed runtime cache. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { makePeekFlowMeta } from "~/domains/flows/expand.js"; | ||
| import { findFlowStamp as defaultFindFlowStamp } from "~/shell/manifest/lookup.js"; | ||
| import { installBrowserList } from "~/domains/install/browsers.js"; | ||
| import { defaultSpawn } from "~/shell/spawn.js"; | ||
| import { resolvePlaywrightCli } from "~/shell/playwright.js"; | ||
| import { runAndroidFlow as defaultRunAndroidFlow } from "~/domains/runner/runAndroidFlow.js"; | ||
| import { runWebFlow as defaultRunWebFlow } from "~/domains/runner/runWebFlow.js"; | ||
| import { makePooledDispatch } from "~/domains/runner/makePooledDispatch.js"; | ||
| import type { createAndroidDeps } from "~/domains/runner/runAndroidFlowDeps.js"; | ||
| import type { RunWebFlowDeps } from "~/domains/runner/runWebFlow.js"; | ||
| import type { | ||
| FlowsRunDeps, | ||
| FlowsRunFlags, | ||
| } from "~/domains/runner/runInternals.js"; | ||
| import type { CommandContext } from "~/shell/commandContext.js"; | ||
|
|
||
| import { buildRunReporter } from "./buildRunReporter.js"; | ||
|
|
||
| type BuildFlowsRunDepsArgs = { | ||
| ctx: CommandContext; | ||
| resolvedDir: string; | ||
| android: ReturnType<typeof createAndroidDeps>; | ||
| runWebFlowDeps: RunWebFlowDeps; | ||
| flags: FlowsRunFlags; | ||
| }; | ||
|
|
||
| /** | ||
| * Assembles the runner dependency bundle for `flowsRun`. Identical across the | ||
| * local (`flows run`) and hybrid (`--env`) entry points, so both share this | ||
| * single builder. `runWebFlowDeps` is resolved by the caller (it is async and | ||
| * the injection point for tests) and passed in already awaited. | ||
| */ | ||
| export function buildFlowsRunDeps(args: BuildFlowsRunDepsArgs): FlowsRunDeps { | ||
| const { ctx, resolvedDir, android, runWebFlowDeps, flags } = args; | ||
| return { | ||
| peekFlowMeta: makePeekFlowMeta(ctx.fs), | ||
| installBrowsers: (innerCtx, browsers) => | ||
| installBrowserList(innerCtx, browsers, { | ||
| spawn: defaultSpawn, | ||
| platform: process.platform, | ||
| playwrightCliPath: resolvePlaywrightCli(resolvedDir, process.platform), | ||
| }), | ||
| runWebFlow: defaultRunWebFlow, | ||
| runWebFlowDeps, | ||
| runAndroidFlow: defaultRunAndroidFlow, | ||
| runAndroidFlowDeps: android.deps, | ||
| bootAndroid: android.boot, | ||
| shutdownAndroid: android.shutdown, | ||
| createPooledDispatch: makePooledDispatch(resolvedDir), | ||
| findFlowStamp: defaultFindFlowStamp, | ||
| warn: (message) => ctx.ui.warn(message), | ||
| logger: ctx.log("runner"), | ||
| // Route reporter output through ctx.ui so streamed test logs stay inside the run's timeline. | ||
| reporter: buildRunReporter(flags, { | ||
| fs: ctx.fs, | ||
| stdout: { write: (text: string) => ctx.ui.write(text) }, | ||
| stderr: { write: (text: string) => ctx.ui.write(text) }, | ||
| }), | ||
| now: () => Date.now(), | ||
| }; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.