Skip to content

build(orcad): a test-only switch-on server template that packaging refuses - #31097

Merged
Jinwoo-H merged 2 commits into
mainfrom
fd/h1-orcad-dark-template
Oct 20, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
fd/h1-orcad-dark-template

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​36
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​48 $\color{#cf222e}{\Huge{\mathbf{−}}}$​12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​36

ELI5

Some of our tests need an Orca server built with an experimental setting turned on. Until now, the step that packages the server refused that setting completely. So in the test run with the setting on, the app had it on but the server it talked to had it off. This PR adds an explicit opt-in that lets test builds turn the setting on for the server too. It also marks those builds so they can never ship in a release.

What Changed

  • build-orcad-template.mjs --dark-test-template
    • With this flag, a server template can be built with ORCA_LAYOUT_OWNER=main.
    • Without the flag, the template refuses that setting exactly as before.
  • Markers. A server built with the setting on leaves the same ORCA_LAYOUT_OWNER_MAIN marker file that the app build leaves:
    • in out/orcad, from build-orcad.mjs;
    • in the template root, from build-orcad-template.mjs.
    • Both files sit outside the artifact lists, so the server's version hash and what gets deployed to a host don't change.
  • Packaging. beforePack now also refuses a marked out/orcad-template, next to out/main and the phone page bundle. This mirrors the planned flip-time refusal of an off build.
  • CI (e2e.yml). When the workflow runs with layout_owner: main, two jobs build their template with the opt-in and check its marker:
    • the orca serve mode-switch / headless oracle job, which also checks the out/orcad marker;
    • the Docker managed-SSH job.
    • The manual switch-on workflow therefore deploys a switch-on server. Its triggers and spec list are unchanged; the next headless-leg PR adds specs.

There is no user-visible change. Release builds and switch-off builds are byte-identical.

Why

  • Why an explicit flag: the release template refusal stays exactly as it is, and turning the setting on for a server is a deliberate act.
  • Why a marker file: the app already uses this pattern, so the existing packaging guard covers the template with a one-line change. That also catches a test template that someone copies into place by hand.
  • Alternative considered: letting the template inherit the variable silently. That would let a stray environment variable produce a release server with the setting on.

Linked Issue

Terminal-layout final design, track H (H1). No issue.

Visual Proof

N/A. Build scripts and CI only.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • New unit tests fail on base and pass on head:

    • build-orcad-template.test.mjs (three cases):
      • refuses the setting without the flag;
      • allows it with the flag;
      • allows a plain build either way.
    • electron-builder-config.test.mjs: refuses to package a marked template.
  • Local builds on macOS of a linux-arm64-glibc template:

    • Plain: builds, with no marker.
    • Setting on, no flag: refused with ORCA_LAYOUT_OWNER=main is for dark test builds.
    • Setting on, with flag: builds and passes the template verifier. It has the marker, a different orcad.js, and a different server version (+6b15effbdce6 vs +a48cfb7c0e22).
  • Switch-off inertness: I built a plain template with the base scripts and with the head scripts, and diff -r shows them identical.

  • pnpm tc, check:code-quality:changed, and the template, packaging, dark-switch, CI-selection and route-contract suites pass.

  • The manual switch-on workflow was not dispatched; that is left to the lead.

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

  • Not covered: the Windows orca serve job still ignores layout_owner and builds a plain template. It has no layout_owner input wiring today, and the switch-on leg doesn't select it.
  • Security: a marked template can't be packaged.
  • SSH: only test templates change.
  • Compatibility: none affected.

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)

…s it

build-orcad-template.mjs takes --dark-test-template to let ORCA_LAYOUT_OWNER=main
through for test servers; the template and out/orcad carry the switch marker, and
packaging refuses a marked template. The e2e template steps build a switch-on server
when the workflow runs with layout_owner=main.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c742686-d0bb-4f94-b50f-0b186e35494c
📥 Commits

Reviewing files that changed from the base of the PR and between 50d6706 and eefee5b.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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: 7959e52a-2b94-4cd0-b4de-485292c1fdca
📥 Commits

Reviewing files that changed from the base of the PR and between 63246eb and 50d6706.

📒 Files selected for processing: 7
  • .github/workflows/e2e.yml
  • config/dark-build-switches.cjs
  • config/electron-builder.config.cjs
  • config/scripts/build-orcad-template.mjs
  • config/scripts/build-orcad-template.test.mjs
  • config/scripts/build-orcad.mjs
  • config/scripts/electron-builder-config.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.

📝 Walkthrough

The Orcad build scripts now write dark-build markers to their output directories. Template builds accept --dark-test-template when a layout owner is set. The packaging hook checks the Orcad template for dark-build markers. The Linux Orcad serve and managed SSH Docker workflows build and verify layout-owner outputs.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 50d67

The changed build and CI paths are consistent with the test-only template safeguard. No actionable merge-blocking risk remains 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 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 6 files. (1 skipped: 1… 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 a test-only switch-on server template that packaging rejects.
Description check Passed The description is detailed and covers the change, rationale, testing, compatibility, security, and checklist. The Linked Issue section states "No issue" instead of providing an issue reference, and t…
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 is detailed and covers the change, rationale, testing, compatibility, security, and checklist. The Linked Issue section states "No issue" instead of providing an issue reference, and the full required command set is not explicitly reported as passing, but the description is otherwise substantially complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 6 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • 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.

@Jinwoo-H
Jinwoo-H merged commit 4440641 into main Oct 20, 2026
64 checks passed
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