Update to git commands chaining in sandbox#322249
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @anthonykim1Matched files:
|
There was a problem hiding this comment.
Pull request overview
This PR adjusts how the terminal sandbox derives per-command runtime configuration so that Git’s GnuPG-related allowances (notably allowAllUnixSockets and ~/.gnupg access) can be applied when the parsed command line contains a chain of “compatible” commands, addressing rebase failures in sandboxed execution (fixes #316973).
Changes:
- Allow the GnuPG runtime configuration to apply to chained commands when all parsed commands are in an allow-listed keyword set.
- Add a unit test covering chained-command application of the GnuPG runtime configuration.
Show a summary per file
| File | Description |
|---|---|
| src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.ts | Expands GnuPG runtime-config eligibility from single-command invocations to compatible chained invocations via a keyword allow-list. |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/terminalSandboxService.test.ts | Adds coverage ensuring GnuPG runtime values apply for chains composed only of allow-listed commands. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 2
| }, | ||
| ]; | ||
|
|
||
| const terminalSandboxGnuPGCompatibleCommandKeywords = new Set(['git', 'gh', 'gpg', 'gpg2']); |
| const config = getTerminalSandboxRuntimeConfigurationForCommands(OperatingSystem.Linux, [ | ||
| { keyword: 'git', args: ['rebase', 'main'] }, | ||
| { keyword: 'gh', args: ['pr', 'list'] }, | ||
| { keyword: 'gpg', args: ['--list-keys'] }, | ||
| { keyword: 'gpg2', args: ['--list-keys'] }, | ||
| ]); |
|
PR Quality Score: B (76%) I ran this PR through the PR Quality Analyzer — a free tool that checks description quality, labels, size, and title. Small tip that could bump this to A: adding a bit more context in the description about why the git commands chaining needs updating and what testing was done. Helpful for reviewers who may not be familiar with the sandbox internals. |
fixes #316973