Skip to content

Merge multiple compose files in the session - #42316

Draft
ggarzia-MSFT wants to merge 2 commits into
user/ggarzia/compose-globalsfrom
user/ggarzia/compose-multi-file
Draft

ggarzia-MSFT wants to merge 2 commits into
user/ggarzia/compose-globalsfrom
user/ggarzia/compose-multi-file

Conversation

@ggarzia-MSFT

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Merges multiple Compose files in the WSLC session. wslc compose -f a.yml -f b.yml ... works, and so does the automatic discovery of compose.override.yml. Previously both failed because the session accepted only a single document.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

  • ComposeNormalizer::Normalize accepts one or more documents and passes all of them to ComposeSpec::Parse.
  • ComposeSpec::Parse merges documents in collection order:
    • Later documents override scalar settings and command.
    • environment is merged by variable name and volumes by container path.
    • ports that are not already present are appended.
    • !reset clears a setting or removes a service; !override replaces a setting or service instead of merging it.
    • Required settings such as image are checked after merging.
  • Each document is validated on its own, so errors name the document that contains them.
  • Relative bind mounts resolve against each document's BaseDirectory.
  • Updated wslc-compose-operations.md and the WSLCComposeDocument comments in wslc.idl to describe the merge behavior.

Stacked on #42257 (user/ggarzia/compose-globals).

Validation Steps Performed

  • New tests: WSLCComposeTests::ComposeMultipleDocumentsMerge, WSLCComposeTests::ComposeMultipleDocumentsReportFailingDocument, WSLCE2EComposeLifecycleTests::WSLCE2E_Compose_MergesDiscoveredOverrideFile
  • cmake --build . -- -m (x64 Debug): passed

ggarzia-MSFT and others added 2 commits November 17, 2026 10:19
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…to user/ggarzia/compose-multi-file

# Conflicts:
#	src/windows/wslcsession/ComposeNormalizer.cpp
#	src/windows/wslcsession/ComposeSpec.cpp
#	src/windows/wslcsession/ComposeSpec.h

This branch has not been deployed

No deployments
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.

1 participant