Repository navigation
[WSLC Compose 4/5] Add project listing and lifecycle management - #42292
Draft
David Bennett (dkbennett) wants to merge 3 commits into
Draft
David Bennett (dkbennett) wants to merge 3 commits into
David Bennett (dkbennett) wants to merge 3 commits into
Conversation
Base automatically changed from
user/dkbennett/compose-operation-client
to
feature/compose
November 20, 2026 18:54
Add list/ls output, resolve lifecycle arguments by file or project key, and remove only stopped project containers. Cover listing, project-key lifecycle, aliases, and removal across service and end-to-end tests. Validation: full Windows build; Compose tests 16/16; CLI tests 518/518; formatting and localization checks passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4bce7a09-be93-4627-b729-aaada0f63c66
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4c14c899-3f8c-4862-aeac-8a6f0482b7b7
Use concrete container wrappers for project removal and retain the current execution context. Verify cached deletion state when a wrapper disconnects. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e0bc0749-e046-40d8-894d-59696c501291
David Bennett (dkbennett)
force-pushed
the
user/dkbennett/compose-management
branch
from
November 20, 2026 18:54
390e680 to
f56865e
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved issues leave table state labels unlocalized, hide exited containers in mixed-state project summaries, and cause the final removal test to verify the wrong container.
3 open issues
What changed in this PR
This fourth Compose layer extends the service-backed CLI with project discovery and lifecycle management by project name, allowing existing projects to remain manageable after their Compose files are removed.
Changes:
- Add
compose list/lswith table, JSON, quiet, and all-project output. - Support project-name lifecycle commands and add
remove/rm/deletefor stopped containers, preserving running containers and networks. - Extend the internal session contract, localized messages, and command, service, and end-to-end coverage.
| File | Description |
|---|---|
| test/windows/wslc/WSLCE2EComposeRemoveTests.cpp | Test removal aliases and running-container preservation. |
| test/windows/wslc/WSLCE2EComposeListTests.cpp | Test listing formats and metadata filtering. |
| test/windows/wslc/WSLCE2EComposeLifecycleTests.cpp | Test lifecycle operations after source-file removal. |
| test/windows/wslc/WSLCE2EComposeHelpers.h | Add shared project-status assertions. |
| test/windows/wslc/WSLCComposeTests.cpp | Cover mixed-state removal and progress reporting. |
| test/windows/wslc/WSLCCLIExecutionUnitTests.cpp | Cover project-list execution data. |
| test/windows/wslc/WSLCCLICommandUnitTests.cpp | Verify commands, aliases, and argument types. |
| src/windows/wslcsession/WSLCSession.h | Declare project listing. |
| src/windows/wslcsession/WSLCSession.cpp | Discover labeled projects and aggregate container states. |
| src/windows/wslcsession/WSLCComposeOperation.cpp | Accept the remove action. |
| src/windows/wslcsession/ComposeReconciler.h | Declare stopped-container removal. |
| src/windows/wslcsession/ComposeReconciler.cpp | Remove eligible containers and verify deletion state. |
| src/windows/wslc/tasks/ComposeTasks.h | Declare listing and removal tasks. |
| src/windows/wslc/tasks/ComposeTasks.cpp | Resolve files or project names and render listings. |
| src/windows/wslc/services/ComposeService.h | Expose listing and removal helpers. |
| src/windows/wslc/services/ComposeService.cpp | Format project summaries and invoke removal. |
| src/windows/wslc/services/ComposeModel.h | Define the project-list output model. |
| src/windows/wslc/core/ExecutionContextData.h | Store project summaries in execution context. |
| src/windows/wslc/commands/ComposeStopCommand.cpp | Accept a project name or file. |
| src/windows/wslc/commands/ComposeStartCommand.cpp | Accept a project name or file. |
| src/windows/wslc/commands/ComposeRemoveCommand.cpp | Implement the remove command. |
| src/windows/wslc/commands/ComposeListCommand.cpp | Implement listing options and task flow. |
| src/windows/wslc/commands/ComposeCommand.h | Declare new commands and aliases. |
| src/windows/wslc/commands/ComposeCommand.cpp | Register list and remove commands. |
| src/windows/wslc/commands/ComposeAttachCommand.cpp | Accept a project name or file. |
| src/windows/wslc/arguments/ArgumentDefinitions.h | Define the project positional argument. |
| src/windows/service/inc/wslc.idl | Extend the internal contract for listing and removal. |
| localization/strings/en-US/Resources.resw | Add help and error strings; update project terminology. |
Review effort: Balanced
| table.Reserve(projects.size()); | ||
| for (const auto& project : projects) | ||
| { | ||
| table.AddRow({wsl::shared::string::MultiByteToWide(project.Name), wsl::shared::string::MultiByteToWide(project.Status)}); |
| std::vector<docker_schema::ContainerInfo> containers; | ||
| try | ||
| { | ||
| containers = m_runtime.Docker().ListContainers(options->All, -1, filters); |
| VERIFY_ARE_EQUAL(std::vector<std::string>({"container:remove:wslc-compose-secondary:1/1"}), removeProgress->ProgressDescriptions()); | ||
|
|
||
| wil::com_ptr<IWSLCContainer> removedContainer; | ||
| VERIFY_ARE_EQUAL(WSLC_E_CONTAINER_NOT_FOUND, m_defaultSession->OpenContainer("wslc-compose-basic", &removedContainer)); |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary of the Pull Request
Add Compose project listing and lifecycle management by project name or Compose file. This is layer 4 of 5, based on #42213 and extending Compose stack 42214.
PR Checklist
Detailed Description of the Pull Request / Additional comments
compose list/lswith table, JSON, quiet, and all-project output. Discover projects from WSLC Compose labels, aggregate container state counts, and exclude unsupported metadata versions.start,attach,stop, andremoveto accept either a Compose file or an existing normalized project name. Existing projects remain manageable after their source file is removed.compose removewithrmanddeletealiases. Remove only created or exited containers, preserve running containers and project networks, and report when no stopped containers are found.Interactive cancellation, resource-progress rendering, and service stream handoff remain in layer 5 and are not part of this diff.
Validation covers the combined layers 4 and 5 at
454920dca; this PR's exact layer-4 head,390e680be, has not been independently tested.Validation Steps Performed
.\bin\x64\Debug\test.bat '/name:*Compose*': 56 run; 55 passed, 1 failed..\bin\x64\Debug\test.bat '/name:WSLCComposeTests::ComposeSessionBasicLifecycle': 1 run; 1 passed (retry).