Repository navigation
feat(plugins): download sources without checkout and pin catalog releases in a v2 manifest/catalog - #30636
Conversation
6dfe075 to
30ae2ee
Compare
27af974 to
226c0a1
Compare
226c0a1 to
8f9a8a3
Compare
880ad10 to
54639b8
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
54639b8 to
dfff513
Compare
dfff513 to
b324ef1
Compare
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2f5f4db2-8998-4eda-a965-4284ad778f7d
Files selected for processing: 2-
src/shared/git-binary-compatibility.test.tssrc/shared/plugin-git-download-binary-compatibility.test-cases.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
a22710d to
96880d1
Compare
|
|
||
| function nodeCommand(code: string): string { | ||
| const encoded = Buffer.from(code).toString('base64') | ||
| return `"${process.execPath.replaceAll('\\', '/')}" -e "eval(Buffer.from('${encoded}','base64').toString())"` |
There was a problem hiding this comment.
Not an issue: this is a test-only fixture; the evaluated code is a constant string from the test itself, base64-encoded only to survive shell quoting.
96880d1 to
df3870b
Compare
…owlist and size cap Plugin and marketplace sources were a real clone/checkout, so user hooks, smudge filters and core.hooksPath ran, insteadOf rules could reach any transport, and nothing bounded the download. Now a --no-checkout depth-1 clone (or exact-commit fetch) runs with an empty hooks path, only the https and ssh transports, and Orca writes the commit's exact blobs from ls-tree + cat-file --batch. Symlinks, submodules, .git aliases, colliding portable paths and SHA-256 repositories are refused. A size watcher stops the whole Git process tree once the pack outgrows an approximate cap. The exact argv lives in shared code and joins the real-Git compatibility matrix, so the Git 2.25 lane runs it. Tests reach fixtures over an SSH shim, since file transports are now refused.
data < instructional < sandboxed-ui < trusted-worker. A v2 manifest is strict and fails when it carries contributions beyond its profile; v1 manifests keep loading with the least profile inferred from what they declare.
A v2 catalog entry carries the release it vouches for: commit, content hash, version, profile, minimum Orca and contribution types. Preview and install fetch that commit directly and refuse bytes that differ. The v1 file stays strict and frozen for shipped clients; v2 entries strip unknown keys, and entries this client cannot install are dropped at parse time. Catalog fetches read only the index blobs under their own download cap, so a catalog repository is not held to one plugin's limits. Release-bearing snapshots are cached under a new key, so an older build never reads them and simply refetches. readMarketplaceJson and parseMarketplaceFile from #30612 are replaced by parsePluginMarketplaceIndex: catalogs are now read as Git blobs, so the on-disk JSON read has no caller left.
Plugin downloads now refuse the file transport, even through an insteadOf rewrite, so the fresh-profile marketplace journey reaches its fixture repositories through the GIT_SSH_COMMAND shim the unit tests use.
…index on every platform
df3870b to
2c1552c
Compare
[High impact] The PR changes how plugins are fetched, described, and accepted across marketplace workflows. The custom-transport bypass should be fixed before merging. FindingsSummaryDownloads now read Git blobs without checkout. Manifest v2 adds execution profiles, and catalog v2 pins exact plugin releases.
|
| 'protocol.allow=never', | ||
| 'protocol.https.allow=always', | ||
| 'protocol.ssh.allow=always', | ||
| ...['file', 'ext', 'git', 'http', 'ftp', 'ftps'].map((name) => `protocol.${name}.allow=never`), |
There was a problem hiding this comment.
If a user has protocol.acme.allow=always and an insteadOf rule rewriting a plugin's HTTPS URL to acme::..., these settings still let Git run git-remote-acme. Git checks protocol.acme.allow before protocol.allow, and acme is outside the explicit deny list. The promised HTTPS/SSH-only restriction is therefore incomplete.
Set GIT_ALLOW_PROTOCOL=https:ssh in the download's child environment, overriding any inherited value, and test a custom-helper rewrite.
How this was verified: Plugin downloads retain user Git configuration, while the new restrictions override only six named denied transports and leave custom per-transport allows intact.
There was a problem hiding this comment.
Fixed in #30637: plugin Git now runs with GIT_ALLOW_PROTOCOL=https:ssh, which overrides any user protocol.<helper>.allow; added an acme:: insteadOf-rewrite test.
| const commit = await f.git(['rev-parse', 'HEAD']) | ||
| expect(await f.checkout(mode === 'tag' ? 'v1' : commit)).toBe(commit) | ||
| expect(await readFile(join(f.destination, 'data.bin'))).toEqual(f.bytes) | ||
| await expect(access(f.filtered)).rejects.toThrow() |
There was a problem hiding this comment.
The fixture never configures filter.plugin-test.smudge. The .gitattributes entry names an undefined filter, so even a normal checkout leaves filter-executed absent. A change that brings checkout filters back could still pass this test.
Configure a smudge command that writes this marker after creating the fixture commit. Then both the tag and exact-commit cases will actually test that downloads skip filters.
There was a problem hiding this comment.
Fixed in #30637: the fixture now configures a real filter.plugin-test.smudge that writes the marker, so both download cases prove filters are skipped.
ELI5
When Orca downloads a plugin or a plugin catalog with Git, it now only copies the files. Nothing on the user's machine runs during the download: no Git hooks, no file filters, and no unusual transports. The download also has a size limit.
Plugins can now say how much power they need, in a new manifest version. Catalogs can vouch for one exact release of a plugin, and Orca refuses anything that doesn't match it byte for byte.
What Changed
1. Downloading without a checkout (
plugin-git-repository.ts,plugin-git-tree.ts,shared/plugins/plugin-git-arguments.ts)core.hooksPath) and checkout filters could run during an install;url.*.insteadOfrules could send the download throughfile://or another transport;--no-checkout --depth 1(or fetches an exact commit) into a temporary repository:httpsandsshtransports are allowed;ls-treeand writes each file's exact bytes fromcat-file --batch, so no checkout runs;.gitand its Windows short-name alias (GIT~1), paths that collide on case-insensitive disks, and SHA-256 repositories;2. Manifest v2 execution profile (
plugin-execution-profile.ts)data,instructional,sandboxed-ui,trusted-worker.3. Pinned catalog releases (
plugin-catalog-release.ts,orca-marketplace.v2.json)orca-marketplace.v2.jsonfile names the exact release it vouches for:Why
-coptions on each command. Git's per-protocol settings outrank the general one. Explicitneverentries also beat a user's ownprotocol.file.allow=always. Git applies the same allowlist to redirects.--filter=blob:none) would make each file read trigger its own network fetch. A depth-1 clone already downloads only the one commit, so the filter, and the version check it needs on older Git, aren't worth it.Linked Issue
None — this is part of the plugin platform rework (maintainer change).
Visual Proof
N/A — no UI change. Install and preview behave the same for valid plugins. Invalid ones fail with a clear error.
Testing
Real Git, over an SSH test shim:
core.hooksPath, by tag and by exact commit.insteadOfrewrites tofile://and tohttp://are refused.Parsing: the tree-format checks reject
.git(including zero-width variants andGIT~1), colliding paths, missing parent folders, and mismatched or truncatedcat-fileoutput.Profiles and releases: the profile matrix, release-versus-manifest mismatches, and tampered bytes at the pinned commit.
Catalog compatibility: the v1/v2 catalog rules, and separate cache files that a v1 build reads unchanged.
Git 2.25: the exact arguments run in
git-binary-compatibility.test.ts, which CI's Git 2.25.5 lane covers. Run locally only with the system Git (2.55).Platforms: macOS locally. The hook fixtures are POSIX shell, so they're skipped on Windows; CI covers Linux and Windows for the rest.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
GIT~1, and paths that collide on case-insensitive disks. Abort kills the whole Git process tree through process-host.gitExecFileAsyncBuffernow passes input through to Git).Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — plugin tests,check:code-quality:changedandpnpm tc:nodepass locally; CI covers the rest