Skip symlinks by default during source enumeration#647
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR changes source enumeration defaults to skip symbolic links unless explicitly enabled, and threads that new behavior through both the library surface area and the CLI (including tag-diff).
Changes:
- Added
AnalyzeOptions.FollowSymlinksand propagated it throughTagDiffCommandand the CLI options. - Updated source enumeration in
AnalyzeCommandto skip reparse points by default (and follow them when opted-in). - Added tests covering symlinked files/directories and dangling symlinks.
Show a summary per file
| File | Description |
|---|---|
| AppInspector/Commands/AnalyzeCommand.cs | Adds FollowSymlinks option and updates enumeration behavior to skip/follow symlinks accordingly. |
| AppInspector/Commands/TagDiffCommand.cs | Threads FollowSymlinks through tag-diff scans by passing it into underlying AnalyzeCommand runs. |
| AppInspector.CLI/CLICmdOptions.cs | Adds --follow-symlinks CLI option via shared analysis options. |
| AppInspector.CLI/Program.cs | Maps CLI FollowSymlinks into AnalyzeOptions/TagDiffOptions. |
| AppInspector.Tests/Commands/TestAnalyzeCmd.cs | Adds tests for follow/skip behavior across file, directory, and dangling symlinks. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 3
- Review effort level: Low
| File.CreateSymbolicLink(Path.Combine(sourcePath, "linked-file.js"), Path.GetFullPath(linkedFileTarget)); | ||
| Directory.CreateSymbolicLink(Path.Combine(sourcePath, "linked-directory"), | ||
| Path.GetFullPath(linkedDirectoryTarget)); | ||
| var directLinkedFile = Path.Combine(testRoot, "direct-linked-file.js"); | ||
| var directLinkedDirectory = Path.Combine(testRoot, "direct-linked-directory"); | ||
| File.CreateSymbolicLink(directLinkedFile, Path.GetFullPath(linkedFileTarget)); | ||
| Directory.CreateSymbolicLink(directLinkedDirectory, Path.GetFullPath(linkedDirectoryTarget)); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
@copilot it looks like some tests are failing due to build breaks with the proposed fixes merged. Can you resolve? |
Fixed in the latest commit. The |
Source scans now skip direct, nested, and dangling symbolic links by default. Existing traversal behavior remains available as an explicit opt-in.
Changes
AnalyzeOptions.FollowSymlinksfor library callers.--follow-symlinksto theanalyzeandtagdiffCLI commands.