Skip to content

Remove OnPrepareDetectionAsync method from the DockerfileComponentDetector - #1884

Closed
Julian (jpinz) wants to merge 2 commits into
mainfrom
jupinzer/remove_dockerfile_OnPrepareDetectionAsync
Closed

Julian (jpinz) wants to merge 2 commits into
mainfrom
jupinzer/remove_dockerfile_OnPrepareDetectionAsync

Conversation

@jpinz

Copy link
Copy Markdown
Member

This pull request simplifies the DockerfileComponentDetector by 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:

  • Removed the OnPrepareDetectionAsync override and the associated logic that filtered out files in skipped folders, along with the private IsInSkippedFolder helper method. (src/Microsoft.ComponentDetection.Detectors/dockerfile/DockerfileComponentDetector.cs) [1] [2]
  • Removed unused System.Linq and System.Reactive.Linq imports. (src/Microsoft.ComponentDetection.Detectors/dockerfile/DockerfileComponentDetector.cs)

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.

Copilot review overview

🟡 Changes recommended

Removing the filter regresses skipped-folder behavior and breaks an existing detector test.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Simplifies Dockerfile detection by removing detector-local skipped-folder filtering.

Changes:

  • Removes OnPrepareDetectionAsync and 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.

Copilot AI balanced review requested due to automatic review settings September 30, 2026 22:10
@github-actions

Copy link
Copy Markdown

👋 Hi! It looks like you modified some files in the Detectors folder.
You may need to bump the detector versions if any of the following scenarios apply:

  • The detector detects more or fewer components than before
  • The detector generates different parent/child graph relationships than before
  • The detector generates different devDependencies values than before

If none of the above scenarios apply, feel free to ignore this comment 🙂

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.

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 High severity · 1 Medium severity

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));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants