Skip to content

Add the HelmComponentDetector and associated tests.#1796

Merged
jpinz merged 4 commits intomainfrom
jupinzer/helm_detector
Apr 20, 2026
Merged

Add the HelmComponentDetector and associated tests.#1796
jpinz merged 4 commits intomainfrom
jupinzer/helm_detector

Conversation

@jpinz
Copy link
Copy Markdown
Member

@jpinz jpinz commented Apr 20, 2026

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.

@jpinz jpinz requested a review from JamieMagee April 20, 2026 18:37
@jpinz jpinz self-assigned this Apr 20, 2026
Copilot AI review requested due to automatic review settings April 20, 2026 18:37
@jpinz jpinz requested a review from a team as a code owner April 20, 2026 18:37
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

👋 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 🙂

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 HelmComponentDetector to discover Docker image references in Helm *values*.y{a}ml files co-located with Chart.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

Comment thread src/Microsoft.ComponentDetection.Detectors/helm/HelmComponentDetector.cs Outdated
Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

Comments suppressed due to low confidence (1)

src/Microsoft.ComponentDetection.Detectors/helm/HelmComponentDetector.cs:224

  • TryRegisterImageReference is called without a logger here as well, so invalid reconstructed references (e.g., unexpected registry/repository combinations) will be skipped silently. Pass this.Logger to surface parse failures as warnings.
        {
            imageRef = $"{imageRef}@{digest}";
        }

        DockerReferenceUtility.TryRegisterImageReference(imageRef, recorder);
    }
  • Files reviewed: 8/8 changed files
  • Comments generated: 2

Comment thread src/Microsoft.ComponentDetection.Detectors/helm/HelmComponentDetector.cs Outdated
Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 8/8 changed files
  • Comments generated: 2

Comment thread docs/detectors/helm.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 20, 2026 19:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 8/8 changed files
  • Comments generated: 3

Comment thread docs/detectors/helm.md
@jpinz jpinz merged commit 4eb4071 into main Apr 20, 2026
18 checks passed
@jpinz jpinz deleted the jupinzer/helm_detector branch April 20, 2026 20:01
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.0%. Comparing base (9582bca) to head (64692bd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #1796   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants