Remove OnPrepareDetectionAsync method from the DockerfileComponentDetector - #1884
Julian (jpinz) wants to merge 2 commits into
Conversation
…c from DockerfileComponentDetector
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Removing the filter regresses skipped-folder behavior and breaks an existing detector test.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Simplifies Dockerfile detection by removing detector-local skipped-folder filtering.
Changes:
- Removes
OnPrepareDetectionAsyncand its helper. - Removes unused reactive/LINQ imports.
| File | Description |
|---|---|
DockerfileComponentDetector.cs |
Removes node_modules request filtering. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Path matching regresses existing behavior, and the broad debug-log assertion will fail because two debug messages are emitted.
Review effort: Balanced
Findings: 1
Open (2)
Resolved since last review (1)
| loggerMock.Verify( | ||
| logger => logger.Log( | ||
| LogLevel.Warning, | ||
| LogLevel.Debug, |
| var singleFileComponentRecorder = processRequest.SingleFileComponentRecorder; | ||
| var file = processRequest.ComponentStream; | ||
| var filePath = file.Location; | ||
| var skippedFolder = this.SkippedFolders.FirstOrDefault(folder => filePath.Contains(folder)); |


This pull request simplifies the
DockerfileComponentDetectorby removing unused code and dependencies related to skipped folder handling. The filtering logic for skipped folders has been removed, likely because it is now handled elsewhere or is no longer needed.Code cleanup and simplification:
OnPrepareDetectionAsyncoverride and the associated logic that filtered out files in skipped folders, along with the privateIsInSkippedFolderhelper method. (src/Microsoft.ComponentDetection.Detectors/dockerfile/DockerfileComponentDetector.cs) [1] [2]System.LinqandSystem.Reactive.Linqimports. (src/Microsoft.ComponentDetection.Detectors/dockerfile/DockerfileComponentDetector.cs)