Repository navigation
refactor(ssh): one pinned-runtime host target - #27709
Conversation
|
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 5 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The runtime restructuring appears mergeable after normal checks. No current user-facing failure was established. Pre-merge checks |
|
The relay runtime ladder (rungs A/B/C/legacy/D, its self-test, refusal cache, per-host decision store and its telemetry) lost its only caller when the relay was deleted. Two pieces were still live: picking the Node runtime a host can run by glibc (managed orcad deploy, WSL guest runtime) and the runtime-store pins orcad version GC keeps. Those move to pinned-runtime-host-target.ts; pick/durationBucket move into ssh-host-server-telemetry.ts, their only remaining user.
9fd181a to
7d65b36
Compare
ELI5
When Orca still had its old SSH "relay", it tried several ways to run its own copy of Node.js on a remote host and fell back step by step (a "ladder"). The relay is gone, but the ladder code stayed behind. Nothing calls it any more. This PR deletes it and keeps the two small pieces that are still used.
What Changed
Nothing changes for users. This removes code nothing runs.
ssh-relay-runtime-resolution.ts,ssh-relay-runtime-ladder.ts,ssh-relay-runtime-self-test.ts,ssh-relay-pinned-node.ts,ssh-relay-pinned-refusal-cache.ts,ssh-remote-runtime-telemetry.ts,shared/relay-runtime-self-test-report.ts, plus their tests (ladder, never-worse, resolution, self-test, pinned-node and its integration test, telemetry).src/main/ssh/pinned-runtime-host-target.ts(about 70 lines):pinnedRuntimeTargetForHost. Managed orcad deploy uses it to pick the host's own Node runtime, or the glibc 2.17 build on older glibc.nodeRuntimeStorePins, renamed fromrelayRuntimeStorePins. Orcad version cleanup uses it so it never deletes a runtime another copy still runs.isGlibcBelowandPINNED_NODE_GLIBC_FLOOR, which the WSL guest runtime also uses.pickanddurationBucketnow live insidessh-host-server-telemetry.ts, which is their only remaining user.ssh-relay-answered-failure-producers.test.tsno longer asserts the relay's refusal classifier. It asserts the exit status instead.Kept on purpose, per the design: the persisted
SshTarget.remoteRuntime/remoteRuntimeResolutionfields and their types still load and save unchanged, so older profiles and downgrades still work. Thessh_remote_runtime_resolvedtelemetry schema stays registered but nothing sends it any more. Thessh-typesconstants are pruned in the next PR (2.2).Net lines: production −1,213 (+90/−1,303), tests −1,476 (+54/−1,530).
Why
New SSH work no longer has to step around about 2,700 lines of unreachable ladder, self-test and refusal-cache code. Folding the live pieces into one small module with a plain name stops later cleanups from deleting them by mistake. The alternative was to leave the files in place and delete only the dead functions. That would keep the misleading
relaynames on code that is still live.Linked Issue
Phase 3.99 cleanup (maintainer PR, no issue).
Visual Proof
N/A: no UI or behaviour change.
Testing
Characterization first: the new
pinned-runtime-host-target.test.tsassertions were run against the oldssh-relay-runtime-ladder.ts/ssh-relay-pinned-node.tsbefore the move (3/3 passed), then against the new module.Dead-code proof: searched every deleted module path and exported symbol across
src,config,testsandmobile, including the@ts-nocheckfiles andvi.mockstrings. No users remain outside the deleted files. The only hits left are two path-classification fixture tests (test-only-source-path,check-runtime-electron-ratchet) that build their own temporary files, plus staleci-shard-timings.jsonentries.pnpm tc,build:electron-vite,build:orcadandbuild:clipass.pnpm lintpasses, so ratchets are at or below baseline.check:code-quality:changedreports 0 findings.Focused tests pass:
pinned-runtime-host-target,orcad-runtime-target,orcad-managed-version-gc,wsl-pinned-runtime,ssh-host-server-telemetry,ssh-host-server-on-connect-telemetry,ssh-relay-answered-failure-producersandpackaged-orcad-template(8 files, 50 tests).I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
P0/P1 review: a self review plus an independent codex reviewer (read-only). Neither found anything.
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)