Skip to content

wslc: add --all to image list for docker parity - #41456

Merged
ggarzia-MSFT merged 4 commits into
masterfrom
user/ggarzia/wslc-images-all
Sep 10, 2026
Merged

wslc: add --all to image list for docker parity#41456
ggarzia-MSFT merged 4 commits into
masterfrom
user/ggarzia/wslc-images-all

Conversation

@ggarzia-MSFT

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Adds --all / -a to wslc image list (and its image ls / images spellings), matching docker images --all. The service already accepted a WSLCListImagesFlagsAll flag; only the CLI needed to expose it.

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

WSLCListImagesFlagsAll was already defined in WSLCShared.idl and already honored end to end: WSLCSession::ListImages unpacks it and forwards it to Docker().ListImages(all, digests, filters). The CLI simply never set it, so there was no way to reach the behavior from wslc.

  • ImageListCommand registers ArgType::All with a description override, following the existing ImagePruneCommand / VolumePruneCommand pattern. ArgType::All already carries the -a alias, so no new argument type was needed.
  • ImageService::List takes a new defaulted bool all and sets the flag. Flag assembly switched to WI_SetFlagIf so the two independent flags compose instead of overwriting each other.
  • GetImages reads the argument and forwards it.
  • New localized description 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 the image list and root-scoped images constructions register --all with the -a alias 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 by image list --quiet --no-trunc must also appear under --all, -a, and images --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--all and its localized description appear in image list --help.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 26, 2026 22:07
@ggarzia-MSFT
ggarzia-MSFT marked this pull request as ready for review August 26, 2026 22:08
@ggarzia-MSFT
ggarzia-MSFT requested review from a team as code owners August 26, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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) to ImageListCommand with a localized help description.
  • Thread the new CLI flag through GetImages into ImageService::List, composing flags via WI_SetFlagIf.
  • Add unit and E2E coverage validating argument registration, help output, and that --all is 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.

ggarzia-MSFT and others added 2 commits September 1, 2026 11:41
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
JohnMcPMS
JohnMcPMS previously approved these changes Sep 1, 2026
Comment thread test/windows/wslc/e2e/WSLCE2EImageListTests.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The CLI wiring is minimal and consistent with existing patterns, and the added unit/E2E tests directly validate the new --all/-a surface area and behavior.

Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…helper

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 2, 2026 20:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A couple of newly-added test lines are likely to exceed the repo’s enforced 130-column clang-format limit and can fail formatting verification in CI.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

test/windows/wslc/WSLCCLICommandUnitTests.cpp:160

  • This initializer list is on a single long line that exceeds the repo's clang-format ColumnLimit (130), which will cause FormatSource.ps1 -Verify to fail. Please split the entries across lines so clang-format doesn't need to reflow it.
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread test/windows/wslc/e2e/WSLCE2EImageListTests.cpp
@ggarzia-MSFT
ggarzia-MSFT merged commit 42bc8b7 into master Sep 10, 2026
12 checks passed
@ggarzia-MSFT
ggarzia-MSFT deleted the user/ggarzia/wslc-images-all branch September 10, 2026 19:38
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.

4 participants