Skip to content

fix(cli): unify the "tool not found" remedies on qawolf install - #1416

Merged
Simon Ingeson (smonn) merged 4 commits into
mainfrom
wiz-11284
Jul 30, 2026
Merged

fix(cli): unify the "tool not found" remedies on qawolf install#1416
Simon Ingeson (smonn) merged 4 commits into
mainfrom
wiz-11284

Conversation

@smonn

@smonn Simon Ingeson (smonn) commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Relates to WIZ-11284

Overview of Changes

Ten messages described one state — a pinned binary missing from the resolved deps root — and gave four different remedies between them. Two told the user to npm install playwright, which is wrong: the CLI pins and installs playwright and appium itself, so a user's project never needs a copy. Every site now names the path it looked for and gives one remedy, qawolf install.

Getting there needed a resolution fix first. allPinnedResolved required the playwright shim but checked only appium's package version, and a matching version does not imply a runnable shim — so a partial install resolved as complete and flows run failed to spawn appium after install had reported success. Requiring both shims makes that state self-heal, which is what lets every caller give the same remedy instead of splitting on whether it can safely say "run qawolf install". Kept as three commits: the original two-variant pass, the shim fix, then the collapse.

The ticket listed five messages; the sweep found ten. @qawolf/emails and @qawolf/testkit carried the same wrong npm install advice for packages the CLI pins, and neither had a test. moduleNotFoundHint keeps its npm install advice on purpose — that one is about a user's own flow dependency.

Testing

All ten failure paths were driven against an empty deps directory and the rendered output read by hand, not just asserted in tests. Four seams gained first-time coverage: installBrowserList, defaultRunWebFlowDeps, configureEmails, and configureTestkit.

bun run typecheck
bun run lint
bun run format:check
bun run knip
bun run test    # 1239 pass
bun run build

Checklist

  • Changes follow the code style of this project
  • Self-review completed
  • Tests added/updated (or not applicable)
  • No breaking changes (or described below)

allPinnedResolved is stricter, so a deps root whose appium shim is missing but whose package version matches no longer resolves. That root previously produced a runtime spawn failure, so the change trades a late failure for an install. This also tightens what qawolf flows run --deps <dir> accepts: a prepared directory now needs the appium shim, not just a matching appium version. ensureRuntimeEnv.ts:56 rejects such a directory without naming the missing packages — left out of scope and tracked separately.

Six messages described one state — a pinned binary missing from the
resolved deps root — and gave four remedies between them. Two told the
user to `npm install playwright`, which is wrong: the CLI pins and
installs playwright and appium itself via ensureRuntimeEnv, so the
user's project never needs a copy.

The remedy now follows the caller, not the tool. `qawolf doctor` is
diagnostic and says `qawolf install`. Callers reached after the deps
root resolved cannot repeat that step, so they name the incomplete
directory and say `qawolf install clear`. Every message names the path
it looked for, including the two Playwright ones that named none.

Collapses doctor's appium.noEnvDir and appium.binaryMissing into one
appium.notFound: "no env dir" is the no-path case of the same message.

Closes WIZ-11284
allPinnedResolved required the playwright shim but checked only appium's
package version. A matching version does not imply a runnable shim, so a
partial install resolved as complete and `flows run` then failed to spawn
appium — after install had reported success.

Requiring both shims makes that state self-heal: a missing shim now
invalidates the root, so ensureRuntimeEnv reinstalls it or falls through
to a fresh managed dir.
The shim fix makes an incomplete-but-resolved deps root unreachable, so
the two-variant split from the previous commit no longer earns its keep.
Every site now gives one remedy, `qawolf install`, and names the path it
looked for.

Also covers four load-failure sites of the same class that the ticket
missed. @qawolf/emails and @qawolf/testkit both told the user to run
`npm install` for packages the CLI pins and installs itself.

Refs WIZ-11284
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fb439a79-e13d-46c1-9c64-c84139b98fe5

📥 Commits

Reviewing files that changed from the base of the PR and between 27ce7bf and ba889e8.

📒 Files selected for processing (2)
  • src/core/messages/toolNotFound.test.ts
  • src/domains/runtimeEnv/resolvePinned.test.ts

Walkthrough

Adds shared remediation helpers for missing or unloadable runtime tools and applies them across doctor checks, installation flows, runners, and SDK loaders. Playwright and Appium diagnostics now include candidate paths where available. Pinned environment resolution now requires both Playwright and Appium CLI shims, with updated test fixtures for Linux and Windows. New tests verify standardized messages and preserved load-failure causes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant configureEmails
  participant packageLoadFailed
  participant toolNotRunnable
  participant Error
  configureEmails->>packageLoadFailed: package name, env directory, load detail
  packageLoadFailed->>toolNotRunnable: package load description and detail
  toolNotRunnable-->>packageLoadFailed: standardized remediation message
  packageLoadFailed-->>configureEmails: formatted failure message
  configureEmails->>Error: throw with original cause
Loading

Possibly related PRs

  • qawolf/cli#1409: Related refactoring of Playwright and Appium doctor checks to resolve candidate CLI paths.
  • qawolf/cli#1411: Related Windows CLI candidate handling for Playwright and Appium shims.

Suggested reviewers: michael-pr, chajac

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the unified tool-not-found remedy changes.
Description check ✅ Passed The description matches the template with linked issue, overview, testing, and checklist sections filled in.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wiz-11284

Comment @coderabbitai help to get the list of available commands.

@smonn

Copy link
Copy Markdown
Contributor Author

CodeRabbit (@coderabbitai) review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/messages/toolNotFound.test.ts`:
- Around line 5-32: Add a direct test case in the existing message tests for
packageLoadFailed, asserting its output includes the package name, environment
path, original failure detail, and the shared qawolf install remedy. Follow the
existing toolNotInstalled and toolNotRunnable assertion style.

In `@src/domains/runtimeEnv/resolvePinned.test.ts`:
- Around line 122-128: Rename the Windows-specific tests around the pinned
package resolution cases to explicitly mention both required shims, playwright
and appium, for the .cmd and .exe variants. Update only the test titles,
including the case around the second referenced location, while preserving their
setup and assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a78e8403-70eb-4f07-83bc-c451461c0bbe

📥 Commits

Reviewing files that changed from the base of the PR and between 67e8ce1 and 27ce7bf.

📒 Files selected for processing (27)
  • src/commands/resolveDepsRoot.test.ts
  • src/core/messages/doctor.ts
  • src/core/messages/index.ts
  • src/core/messages/install.ts
  • src/core/messages/runner.ts
  • src/core/messages/toolNotFound.test.ts
  • src/core/messages/toolNotFound.ts
  • src/domains/doctor/checks/androidAppium.test.ts
  • src/domains/doctor/checks/androidAppium.ts
  • src/domains/doctor/checks/playwright.test.ts
  • src/domains/doctor/checks/playwright.ts
  • src/domains/emails/configureEmails.test.ts
  • src/domains/emails/configureEmails.ts
  • src/domains/install/android/driver.test.ts
  • src/domains/install/browsers.test.ts
  • src/domains/install/browsers.ts
  • src/domains/runner/runWebFlowDeps.test.ts
  • src/domains/runner/runWebFlowDeps.ts
  • src/domains/runtimeEnv/ensureRuntimeEnv.test.ts
  • src/domains/runtimeEnv/installPinned.test.ts
  • src/domains/runtimeEnv/installPinned.ts
  • src/domains/runtimeEnv/resolveDepsRootIfPresent.test.ts
  • src/domains/runtimeEnv/resolvePinned.test.ts
  • src/domains/runtimeEnv/resolvePinned.ts
  • src/shell/appium/createAppiumServer.test.ts
  • src/shell/testkit.test.ts
  • src/shell/testkit.ts

Comment thread src/core/messages/toolNotFound.test.ts
Comment thread src/domains/runtimeEnv/resolvePinned.test.ts Outdated
The Windows shim tests seed both shims but their names claimed only
playwright, so a failure pointed at the wrong contract. The absent-shim
test now seeds the other shim, so it fails for the reason it names.
@smonn
Simon Ingeson (smonn) merged commit 5b2c2d3 into main Jul 30, 2026
7 checks passed
@smonn
Simon Ingeson (smonn) deleted the wiz-11284 branch July 30, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants