Skip to content

fix(ci): portable electron launch for alignment auditor - #702

Merged
Astro-Han merged 2 commits into
mainfrom
fix/audit-alignment-electron-path
Jul 9, 2026
Merged

fix(ci): portable electron launch for alignment auditor#702
Astro-Han merged 2 commits into
mainfrom
fix/audit-alignment-electron-path

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Make the CDP alignment auditor actually boot on ubuntu-latest. #695 wired it into the e2e job as a CI gate but left a macOS-only Electron path and a launch shape that never opens DevTools on Linux, so main and open PRs (including #680) fail the Alignment audit step.

Why

Refs #695 (CI gate introduction). Seen on #680 and #702.

On the runner the failure progressed as:

  1. ENOENT on Electron.app/Contents/MacOS/Electron (hard-coded macOS binary).
  2. After resolving the binary via import('electron'): all 9 fixtures ERROR fetch failed — process spawned, but /json/list never answered (no CDP), with stdio: 'ignore' hiding why.

Playwright e2e on the same job already launches Electron successfully; the auditor did not mirror that launch.

Scope

Changed:

  • scripts/audit-alignment.mjs
    • Resolve Electron via import('electron') (platform-correct binary).
    • Launch like capture-screenshots / e2e: cwd=apps/desktop, app path '.', Chromium switches before the app path.
    • On Linux: --no-sandbox, --disable-gpu, --disable-dev-shm-usage.
    • Pipe stdout/stderr; poll CDP until a page target appears (default 30s) instead of a blind 8.5s sleep.
    • Surface spawn errors and process tails in per-fixture errors; keep fail-on-findings / fail-on-fixture-errors CI semantics.

Not included:

Verification

  • Local macOS (main checkout with built renderer): fixed launch shape reaches CDP page target in ~400ms for fetched-empty (--remote-debugging-port + cwd=apps/desktop + '.').
  • import('electron') on macOS resolves to .../Electron.app/Contents/MacOS/Electron (package export, not a hand-built string).
  • CI e2e job on this PR is the real Linux gate (path resolution + boot + audit).

User-facing impact

None. CI-only script fix; no CHANGELOG, docs, migrations, or breaking changes.

Reviewer notes

  • Risk is low and localized to scripts/audit-alignment.mjs. Rollback restores the broken hard-coded path / launch.
  • If CI still fails after this, fixture ERROR lines now include stderr/stdout tails and exit code so the next root cause is visible.
  • Prefer landing on main quickly so open PRs can re-run without carrying this commit themselves.

Checklist

  • Scope matches the PR title and excludes unrelated changes
  • Verification lists commands/results, or explains why they were not run
  • User-facing impact, docs, changelog, migrations, and breaking changes are noted, or marked none
  • Risk, rollback, or review focus is called out for non-trivial changes
  • UI changes include screenshots/video, or explain why not applicable — N/A, CI script only

#695 made the alignment auditor a CI gate but left the macOS
Electron.app path hardcoded, so ubuntu-latest e2e dies with ENOENT
before any fixture runs (breaks main and every open PR, including
#680). Resolve via the electron package export like capture-screenshots
and real-window-smoke, and fold spawn errors into the per-fixture
failure count instead of an unhandled crash.
Portable electron path alone was not enough: every fixture still died
with "fetch failed" on ubuntu-latest because the auditor launched unlike
capture-screenshots / Playwright e2e (no cwd, switches after app path,
stdio ignored, no Linux sandbox flags, fixed 8.5s sleep).

Align spawn with the working launchers: cwd=apps/desktop, app='.',
Chromium switches first, --no-sandbox/--disable-gpu/--disable-dev-shm-usage
on Linux, pipe stderr/stdout, poll CDP until a page target appears, and
include process tails in fixture errors so the next failure is diagnosable.
@Astro-Han Astro-Han changed the title fix(ci): resolve electron binary portably in alignment auditor fix(ci): portable electron launch for alignment auditor Jul 9, 2026
@Astro-Han
Astro-Han merged commit f635ce9 into main Jul 9, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the fix/audit-alignment-electron-path branch July 14, 2026 05:05
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.

1 participant