Skip to content

fix: Playwright browser preflight prevents #120 false greens - #1432

Merged
BigSimmo merged 27 commits into
mainfrom
cursor/phone-chrome-exit-preflight-1392
Jul 30, 2026
Merged

fix: Playwright browser preflight prevents #120 false greens#1432
BigSimmo merged 27 commits into
mainfrom
cursor/phone-chrome-exit-preflight-1392

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Closes outstanding-issues Merge codex/RAG_FIX modes (Differentials/Services/Forms/Favourites) restyled to Clinical White theme #120 (verify:phone-chrome appearing to exit 0 while logging N failed).
  • Root cause: the Node runners already propagated Playwright’s non-zero exit; the filed exit-0 + N failed symptom matches a shell pipeline without pipefail (cmd 2>&1 | tee … reports tee’s 0 while the log still ends N failed).
  • Hardening: scripts/playwright-browser-preflight.mjs fails before the heavy lock / production build when chrome-headless-shell (or PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH) is missing; verify-phone-chrome announces stage failures on stderr and unit-tests abort-on-first-failure; docs/testing.md documents the pipefail measurement trap.
  • Phone-chrome plan now treats the new preflight / run-playwright scripts as infrastructure inputs.
  • Merge conflict with main resolved (7fbf7131): kept archived #110 (from main) and #120 (this branch); dropped both stale open rows that collided at the same table position. npm run check:outstanding-issues and git merge-tree --write-tree origin/main HEAD are clean.

Test plan

  • PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/tmp/missing-… node scripts/run-playwright.mjs --project=chromium → exit 1 with preflight message (no build).
  • npm run test -- tests/playwright-browser-preflight.test.ts tests/verify-phone-chrome.test.ts tests/test-runner-safety.test.ts42 passed.
  • npm run check:outstanding-issues → passed after archiving Merge codex/RAG_FIX modes (Differentials/Services/Forms/Favourites) restyled to Clinical White theme #120 / after merge resolution.
  • npm run verify:phone-chrome -- --dry-run --files scripts/playwright-browser-preflight.mjs,… selects lock/runtime/contracts.
  • git merge origin/main conflict resolved; git merge-tree --write-tree origin/main HEAD clean.
  • CI static-pr / pr-required on this branch.
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Bug Fixes

    • Playwright checks now fail early when required browser binaries are missing, preventing misleading successful results.
    • Phone-browser verification now reports failures clearly and stops at the first failed stage.
    • Improved reliability when moving focus during phone scrolling and document section navigation.
  • Documentation

    • Updated testing and script guidance for browser preflight checks and accurate pipeline failure reporting.
    • Recorded resolved issue and review ledger updates.

Root-cause #120: exit-0 with "N failed" came from shell pipelines without
pipefail; Node runners already propagated Playwright status. Add a Chromium
headless-shell preflight before the heavy lock/build, announce phone-chrome
stage failures on stderr, and document the measurement trap.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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: 24 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

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: CHILL

Plan: Pro

Run ID: 365caee7-6b8d-427c-a2e2-c8cbb3dd0561

📥 Commits

Reviewing files that changed from the base of the PR and between 7fbf713 and 277333c.

📒 Files selected for processing (2)
  • docs/branch-review-ledger.md
  • docs/scripts-index.md
📝 Walkthrough

Walkthrough

Adds Playwright browser-binary preflight checks before build startup, refactors phone-chrome stage execution to fail fast, strengthens related tests and documentation, and updates phone-scroll focus assertions and review records.

Changes

Runner hardening and reliability

Layer / File(s) Summary
Browser preflight and runner wiring
scripts/playwright-browser-preflight.mjs, scripts/run-playwright.mjs, scripts/phone-chrome-plan.mjs, tests/playwright-browser-preflight.test.ts, tests/test-runner-safety.test.ts, docs/testing.md, docs/scripts-index.md
Playwright projects now resolve and validate required browser executables before locking, building, or starting the isolated server. Tests cover project parsing, path resolution, missing binaries, overrides, and runner ordering.
Phone-chrome stage execution
scripts/verify-phone-chrome.mjs, tests/verify-phone-chrome.test.ts, docs/outstanding-issues.md
Command and stage runners are exported and injectable, direct execution is guarded, failures are reported on stderr, and execution stops at the first non-zero stage result.
Phone-scroll assertions and review records
tests/ui-phone-scroll.spec.ts, docs/branch-review-ledger.md
The phone-scroll test focuses reader content without scrolling and verifies the section trigger loses focus; review records are appended for the related reliability work.

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

Sequence Diagram(s)

sequenceDiagram
  participant PlaywrightRunner
  participant BrowserPreflight
  participant Filesystem
  PlaywrightRunner->>BrowserPreflight: validate requested projects
  BrowserPreflight->>Filesystem: check browser executable paths
  Filesystem-->>BrowserPreflight: return path availability
  BrowserPreflight-->>PlaywrightRunner: continue or exit with failure
Loading

Possibly related PRs

Suggested reviewers: cursoragent

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is concise and accurately reflects the main change: adding Playwright browser preflight to prevent false greens.
Description check ✅ Passed The description covers summary, root cause, hardening, and verification results, but it omits the template's Risk and rollout section.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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

@supabase

supabase Bot commented Jul 30, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review July 30, 2026 10:59

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a419a1ef6b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/playwright-browser-preflight.mjs Outdated
Comment thread scripts/playwright-browser-preflight.mjs Outdated
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 3 failed job(s):

  • Visual baselines (advisory)needs investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • Production UI (1)needs investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #6895 (cancelled).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@BigSimmo

Copy link
Copy Markdown
Owner Author

@cursoragent resolve merge conflict

@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Merge conflict on PR #1432 is resolved and pushed (7fbf7131).

Only conflict was in docs/outstanding-issues.md: #110 (open on our branch, already archived on main) vs #120 (open on main, already archived on this branch). Kept both archive rows and dropped both stale open rows.

npm run check:outstanding-issues passed; git merge-tree vs origin/main is clean.

Open in Web Open in Cursor 

Keep both archived resolutions (#110 from main, #120 from this branch)
and drop the stale open rows that conflicted at the same table position.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo enabled auto-merge (squash) July 30, 2026 13:13
@BigSimmo
BigSimmo disabled auto-merge July 30, 2026 14:12
@BigSimmo
BigSimmo enabled auto-merge (squash) July 30, 2026 14:44
@BigSimmo
BigSimmo merged commit 3054d68 into main Jul 30, 2026
25 checks passed
@BigSimmo
BigSimmo deleted the cursor/phone-chrome-exit-preflight-1392 branch July 30, 2026 14:58
BigSimmo pushed a commit that referenced this pull request Jul 30, 2026
This was a REAL conflict, not staleness, and it is why PR #1466 had no `CI`
workflow run at all — only the four `pull_request_target` checks. GitHub could
not build refs/pull/1466/merge. That is #116's signature: a missing check list
is a conflict signal, not a green pass. `git merge-tree` exited 1 on
tests/ui-phone-scroll.spec.ts while `PR mergeability` still showed success from
before main advanced.

main's #1432 edited a hunk inside the `phoneOwner` loop — precisely the region
this branch moved to ui-phone-scroll-page-owned.spec.ts — so git saw one side
delete the region and the other modify it.

Resolved by taking this branch's shell-only ui-phone-scroll.spec.ts and
re-applying #1432's change at its new home. That change is a genuine flake fix
(sheet focus restoration retries after 50 ms when focus falls through to
<body>, so a bare blur races the retry and can re-pin the header), and dropping
it in a merge would have silently reintroduced the flake — the same
fails-by-running-nothing class this branch exists to close. It went to the
occurrence in the section-sheet round-trip, matched by the hunk's own context,
not the similar-looking line 95 lines earlier.

No content lost, proven rather than asserted: every non-trivial line of main's
ui-phone-scroll.spec.ts is present across the three split files plus the shared
helper. The only 22 differences are declarations that gained an `export `
prefix and the two imports whose path changed depth.

Verified on the merged tree: verify:cheap exit 0, Test Files 437 passed (437),
Tests 4588 passed | 4 skipped (4592); tsc --noEmit clean; prettier --check .
clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHLPEV4o1rzipPDqshCSHY
BigSimmo pushed a commit that referenced this pull request Jul 30, 2026
Earlier today I recorded on #121 that a sandboxed remote session has only two
options for the Chromium 1194-vs-1234 mismatch: get the /opt write permission,
or decline to claim browser evidence. That was an over-generalisation from a
single blocked mkdir, and it is wrong.

PR #1432 landed a preflight whose own failure message names the route I had
missed: PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH, read by playwright.config.ts:11 and
honoured by scripts/playwright-browser-preflight.mjs:101. It needs no filesystem
write. Verified by launching rather than by reading the flag — the container's
existing 1194 headless_shell drives fine under the repo's Playwright 1.62 client
(version 141.0.7390.37, page rendered, boundingBox measured).

#121 keeps the wrong sentence with the retraction beside it, because which claim
was wrong and why is the part worth carrying forward. #130's recorded blocker for
the pre-paint guard is marked LIFTED: that guard is buildable in a remote session
after all. Also records #1432 itself, which no row referenced.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018K7sEKH35KZkWxvCnQcNN2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants