wslc: add --all-tags to pull for docker parity - #41494
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds Docker-parity support for pulling all tags from an image repository by introducing --all-tags / -a on wslc pull and wslc image pull, wiring it through the CLI → service layer, and covering the new behavior with unit + E2E tests.
Changes:
- Add
--all-tags/-aargument for pull commands and enforce “reject tagged/digest reference” + adjusted output behavior in the CLI task. - Extend the
IWSLCSession::PullImageCOM method signature to accept anAllTagsboolean and plumb it throughImageService. - Add/extend command-line parser tests, unit tests, and new E2E coverage for the
--all-tagsbehavior and help text.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/windows/WSLCTests.cpp | Updates PullImage calls to match the new COM signature (adds AllTags arg). |
| test/windows/wslc/WSLCCLICommandUnitTests.cpp | Adds unit test ensuring image pull registers --all-tags with -a. |
| test/windows/wslc/e2e/WSLCE2EImagePullTests.cpp | New E2E tests for help output and rejecting tag/digest refs under --all-tags. |
| test/windows/wslc/CommandLineTestCases.h | Adds command-line parsing cases for --all-tags/-a and negative cases. |
| test/windows/PluginTests.cpp | Updates PullImage call to match the new COM signature. |
| src/windows/wslcsession/WSLCSession.h | Adds BOOL AllTags parameter to WSLCSession::PullImage. |
| src/windows/wslcsession/WSLCSession.cpp | Implements AllTags behavior by omitting tag defaulting when requested; updates compat call site to pass FALSE. |
| src/windows/wslc/tasks/ImageTasks.cpp | Adds CLI flag handling, validation (reject tag/digest), default-tag output suppression, and final-line output adjustment. |
| src/windows/wslc/services/ImageService.h | Extends ImageService::Pull signature to accept allTags (default false). |
| src/windows/wslc/services/ImageService.cpp | Plumbs allTags into the COM PullImage call. |
| src/windows/wslc/commands/ImagePullCommand.cpp | Registers ArgType::AllTags for image pull. |
| src/windows/wslc/arguments/ArgumentDefinitions.h | Defines AllTags argument metadata (--all-tags, alias -a). |
| src/windows/service/inc/wslc.idl | Updates IWSLCSession::PullImage signature to include [in] BOOL AllTags. |
| localization/strings/en-US/Resources.resw | Adds localized strings for the new arg description and the new error message. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/windows/wslcsession/WSLCSession.cpp:945
- When AllTags is TRUE, this method currently drops any existing tag/digest from the input reference (tagOrDigest.reset()) instead of rejecting the invalid combination. That means API callers can pass e.g. "ubuntu:22.04" with AllTags=TRUE and the tag will be silently ignored, contradicting the CLI behavior and the documented intent for --all-tags.
// Omitting the tag makes the daemon pull every tag in the repository.
if (AllTags)
{
tagOrDigest.reset();
}
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The session-layer PullImage currently allows AllTags combined with a tag/digest by silently dropping it, contradicting the documented “reject tagged/digest refs” behavior and risking unintended “pull all tags” behavior for non-CLI callers.
Review details
Suppressed comments (1)
src/windows/wslcsession/WSLCSession.cpp:942
- When AllTags is TRUE, the session currently clears any parsed tag/digest and proceeds, so a caller can pass a tagged or digested reference together with AllTags and end up pulling all tags instead of getting the documented E_INVALIDARG. Consider rejecting this combination in the session layer as well (defense-in-depth vs. other callers bypassing CLI validation).
if (AllTags)
{
tagOrDigest.reset();
}
- Files reviewed: 14/14 changed files
- Comments generated: 0 new
- Review effort level: Lite
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The localization lock token for the new error string should be corrected and the new --all-tags behavior lacks a positive E2E validation that it actually pulls multiple tags from a registry.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 2
- Review effort level: Lite
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The session-layer implementation does not currently appear to enable “pull all tags” at the Docker Engine API level (missing the all-tags query option), so the core feature may not function as intended.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 1
- Review effort level: Lite
Summary of the Pull Request
Adds the
--all-tags/-aflag towslc pullandwslc image pull. When specified, every tag in the repository is downloaded instead of a single tag.PR Checklist
Detailed Description of the Pull Request / Additional comments
Behavior
wslc pull ubuntu:22.04 --all-tagsfails withtag can't be used with --all-tags/-arather than silently ignoring one of the two.Using default tag: latestline is suppressed. because with--all-tagsno default tag is applied.distributionRef.String(), andTagNameOnlyis not applied under--all-tags, sodocker pull -a ubuntuends withdocker.io/library/ubuntu.Tests
--all-tags,-a, bothpullandimage pullspellings,--all-tags=true, flag-before-positional ordering, and the negative cases--alltagsand the case-sensitive-A.ImagePullCommand_HasAllTagsArgumentWithDockerAliasunit test.WSLCE2EImagePullTests.cppwithWSLCE2E_Image_Pull_AllTagsListedInHelp,WSLCE2E_Image_Pull_AllTagsRejectsTaggedReference, andWSLCE2E_Image_Pull_AllTagsRejectsDigestReference.Validation Steps Performed
Full
cmake --build .succeeds.wslc image pull --helpwas run against the local build and lists-a --all-tags Download all tagged images in the repository.