Repository navigation
build(packaging): fail when orca serve's serve-selection entry or its chunks stay packed (#27404 guard) - #30228
Merged
Merged
Conversation
…hunk it requires is left in app.asar (#27404)
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 6 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 |
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
When you run
orca serve, the CLI first runs a small file from the installed app to decide which server to start. Plain Node runs that file, and plain Node can't read inside the app's packed archive (app.asar). When the file was left packed (#27404), everyorca servequietly fell back. Packaging now fails if that file, or any file it loads, isn't unpacked.What Changed
config/scripts/verify-packaged-web-client.cjsbecomesverify-packaged-serve-payload.cjs. The name now covers what it checks: everythingorca serveopens by path from the unpacked app.assertPackagedServeSelectionEntry(resourcesDir), run inafterPackbeside the web-client check:app.asar.unpacked/out/main/orcad/orcad-local-serve-selection-entry.jsmust exist;require("./…")/require("../…")reachable from the entry. Each one must exist unpacked, so a packed chunk fails at packaging and not on a user'sorca serve.ORCAD_LOCAL_SERVE_SELECTION_ENTRY(the constant the CLI uses).afterPackfixture inelectron-builder-runtime-resources.test.mjsseeds the entry.Why
Round 2, C2 / S3.3, packaged payloads. I audited the five assets the proposal named:
assertPackagedWebClient;ORCAD_ARTIFACTS,verify-packaged-orcad-template.cjs);asarUnpacklist (electron-builder-config.test.mjs). Nothing checked the real packaged output, or the chunks the entry loads.So this adds only the missing check. Walking requires catches a chunk that moves out of the unpacked globs, which a list test can't see.
Linked Issue
Refs round-2 SSH/remote hardening S3 (C2). Guards #27404.
Visual Proof
N/A: packaging guard only.
Testing
pnpm test config/scripts/verify-packaged-serve-payload.test.mjs config/scripts/electron-builder-runtime-resources.test.mjspasses. The new cases fail without the check.The full static-analysis job, run locally.
Ran the guard against a real built
out/mainstaged asapp.asar.unpacked/out: it passes. That run caught and fixed extension-less requires. A full package wasn't built locally because of machine load; packaging CI runsafterPackfor real.Automated tests added/updated, or explained why not below
Review
Codex review (gpt-6.1-sol, high): no findings. It also staged the real main build with the configured unpack rules, and the guard accepted it.
Agent skill upstream boundary
Notes
Build-time only. Paths use
path.join, so it works the same on every platform.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)