Add the HelmComponentDetector and associated tests.#1796
Conversation
|
👋 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.
Pull request overview
Adds a new DefaultOff Helm detector to Component Detection that scans Helm values files for Docker image references, wiring it into the orchestrator and documenting/testing the behavior.
Changes:
- Introduces
HelmComponentDetectorto discover Docker image references in Helm*values*.y{a}mlfiles co-located withChart.yaml/Chart.yml. - Registers the detector in orchestrator DI and adds
DetectorClass.Helm. - Adds unit tests plus verification test resources and documentation for Helm detection.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.ComponentDetection.VerificationTests/resources/helm/values.yaml | Adds verification Helm values examples with multiple image reference formats. |
| test/Microsoft.ComponentDetection.VerificationTests/resources/helm/Chart.yml | Adds a minimal chart metadata file for verification resources. |
| test/Microsoft.ComponentDetection.Detectors.Tests/HelmComponentDetectorTests.cs | Adds extensive unit coverage for direct/structured image formats, digests, nesting, and chart co-location behavior. |
| src/Microsoft.ComponentDetection.Orchestrator/Extensions/ServiceCollectionExtensions.cs | Registers HelmComponentDetector with DI so it can be enabled via detector args. |
| src/Microsoft.ComponentDetection.Detectors/helm/HelmComponentDetector.cs | Implements Helm values YAML parsing and Docker image extraction logic. |
| src/Microsoft.ComponentDetection.Contracts/DetectorClass.cs | Adds DetectorClass.Helm enum value. |
| docs/detectors/helm.md | Documents detector requirements, strategy, and limitations. |
| docs/detectors/README.md | Adds Helm detector entry and status table. |
Copilot's findings
- Files reviewed: 8/8 changed files
- Comments generated: 4
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
src/Microsoft.ComponentDetection.Detectors/helm/HelmComponentDetector.cs:224
TryRegisterImageReferenceis called without a logger here as well, so invalid reconstructed references (e.g., unexpected registry/repository combinations) will be skipped silently. Passthis.Loggerto surface parse failures as warnings.
{
imageRef = $"{imageRef}@{digest}";
}
DockerReferenceUtility.TryRegisterImageReference(imageRef, recorder);
}
- Files reviewed: 8/8 changed files
- Comments generated: 2
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1796 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This pull request introduces a new Helm chart image reference detector,
HelmComponentDetector, to the component detection system. The detector is disabled by default and must be explicitly enabled. It scans Helm values files for Docker image references, supporting both direct and structured formats, and is integrated into the detection orchestrator. Documentation and test resources are also added to support and describe this new functionality.