wslc: add --all to image list for docker parity - #41456
Open
ggarzia-MSFT wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR exposes the already-supported WSLCListImagesFlagsAll behavior via the wslc CLI by adding --all / -a to wslc image list (and the images spelling), aligning behavior with docker images --all.
Changes:
- Add
--all(-a) toImageListCommandwith a localized help description. - Thread the new CLI flag through
GetImagesintoImageService::List, composing flags viaWI_SetFlagIf. - Add unit and E2E coverage validating argument registration, help output, and that
--allis a superset of the default listing.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/windows/wslc/WSLCCLICommandUnitTests.cpp | Adds a unit test verifying --all/-a is registered for both image list and images. |
| test/windows/wslc/e2e/WSLCE2EImageListTests.cpp | Adds E2E tests covering --all behavior (superset property), presence of loaded image, and help text. |
| src/windows/wslc/tasks/ImageTasks.cpp | Plumbs ArgType::All from parsed args into the image listing call. |
| src/windows/wslc/services/ImageService.h | Extends ImageService::List signature with a defaulted all parameter. |
| src/windows/wslc/services/ImageService.cpp | Sets WSLCListImagesFlagsAll (and composes with other flags) when requested. |
| src/windows/wslc/commands/ImageListCommand.cpp | Registers ArgType::All with a command-specific localized description override. |
| localization/strings/en-US/Resources.resw | Adds WSLCCLI_ImageListAllArgDescription localized string for --all help text. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Adds
--all/-atowslc image list(and itsimage ls/imagesspellings), matchingdocker images --all. The service already accepted aWSLCListImagesFlagsAllflag; only the CLI needed to expose it.PR Checklist
Detailed Description of the Pull Request / Additional comments
WSLCListImagesFlagsAllwas already defined inWSLCShared.idland already honored end to end:WSLCSession::ListImagesunpacks it and forwards it toDocker().ListImages(all, digests, filters). The CLI simply never set it, so there was no way to reach the behavior fromwslc.ImageListCommandregistersArgType::Allwith a description override, following the existingImagePruneCommand/VolumePruneCommandpattern.ArgType::Allalready carries the-aalias, so no new argument type was needed.ImageService::Listtakes a new defaultedbool alland sets the flag. Flag assembly switched toWI_SetFlagIfso the two independent flags compose instead of overwriting each other.GetImagesreads the argument and forwards it.WSLCCLI_ImageListAllArgDescription, worded to match docker: "Show all images (default hides intermediate images)."Validation Steps Performed
All new and existing tests in the touched areas were run against a locally deployed build. 21/21 pass.
Unit test:
WSLCCLICommandUnitTests::ImageListCommand_HasAllArgument— asserts both theimage listand root-scopedimagesconstructions register--allwith the-aalias as an optional flag. The root spelling is built through a separate constructor overload, so it is covered explicitly.E2E tests (
WSLCE2EImageListTests, 20 total, 3 new):All_IsSupersetOfDefault— every image ID listed byimage list --quiet --no-truncmust also appear under--all,-a, andimages --all. Asserting a superset rather than an exact set keeps the test stable whether or not intermediate images happen to exist.All_ListsLoadedImage— the loaded Debian test image is still present with--all.All_ListedInHelp—--alland its localized description appear inimage list --help.