Skip to content

Add the Docker Compose Detector#1785

Merged
jpinz merged 9 commits intomainfrom
jupinzer/docker_compose_detector
Apr 20, 2026
Merged

Add the Docker Compose Detector#1785
jpinz merged 9 commits intomainfrom
jupinzer/docker_compose_detector

Conversation

@jpinz
Copy link
Copy Markdown
Member

@jpinz jpinz commented Apr 17, 2026

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

jpinz and others added 2 commits April 17, 2026 16:37
Co-authored-by: Copilot <copilot@github.com>
…the updated utilities to reduce code duplication.
@jpinz jpinz self-assigned this Apr 17, 2026
Copilot AI review requested due to automatic review settings April 17, 2026 16:48
@jpinz jpinz added the type:feature Feature (new functionality) label Apr 17, 2026
@jpinz jpinz requested a review from a team as a code owner April 17, 2026 16:48
@jpinz jpinz requested a review from pauld-msft April 17, 2026 16:48
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 17, 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

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 DockerReferenceUtility to 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

Comment thread docs/detectors/README.md Outdated
…lity

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: 11/11 changed files
  • Comments generated: 0 new

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: 11/11 changed files
  • Comments generated: 4

Comment thread src/Microsoft.ComponentDetection.Common/DockerReference/DockerReferenceUtility.cs Outdated
Comment thread test/Microsoft.ComponentDetection.Common.Tests/DockerReferenceUtilityTests.cs Outdated
…failures

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: 11/11 changed files
  • Comments generated: 1

@jpinz jpinz requested a review from Copilot April 20, 2026 17:19
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: 11/11 changed files
  • Comments generated: 2

Copilot AI review requested due to automatic review settings April 20, 2026 17:49
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: 11/11 changed files
  • Comments generated: 1

@jpinz jpinz merged commit 9582bca into main Apr 20, 2026
19 checks passed
@jpinz jpinz deleted the jupinzer/docker_compose_detector branch April 20, 2026 18:05
@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 (b16ab9e) to head (6d054fc).
⚠️ Report is 1 commits behind head on main.

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

☔ 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

type:feature Feature (new functionality)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants