Skip to content

feat(ci): add windows arm64 e2e#1653

Merged
zerob13 merged 6 commits into
devfrom
codex/windows-arm
May 21, 2026
Merged

feat(ci): add windows arm64 e2e#1653
zerob13 merged 6 commits into
devfrom
codex/windows-arm

Conversation

@zerob13
Copy link
Copy Markdown
Collaborator

@zerob13 zerob13 commented May 21, 2026

Summary

  • add a manual Windows ARM64 E2E workflow on windows-11-arm
  • add best-effort runtime installation for Windows ARM64 bundled runtimes
  • add CI smoke E2E support with isolated profile and local OpenAI-compatible mock provider

Tests

  • pnpm run format
  • pnpm run format:check
  • pnpm run i18n
  • pnpm run lint
  • pnpm run typecheck
  • pnpm exec vitest --config vitest.config.ts test/main/scripts/install-optional-runtimes.test.js test/main/lib/runtimeHelper.test.ts test/main/presenter/skillPresenter/skillExecutionService.test.ts --run

Notes

  • Windows ARM64 production build/release matrix remains gated until this manual workflow runs green on GitHub.

Summary by CodeRabbit

  • New Features

    • Added Windows ARM64 build support with a manual CI workflow and updated Windows build matrix.
  • Documentation

    • Added Windows ARM64 plan, spec, and task roadmap; updated E2E guidance for CI/manual validation.
  • Tests

    • New CI-focused smoke test script and config; E2E fixture now supports packaged-mode launches.
    • Added unit tests validating runtime fallback and Python runtime failure paths.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 060dee0d-e6a5-4dfe-816f-7826e99a22a3

📥 Commits

Reviewing files that changed from the base of the PR and between 15e1743 and ee848ef.

📒 Files selected for processing (4)
  • .github/workflows/build.yml
  • docs/features/windows-arm64-support/plan.md
  • docs/features/windows-arm64-support/spec.md
  • docs/features/windows-arm64-support/tasks.md
✅ Files skipped from review due to trivial changes (2)
  • docs/features/windows-arm64-support/spec.md
  • docs/features/windows-arm64-support/plan.md

📝 Walkthrough

Walkthrough

Adds Windows ARM64 E2E support: packaged-app Playwright fixture, CI-specific Playwright config and npm script, ARM64 runtime injector changes, a manual windows-11-arm GitHub Actions workflow to build & smoke-test the packaged app, runtime fallback unit tests, and supporting docs.

Changes

Windows ARM64 E2E Support

Layer / File(s) Summary
Packaged Electron App Fixture
test/e2e/fixtures/electronApp.ts
Electron fixture now supports packaged vs development app launch modes via DEEPCHAT_E2E_APP_MODE. Adds packaged executable resolution (env override or Windows default derived from arch), centralizes launch-target validation, and branches electron.launch to use executablePath (packaged) or args: ['.'] (development).
CI E2E Config & Scripts
test/e2e/playwright.ci.config.ts, test/e2e/helpers/testData.ts, package.json
Adds playwright.ci.config.ts restricting tests to launch and settings-navigation smoke specs with CI retries and HTML reporting, adds e2e:smoke:ci npm script, and makes provider/model targets overridable via DEEPCHAT_E2E_PROVIDER_ID/DEEPCHAT_E2E_MODEL_ID with fallbacks.
Windows ARM64 Runtime Injector Changes
package.json
Updates installRuntime:win:arm64 to inject only uv, node, and ripgrep (pins ripgrep to 15.1.0) and removes rtk injection to allow fallback behavior when ARM64 binaries are not bundled.
Manual Windows ARM64 GitHub Workflow
.github/workflows/windows-arm64-e2e.yml
New manual windows-11-arm workflow: installs Node 24.14.1 & pnpm, installs verified native ARM64 runtimes, builds the win-arm64 package with electron-builder, verifies the feishu plugin bundle, runs packaged E2E smoke tests against the built DeepChat.exe, and uploads artifacts and reports unconditionally.
Runtime Fallback Tests
test/main/lib/runtimeHelper.test.ts, test/main/presenter/skillPresenter/skillExecutionService.test.ts
Adds unit tests asserting RuntimeHelper.initializeRuntimes(true) yields null bundled runtime paths and no PATH prepend when files are absent, and that SkillExecutionService.resolvePythonRuntime('auto', ...) rejects when neither bundled nor system Python are available.
E2E Testing Documentation
test/e2e/README.md
Clarifies manual vs CI smoke testing: default pnpm run e2e:smoke runs against the local desktop profile with no mocks; pnpm run e2e:smoke:ci is credential-free and only runs launch and settings-navigation smoke specs for CI/Windows ARM64 validation.
Windows ARM64 Feature Documentation
docs/features/windows-arm64-support/plan.md, docs/features/windows-arm64-support/spec.md, docs/features/windows-arm64-support/tasks.md
Adds plan, spec, and task checklist describing the manual workflow, CI E2E scope, runtime injector expectations (uv/node/ripgrep), ripgrep pinning, rtk omission for fallback, validation coverage, and task completion status.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A rabbit hopped in, with a build to behold,

Packaged and tested on ARM, brave and bold.
Runtimes checked gently, fallbacks kept neat,
Smoke tests did dance on the Windows-arm seat.
Artifacts uploaded — the CI carrots, a treat.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(ci): add windows arm64 e2e' clearly and concisely summarizes the main change: adding Windows ARM64 end-to-end testing via GitHub Actions workflow and supporting infrastructure.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/windows-arm

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
docs/features/windows-arm64-support/spec.md (1)

18-20: 💤 Low value

Consider varying sentence structure in the Non-Goals section.

All three non-goal items begin with "Do not," which slightly reduces readability. While acceptable for a bulleted list, consider rewording for variety.

✍️ Optional rewording suggestion
 ## Non-Goals
 
 - Do not enable Windows ARM64 in the production build/release matrix until the manual Windows ARM64 E2E workflow has passed.
-- Do not guarantee every optional runtime is bundled on Windows ARM64.
-- Do not use real provider API keys in CI.
+- Not every optional runtime is guaranteed to be bundled on Windows ARM64.
+- Real provider API keys must not be used in CI.
🤖 Prompt for 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.

In `@docs/features/windows-arm64-support/spec.md` around lines 18 - 20, The three
bullets in the Non-Goals section all start with "Do not," making the list
repetitive; rephrase each item to vary sentence structure while preserving
intent — e.g., change "Do not enable Windows ARM64 in the production
build/release matrix until the manual Windows ARM64 E2E workflow has passed" to
"Enable Windows ARM64 in the production build/release matrix only after the
manual Windows ARM64 E2E workflow has passed," change "Do not guarantee every
optional runtime is bundled on Windows ARM64" to "There is no guarantee that
every optional runtime will be bundled on Windows ARM64," and change "Do not use
real provider API keys in CI" to "Use mock or scoped provider API keys in CI
rather than real keys"; apply these rewordings in the Non-Goals section and keep
original meaning and negative constraints intact.
docs/features/windows-arm64-support/plan.md (1)

5-7: 💤 Low value

Consider varying sentence structure in the Architecture section.

All three architecture bullet points begin with "Add," which slightly reduces readability. Consider restructuring for better flow.

✍️ Optional rewording suggestion
 ## Architecture
 
-- Add a Windows ARM64 manual workflow that runs on GitHub's `windows-11-arm` runner and validates a packaged/unpacked ARM64 build with Playwright Electron smoke tests.
-- Add a small runtime installer wrapper for Windows ARM64 that calls `tiny-runtime-injector` per runtime and treats failures as skipped optional artifacts.
-- Add a CI-specific E2E mode that starts a local OpenAI-compatible mock server, injects a provider/model through existing typed routes, completes onboarding, and runs the existing smoke specs against an isolated profile.
+- A Windows ARM64 manual workflow runs on GitHub's `windows-11-arm` runner and validates a packaged/unpacked ARM64 build with Playwright Electron smoke tests.
+- A small runtime installer wrapper for Windows ARM64 calls `tiny-runtime-injector` per runtime and treats failures as skipped optional artifacts.
+- A CI-specific E2E mode starts a local OpenAI-compatible mock server, injects a provider/model through existing typed routes, completes onboarding, and runs the existing smoke specs against an isolated profile.
🤖 Prompt for 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.

In `@docs/features/windows-arm64-support/plan.md` around lines 5 - 7, Reword the
Architecture section to vary sentence openings instead of repeating "Add" for
each bullet; update the three bullets (the Windows ARM64 manual workflow bullet,
the runtime installer wrapper bullet, and the CI-specific E2E mode bullet) to
use diverse structures (e.g. start one with a goal like "Validate a
packaged/unpacked ARM64 build...", another with an implementation phrase like
"Introduce a small runtime installer wrapper...", and the third with an outcome
like "Provide a CI-specific E2E mode that..."), keeping original details intact
and preserving references to `windows-11-arm`, `tiny-runtime-injector`, and the
OpenAI-compatible mock server where present.
🤖 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 @.github/workflows/windows-arm64-e2e.yml:
- Line 16: Replace tag-based action refs with pinned commit SHAs for all
external actions referenced (actions/checkout@v6, actions/setup-node@v6,
pnpm/action-setup@v6, actions/upload-artifact@v6) so the workflow uses immutable
commits instead of floating tags; specifically update each action ref to its
corresponding full commit SHA. Also add with: persist-credentials: false to the
actions/checkout step (the checkout action invocation) to disable credential
persistence after checkout. Ensure the modified workflow preserves existing
inputs (e.g., node-version, cache settings) while only changing the action refs
and adding the persist-credentials setting.

In `@test/e2e/README.md`:
- Around line 27-31: The README documents provider/model IDs
(`e2e-openai-compatible`, `deepchat-e2e-mock`) that don’t match the
implementation; open test/e2e/helpers/testData.ts, find the actual provider and
model IDs used by the CI mock path (look for constants/objects that define
provider or model names) and update test/e2e/README.md to those exact IDs, or
alternatively change the IDs in testData.ts to match the README so they are
consistent; reference the symbol names you find in testData.ts (e.g., the
provider/model constants or map keys) and ensure the README text exactly matches
those identifiers.

---

Nitpick comments:
In `@docs/features/windows-arm64-support/plan.md`:
- Around line 5-7: Reword the Architecture section to vary sentence openings
instead of repeating "Add" for each bullet; update the three bullets (the
Windows ARM64 manual workflow bullet, the runtime installer wrapper bullet, and
the CI-specific E2E mode bullet) to use diverse structures (e.g. start one with
a goal like "Validate a packaged/unpacked ARM64 build...", another with an
implementation phrase like "Introduce a small runtime installer wrapper...", and
the third with an outcome like "Provide a CI-specific E2E mode that..."),
keeping original details intact and preserving references to `windows-11-arm`,
`tiny-runtime-injector`, and the OpenAI-compatible mock server where present.

In `@docs/features/windows-arm64-support/spec.md`:
- Around line 18-20: The three bullets in the Non-Goals section all start with
"Do not," making the list repetitive; rephrase each item to vary sentence
structure while preserving intent — e.g., change "Do not enable Windows ARM64 in
the production build/release matrix until the manual Windows ARM64 E2E workflow
has passed" to "Enable Windows ARM64 in the production build/release matrix only
after the manual Windows ARM64 E2E workflow has passed," change "Do not
guarantee every optional runtime is bundled on Windows ARM64" to "There is no
guarantee that every optional runtime will be bundled on Windows ARM64," and
change "Do not use real provider API keys in CI" to "Use mock or scoped provider
API keys in CI rather than real keys"; apply these rewordings in the Non-Goals
section and keep original meaning and negative constraints intact.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7ab240ba-72eb-455c-983f-8a2a51cfa4b9

📥 Commits

Reviewing files that changed from the base of the PR and between 223a517 and 92bbce4.

📒 Files selected for processing (15)
  • .github/workflows/windows-arm64-e2e.yml
  • docs/features/windows-arm64-support/plan.md
  • docs/features/windows-arm64-support/spec.md
  • docs/features/windows-arm64-support/tasks.md
  • package.json
  • scripts/install-optional-runtimes.mjs
  • src/main/index.ts
  • test/e2e/README.md
  • test/e2e/fixtures/electronApp.ts
  • test/e2e/helpers/mockProvider.ts
  • test/e2e/helpers/testData.ts
  • test/e2e/playwright.ci.config.ts
  • test/main/lib/runtimeHelper.test.ts
  • test/main/presenter/skillPresenter/skillExecutionService.test.ts
  • test/main/scripts/install-optional-runtimes.test.js

Comment thread .github/workflows/windows-arm64-e2e.yml Outdated
Comment thread test/e2e/README.md Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@test/e2e/fixtures/electronApp.ts`:
- Line 160: The fixture currently forwards the whole host environment via the
env: process.env line which allows the app to write into the developer's real
profile; change the electronApp fixture to create a temporary isolated user-data
directory and set env to a shallow clone of process.env with profile-related
variables overridden (e.g., HOME and/or USERPROFILE and XDG_CONFIG_HOME or the
Electron-specific user-data-dir env/flag) so the launched app uses that temp dir
instead of the host profile; update the code at the env: process.env site to use
the cloned-and-overridden env object and ensure the temp dir is created and
cleaned up by the fixture.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: a6fe9023-c9c3-489d-b4c0-9cbdb141ed26

📥 Commits

Reviewing files that changed from the base of the PR and between 92bbce4 and 57394e6.

📒 Files selected for processing (9)
  • .github/workflows/windows-arm64-e2e.yml
  • docs/features/windows-arm64-support/plan.md
  • docs/features/windows-arm64-support/spec.md
  • docs/features/windows-arm64-support/tasks.md
  • package.json
  • test/e2e/README.md
  • test/e2e/fixtures/electronApp.ts
  • test/e2e/helpers/mockProvider.ts
  • test/e2e/helpers/testData.ts
✅ Files skipped from review due to trivial changes (3)
  • docs/features/windows-arm64-support/tasks.md
  • docs/features/windows-arm64-support/spec.md
  • docs/features/windows-arm64-support/plan.md

args: ['.']
}),
cwd: REPO_ROOT,
env: process.env,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Restore isolated E2E user-data profile for launched app.

Line 160 forwards the host environment unchanged, and this fixture writes onboarding/provider/model config. In packaged smoke runs, that can persist into a real/default DeepChat profile and cause state leakage/flaky reruns.

Suggested fix
+      const launchEnv: NodeJS.ProcessEnv = { ...process.env }
+      if (process.env.CI === 'true' || shouldUseMockProvider()) {
+        launchEnv.DEEPCHAT_E2E = '1'
+        launchEnv.DEEPCHAT_E2E_USER_DATA_DIR =
+          launchEnv.DEEPCHAT_E2E_USER_DATA_DIR ??
+          resolve(testInfo.outputDir, `deepchat-e2e-profile-${currentLaunch}`)
+      }
+
       const electronApp = await electron.launch({
         ...(packaged
           ? {
               executablePath: resolvePackagedExecutable(),
               args: []
             }
           : {
               args: ['.']
             }),
         cwd: REPO_ROOT,
-        env: process.env,
+        env: launchEnv,
         timeout: 120_000
       })
🤖 Prompt for 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.

In `@test/e2e/fixtures/electronApp.ts` at line 160, The fixture currently forwards
the whole host environment via the env: process.env line which allows the app to
write into the developer's real profile; change the electronApp fixture to
create a temporary isolated user-data directory and set env to a shallow clone
of process.env with profile-related variables overridden (e.g., HOME and/or
USERPROFILE and XDG_CONFIG_HOME or the Electron-specific user-data-dir env/flag)
so the launched app uses that temp dir instead of the host profile; update the
code at the env: process.env site to use the cloned-and-overridden env object
and ensure the temp dir is created and cleaned up by the fixture.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@docs/features/windows-arm64-support/spec.md`:
- Line 11: Update the acceptance criterion that currently references the
runner’s default profile to instead require the isolated "CI smoke" profile so
the spec matches the PR intent; locate the acceptance criterion wording that
mentions "runner’s default profile" and replace it with language specifying the
isolated "CI smoke" profile (or equivalent phrase used elsewhere in the doc) and
ensure the acceptance criteria explicitly state that CI smoke runs use an
isolated profile to avoid coupling CI results to runner state.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9055f7fc-f34e-4e74-9e63-74f79e801fe9

📥 Commits

Reviewing files that changed from the base of the PR and between 57394e6 and 08b2a99.

📒 Files selected for processing (8)
  • docs/features/windows-arm64-support/plan.md
  • docs/features/windows-arm64-support/spec.md
  • docs/features/windows-arm64-support/tasks.md
  • package.json
  • test/e2e/README.md
  • test/e2e/fixtures/electronApp.ts
  • test/e2e/helpers/testData.ts
  • test/e2e/playwright.ci.config.ts
✅ Files skipped from review due to trivial changes (2)
  • docs/features/windows-arm64-support/tasks.md
  • test/e2e/README.md

Comment thread docs/features/windows-arm64-support/spec.md
@zerob13 zerob13 merged commit e7085fb into dev May 21, 2026
3 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request May 21, 2026
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