Skip to content

ci: run the layout-owner switch-on specs as an advisory PR check (dark, layout-owner build only) - #30582

Merged
Jinwoo-H merged 7 commits into
mainfrom
ci/layout-owner-switch-on-e2e
Oct 19, 2026
Merged

Jinwoo-H merged 7 commits into
mainfrom
ci/layout-owner-switch-on-e2e

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​192 $\color{#cf222e}{\Huge{\mathbf{−}}}$​46 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​146
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​344 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​340

ELI5

Orca has a hidden build setting that moves ownership of the tab and pane layout from the window to the background process. It is off in every build users get. Until now, the only way to test it on is to build it on a laptop and run the tests there by hand. This PR adds a CI job that does exactly that on every pull request that touches the layout code, and posts a report. It does not block merging.

What Changed

Before: no CI job builds the app with the layout-owner setting on, so a change that breaks it is found only when someone runs the tests by hand.

After: a new check, layout owner (switch on), runs on pull requests that change layout code. It:

  1. Builds the test app with ORCA_LAYOUT_OWNER=main. It reuses the existing test workflow (e2e.yml) through a new layout_owner input, the same way the layout oracle check reuses it. The setting is applied only to the commands that build the app and the headless server, never to the whole job, because the server template build refuses it. The build step then checks that the build left its marker file (out/main/ORCA_LAYOUT_OWNER_MAIN); the marker travels in the build artifact, and the switch-on specs skip without it.
  2. Runs the specs below with the save-divergence log on (ORCA_LAYOUT_SAVE_DIVERGENCE_LOG). That log records each window save whose layout differs from what the background process holds.
  3. Writes a summary of the log, counted by kind and by the spec that was running, to the job summary, and uploads it as an artifact (layout-divergence-changed-layout-owner-switch-on-*, layout-divergence-headless-layout-owner-switch-on-*). Nothing in the repo counted these reports yet, so config/scripts/layout-save-divergence-summary.mjs is new. It matches each report to a test using the Playwright JSON report.

Specs (the list lives in config/scripts/pr-layout-owner-switch-on-route.mjs):

  • Layout oracle: tests/e2e/workspace-layout-oracle.spec.ts, tests/e2e/workspace-layout-oracle-headless.spec.ts (the headless one runs on both server hosts, in the existing server job)
  • Positive control: tests/e2e/cli-file-open-position.spec.ts (its only test is at line 8; it writes the store directly, so it must leave at least one report)
  • relaunch-*: tests/e2e/relaunch-first-terminal.spec.ts, tests/e2e/relaunch-sleeping-agents-resume-on-view.spec.ts
  • cold-activation-deferral: tests/e2e/terminal-cold-activation-deferral.spec.ts
  • tests/e2e/cli-first-worktree-single-terminal.spec.ts
  • tests/e2e/unopened-workspace-agent-single-resume.spec.ts
  • pane-close: tests/e2e/terminal-pane-close-layout-consistency.spec.ts
  • Tab-bar entry specs (saves that drop a terminal's tab-bar entry): tests/e2e/diff-word-wrap.spec.ts, tests/e2e/golden-file-open-edit-save.spec.ts, tests/e2e/golden-source-control-open-diff.spec.ts, tests/e2e/paired-cli-terminal-graph-sync-tab-retention.spec.ts
  • Tab order specs (the earlier switch-on sweeps' tab-order reports): tests/e2e/floating-workspace-pane-height.spec.ts, tests/e2e/editor-model-host-isolation.spec.ts, tests/e2e/editor-tab-selection-restore.spec.ts, tests/e2e/finished-agent-ghost-resume.spec.ts, tests/e2e/live-background-terminal-mount-authority.spec.ts, tests/e2e/workspace-back-forward-navigation.spec.ts, tests/e2e/worktree-lineage-toggle-shortcut.spec.ts (plus cold-activation, diff-word-wrap, the two golden specs and relaunch-sleeping above)
  • tests/e2e/local-cli-terminal-retention.spec.ts
  • tests/e2e/default-tabs-mark-crash-relaunch.spec.ts
  • tests/e2e/terminal-cli-split-closed-before-mount.spec.ts

When it runs: the existing changed-path step in pr.yml now also prints layout_owner_switch_on. It is true when a PR changes src/shared/workspace-layout*, src/shared/layout-owner-switch.ts, src/main/persistence/**, src/main/runtime/**, src/renderer/src/store/**, tests/e2e/**, pr.yml, e2e.yml, or the job's two scripts. This PR changes pr.yml and e2e.yml, so it runs the job itself.

Not required: the job is not in the PR checks passed job's needs, and that job, its needs and its failure handling are unchanged. All existing callers of e2e.yml leave layout_owner empty, which changes nothing in their steps.

Why

The layout-owner work is being checked by hand on one machine. A CI job catches regressions in pull requests that never ran it, and keeps a report history. It is advisory because some of these specs fail with the setting on until that work lands.

Alternatives considered: a separate workflow file would copy the build, artifact and server steps that e2e.yml already has, and drift from them. Setting the variable job-wide would make the server template build refuse to run. Adding the job to the required list would block unrelated pull requests on known switch-on failures.

Linked Issue

N/A (internal CI change).

Visual Proof

N/A: CI only, no app change.

Testing

  • Automated tests added: config/scripts/pr-layout-owner-switch-on-route.test.mjs (the job's wiring: merge commit, setting only on builds, not required, unique artifact suffix, every listed spec exists; the path filter; the summary counts).
  • Existing workflow contract tests pass: pr-e2e-route-contracts, pr-ready-check-reuse, pr-code-change-scope, pr-e2e-gate-contract, required-pr-check-name, pr-workflow-parallelism, ci-e2e-job-selection, pr-auxiliary-preflight-admission (this one copies the routing scripts into a scratch repo, so the new script is added to its list).
  • actionlint shows no new findings against main; check:code-quality:changed and the naming audit pass.
  • The new job runs on this PR (see its checks). The e2e specs were not run locally: they run on CI.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No app code changes, so no effect on any platform, remote host or phone. Linux CI runner only.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Build the e2e app with ORCA_LAYOUT_OWNER=main through the existing e2e.yml
(new layout_owner input, read only by the app and orcad builds), run the
layout oracle, its positive control and the layout-owner acceptance specs
with the save-divergence log on, and upload a summary by kind and spec.
Not in the PR aggregate's needs.
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ad898448-fba3-4ca7-bc95-efe76cb7250d
📥 Commits

Reviewing files that changed from the base of the PR and between 8cc6053 and 13d3ee7.

📒 Files selected for processing: 2
  • config/scripts/layout-save-divergence-summary.mjs
  • tests/e2e/editor-model-host-isolation.spec.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • config/scripts/layout-save-divergence-summary.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

📝 Walkthrough

The reusable E2E workflow accepts an optional layout owner and configures owner-aware builds and divergence reporting in the changed-spec, headless, and managed-SSH lanes. The PR workflow routes selected changes to an advisory E2E job that runs specified tests with the main layout owner. A new script summarizes divergence logs, attributes reports to Playwright test attempts, and writes JSON and Markdown output. The model host-isolation test now opens local and SSH-provenance models through the store’s normal file-opening path.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 13d3e

The model-isolation test checks the expected owned ID, and no remaining issue prevents merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: adding an advisory PR check for the layout-owner switch-on E2E specs. It is specific and related to the changeset.
Description check Passed The description follows the required template and explains the purpose, implementation, scope, testing, non-blocking behavior, and compatibility considerations. The linked issue is marked N/A because …
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.
Full details: Description check

Explanation

The description follows the required template and explains the purpose, implementation, scope, testing, non-blocking behavior, and compatibility considerations. The linked issue is marked N/A because this is an internal CI change, and the remaining required sections are sufficiently complete.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 598635af-01c8-4dc0-916e-b12e5b2a74d2
📥 Commits

Reviewing files that changed from the base of the PR and between e8d7da0 and 6669a5c.

📒 Files selected for processing: 6
  • .github/workflows/e2e.yml
  • .github/workflows/pr.yml
  • config/scripts/layout-save-divergence-summary.mjs
  • config/scripts/pr-auxiliary-preflight-admission.test.mjs
  • config/scripts/pr-layout-owner-switch-on-route.mjs
  • config/scripts/pr-layout-owner-switch-on-route.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Comment thread .github/workflows/e2e.yml Resolved

@coderabbitai coderabbitai Bot left a comment

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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Admit the layout-owner E2E job when required checks are reused. · pr.yml:1542-1560

.github/workflows/pr.yml:1542-1560
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Admit the layout-owner E2E job when required checks are reused.

On ready_for_review, an identical successful PR check run can set reused=true. A layout-related change still sets layout_owner_switch_on=true, but both preflight selectors become false, so preflight is skipped. This job then skips because it requires preflight success. The regular advisory E2E job already admits this reuse case.

Suggested fix
-      needs.preflight.result == 'success'
+      (
+        needs.preflight.result == 'success' ||
+        (
+          needs.preflight.result == 'skipped' &&
+          needs.code_paths.outputs.static_analysis == 'false' &&
+          needs.code_paths.outputs.typecheck == 'false'
+        )
+      )

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 870bf580-c5f3-4aac-b490-6c5fc17dfd23
📥 Commits

Reviewing files that changed from the base of the PR and between 6669a5c and 7bc8096.

📒 Files selected for processing: 3
  • .github/workflows/e2e.yml
  • config/scripts/layout-save-divergence-summary.mjs
  • config/scripts/pr-layout-owner-switch-on-route.test.mjs
🚧 Files skipped from review as they are similar to previous changes: 2
  • config/scripts/pr-layout-owner-switch-on-route.test.mjs
  • config/scripts/layout-save-divergence-summary.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

…r lane, drops diff-word-wrap (fails switch off), and names each looped test in the summary

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 67f14128-15b0-4741-a161-898a4e3e207f
📥 Commits

Reviewing files that changed from the base of the PR and between 7bc8096 and 8cc6053.

📒 Files selected for processing: 5
  • .github/workflows/e2e.yml
  • .github/workflows/pr.yml
  • config/scripts/layout-save-divergence-summary.mjs
  • config/scripts/pr-layout-owner-switch-on-route.mjs
  • config/scripts/pr-layout-owner-switch-on-route.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

…tore's open action, so a layout-owner build's main holds the tabs
@Jinwoo-H
Jinwoo-H merged commit 9def13d into main Oct 19, 2026
53 checks passed
Jinwoo-H pushed a commit that referenced this pull request Oct 20, 2026
… each naming its test

Tests whose only gap was setup now run switch-on; files that show a real
switch-on difference lose their mock and stay red until their fixes land.
The rollback leg's trigger is back to #30582's list.
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