Skip to content

Fix container mapping for Docker 29 and surface failures - #173

Closed
Dima Birenbaum (DimaBir) with Copilot wants to merge 2 commits into
mainfrom
copilot/container-mapping-fix
Closed

Dima Birenbaum (DimaBir) with Copilot wants to merge 2 commits into
mainfrom
copilot/container-mapping-fix

Conversation

Copilot AI commented Oct 18, 2026 •

Copy link
Copy Markdown

Summary

  • Read pushed image IDs with docker events --format ID={{.Actor.ID}} instead of the removed top-level .ID field, preserving the existing ID=... report format.
  • Surface container-mapping failures through the Azure Pipelines task library's warning API while keeping the injected task non-blocking.
  • Add regression coverage for the event command, encoded and JSON reports, Docker event/image failures, and successful runs with no push events.
  • Update the container-mapping test harness to await the supported mock runner API and mock HTTPS token/report requests rather than attempting real network calls.
  • Document Docker compatibility and the non-blocking warning behavior.

Fixes #172.

Validation

  • npm run compile passed.
  • node_modules/.bin/tsc --project test/tsconfig.json --outDir test/lib passed.
  • node_modules/.bin/mocha test/lib/MicrosoftSecurityDevOps/v1/container-mapping.tests.js test/lib/MicrosoftSecurityDevOps/v1/command-executor.tests.js passed: 11 tests.
  • Before the production fix, the new Actor ID and warning assertions failed against the original implementation.

The configured package registry rejected dependency installation with HTTP 401. For local validation, the task library was built from its public v1.13.0 source tag and installed locally, along with the missing mockery test helper. Dependency manifests and lockfiles are unchanged. Validation used mocked Docker/HTTPS calls, not a live Azure DevOps pipeline.

Use Actor.ID to support current Docker event messages without changing report data. Keep mapping failures non-blocking but visible as pipeline warnings, and cover the behavior with isolated async tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@DimaBir Dima Birenbaum (DimaBir) changed the title [WIP] Fix container mapping error in Microsoft Defender for DevOps Fix container mapping for Docker 29 and surface failures Oct 18, 2026
@DimaBir
Dima Birenbaum (DimaBir) marked this pull request as ready for review October 18, 2026 10:56
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.

Container Mapping fails on recent Docker CLI: can't evaluate field ID in type *events.Message

3 participants