Skip to content

C#: Use ProcessStartInfo built-in for correct escaping/quoting in the Dependency manager. - #22377

Draft
michaelnebel wants to merge 1 commit into
github:mainfrom
michaelnebel:csharp/dotnetquoting
Draft

C#: Use ProcessStartInfo built-in for correct escaping/quoting in the Dependency manager.#22377
michaelnebel wants to merge 1 commit into
github:mainfrom
michaelnebel:csharp/dotnetquoting

Conversation

@michaelnebel

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread csharp/extractor/Semmle.Extraction.Tests/DotNet.cs Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates dependency-manager process invocation from manually quoted strings to structured argument lists for reliable escaping.

Changes:

  • Refactors .NET and NuGet invocations to use argument lists.
  • Updates feed-source and restore APIs accordingly.
  • Adapts tests and source-generator execution.
Show a summary per file
File Description
Runtime.cs Updates the IDotNet test stub.
DotNet.cs (tests) Adapts command-construction tests.
DotnetSourceGeneratorWrapper.cs Passes compiler arguments separately.
PackagesConfigRestorer.cs Uses structured NuGet arguments.
NugetPackageRestorer.cs Propagates source argument lists.
IDotNetCliInvoker.cs Changes invoker methods to list arguments.
IDotNet.cs Updates public command and restore contracts.
FeedManager.cs Produces structured source arguments.
DotNetCliInvoker.cs Starts processes with argument lists.
DotNet.cs (dependency fetching) Constructs all CLI commands as argument lists.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 10/10 changed files
  • Comments generated: 2
  • Review effort level: Balanced

args = ["install", "-OutputDirectory", packageDirectory.ToString(), .. sourcesArgument, packagesConfig];
}

var pi = new ProcessStartInfo(exe, args)
}

public string GetLastArgs() => lastArgs;
public string GetLastArgs() => string.Join(" ", lastArgs);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants