-
Notifications
You must be signed in to change notification settings - Fork 113
Create LinuxApplicationLayerDetector #1551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create LinuxApplicationLayerDetector #1551
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1551 +/- ##
======================================
Coverage 90.2% 90.2%
======================================
Files 423 426 +3
Lines 35476 35965 +489
Branches 2209 2216 +7
======================================
+ Hits 32020 32464 +444
- Misses 3001 3045 +44
- Partials 455 456 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR creates a new LinuxApplicationLayerDetector as an experimental variant of LinuxContainerDetector to test detecting application-level packages (npm, pip) in addition to system packages. The approach involves inheritance rather than actual behavioral changes, with the new detector subclassing the existing one and primarily differing in metadata.
Key Changes:
- Removes Npm and Pip from
LinuxContainerDetector's declaredCategoriesandSupportedComponentTypes - Creates
LinuxApplicationLayerDetectorextendingLinuxContainerDetectorwith Npm/Pip support in metadata - Adds
LinuxApplicationLayerExperimentto compare the two detectors - Reformats
LinuxContainerDetectorand disables StyleCop rules SA1009/SA1111 globally
Critical Issue: Both detectors will actually detect npm and pip components regardless of declared types, because they share the same LinuxScanner instance which uses all registered IArtifactComponentFactory implementations (including npm and pip factories). The metadata changes only affect how detectors identify themselves, not what they detect.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
LinuxContainerDetector.cs |
Removed Npm/Pip from Categories and SupportedComponentTypes; extensive formatting changes with multi-line method signatures |
LinuxApplicationLayerDetector.cs |
New experimental detector inheriting from LinuxContainerDetector, adds back Npm/Pip to metadata using new keyword to shadow base properties |
LinuxApplicationLayerExperiment.cs |
New experiment configuration to compare LinuxContainerDetector vs LinuxApplicationLayerDetector using type pattern matching |
ServiceCollectionExtensions.cs |
Registered new detector and experiment configuration in DI container |
.editorconfig |
Globally disabled SA1009 and SA1111 StyleCop rules to accommodate new formatting style |
src/Microsoft.ComponentDetection.Detectors/linux/LinuxApplicationLayerDetector.cs
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Detectors/linux/LinuxContainerDetector.cs
Outdated
Show resolved
Hide resolved
...osoft.ComponentDetection.Orchestrator/Experiments/Configs/LinuxApplicationLayerExperiment.cs
Outdated
Show resolved
Hide resolved
|
👋 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
|
Snapshot test differences are expected as we're effectively removing npm and pip components from the Linux detector. |
This change:
pipandnpmcomponent detection capabilities fromLinuxContainerDetectorLinuxApplicationLayerDetectorwhich subclassesLinuxContainerDetectorand adds support back forpipandnpmcomponent detectionLinuxApplicationLayerExperimentto compareLinuxContainerDetectorandLinuxApplicationLayerDetectorPlease note that I also reformatted
LinuxContainerDetector, so you may want to review with whitespace changes disabled.