Repository navigation
test(orcad): orca serve's command line makes orcad serve the web client (#30120 regression) - #30222
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
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. Comment |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
orca servestarts the headless Orca server (orcad) and should print a browser link that opens the web client. In #30120 the link never appeared and every page request hung, because the CLI didn't tell orcad where the web client was. Unit tests now pin each half of that fix, but nothing ran the two halves together. This adds a test that does.What Changed
src/main/orcad/orcad-serve-parity.integration.test.tsgets a new case, run against the built orcad slot:orcadServeArgsandfindBundledWebClientRoot, pointing at a scratch app root that holdsout/web/web-index.html. The bind is switched to loopback so the test never listens on every interface;webClientUrl, thatGET /web-index.htmlreturns 200 with the file, and that an unknown path returns 404.serveOncenow takes the orcad arguments and returns the readiness payload. The D7 restart test reads the daemon pid through a smallserveDaemonPidwrapper. Its behaviour is unchanged.ServeOrcaAppArgs,serveOptionArgsandorcadServeArgsmove unchanged fromsrc/cli/runtime/serve-orcad-launch.tstosrc/shared/orcad-serve-argv.ts. They are the pure CLI→host argv contract, and the main-process tsconfig can't import fromsrc/cli. Their callers import the new path directly, with no re-export left behind. Behaviour is identical.Why
Round 2, C2 / S3.2: #30120 was an option dropped while crossing a process boundary (CLI → orcad argv). That kind of bug passes every unit test on either side. This test runs the real handoff: the CLI's argv builder, orcad's argument parser and orcad's HTTP server, all together. The proposal leaves a
SERVE_OPTION_SPECStable for later, to be added only if another option gets dropped.Proof: with
--web-client-rootremoved fromorcadServeArgs(the #30120 bug), the new case fails withexpected null to deeply equal StringMatching.Linked Issue
Refs round-2 SSH/remote hardening S3 (C2). Regression test for #30120.
Visual Proof
N/A: test only.
Testing
Local macOS, with a freshly built
out/orcad:pnpm exec vitest run src/main/orcad/orcad-serve-parity.integration.test.tspasses all 5 cases. With the fix(serve): orca serve on orcad serves the browser client and answers plain HTTP #30120 bug restored, the new case fails.In CI it runs in Node server tests (
--artifact) on Linux, macOS and Windows.The full static-analysis job, run locally.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Codex review (gpt-6.1-sol, high): no findings.
Agent skill upstream boundary
Notes
Test only; no wire or platform change. On Windows the profile root uses
tmpdir(), as the existing D7 case does.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)