Conversation
Co-authored-by: Copilot <copilot@github.com>
…the updated utilities to reduce code duplication.
|
👋 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
This PR adds a new default-off Docker Compose detector to discover Docker image references from compose YAML files, refactors shared Docker image reference parsing/registration into a common utility, and documents the new detector with supporting tests and verification resources.
Changes:
- Added
DockerComposeComponentDetector(DefaultOff) with compose/override file search patterns and YAML-based image extraction. - Introduced shared helpers in
DockerReferenceUtilityto skip unresolved-variable references and to safely parse/register image references. - Added unit tests + verification resources and updated detector documentation/index.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.ComponentDetection.VerificationTests/resources/dockercompose/docker-compose.yml | Adds compose resource with multiple services + tag/digest cases for verification runs. |
| test/Microsoft.ComponentDetection.VerificationTests/resources/dockercompose/docker-compose.override.yml | Adds override compose resource for verification runs. |
| test/Microsoft.ComponentDetection.Detectors.Tests/DockerComposeComponentDetectorTests.cs | Adds unit tests covering compose patterns, registry refs, digest refs, and unresolved-variable skipping. |
| src/Microsoft.ComponentDetection.Orchestrator/Extensions/ServiceCollectionExtensions.cs | Registers the new Docker Compose detector in DI. |
| src/Microsoft.ComponentDetection.Detectors/dockerfile/DockerfileComponentDetector.cs | Switches Dockerfile detector to shared DockerReferenceUtility parsing logic and enables nullable. |
| src/Microsoft.ComponentDetection.Detectors/dockercompose/DockerComposeComponentDetector.cs | Implements the new Docker Compose detector using YamlDotNet to extract services.*.image. |
| src/Microsoft.ComponentDetection.Contracts/DetectorClass.cs | Adds DetectorClass.DockerCompose category. |
| src/Microsoft.ComponentDetection.Common/DockerReference/DockerReferenceUtility.cs | Adds HasUnresolvedVariables, TryParseImageReference, and TryRegisterImageReference helpers. |
| docs/detectors/dockercompose.md | Adds documentation for Docker Compose detector behavior and limitations. |
| docs/detectors/README.md | Adds Docker Compose detector to the detector documentation index. |
Copilot's findings
- Files reviewed: 10/10 changed files
- Comments generated: 4
…lity Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…failures Co-authored-by: Copilot <copilot@github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1785 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This pull request introduces a new detector for Docker Compose files, improves Docker image reference parsing, and enhances documentation. The main changes are the addition of the
DockerComposeComponentDetector(default-off), refactoring of Dockerfile detection logic to use new utility methods, and updates to documentation to describe the new detector and its behavior.This is PR 1 of 3 for splitting up #1759