Skip to content

wslc: add --all-tags to pull for docker parity - #41494

Draft
ggarzia-MSFT wants to merge 7 commits into
masterfrom
user/ggarzia/wslc-pull-all-tags
Draft

wslc: add --all-tags to pull for docker parity#41494
ggarzia-MSFT wants to merge 7 commits into
masterfrom
user/ggarzia/wslc-pull-all-tags

Conversation

@ggarzia-MSFT

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Adds the --all-tags / -a flag to wslc pull and wslc image pull. When specified, every tag in the repository is downloaded instead of a single tag.

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

Behavior

  1. A reference that already names a tag or digest is rejected. wslc pull ubuntu:22.04 --all-tags fails with tag can't be used with --all-tags/-a rather than silently ignoring one of the two.
  2. The Using default tag: latest line is suppressed. because with --all-tags no default tag is applied.
  3. The final line prints the repository, not a tagged reference. Docker prints distributionRef.String(), and TagNameOnly is not applied under --all-tags, so docker pull -a ubuntu ends with docker.io/library/ubuntu.

Tests

  • 11 command-line parser cases covering --all-tags, -a, both pull and image pull spellings, --all-tags=true, flag-before-positional ordering, and the negative cases --alltags and the case-sensitive -A.
  • ImagePullCommand_HasAllTagsArgumentWithDockerAlias unit test.
  • New WSLCE2EImagePullTests.cpp with WSLCE2E_Image_Pull_AllTagsListedInHelp, WSLCE2E_Image_Pull_AllTagsRejectsTaggedReference, and WSLCE2E_Image_Pull_AllTagsRejectsDigestReference.

Validation Steps Performed

Full cmake --build . succeeds. wslc image pull --help was run against the local build and lists -a --all-tags Download all tagged images in the repository.

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

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

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/-a argument for pull commands and enforce “reject tagged/digest reference” + adjusted output behavior in the CLI task.
  • Extend the IWSLCSession::PullImage COM method signature to accept an AllTags boolean and plumb it through ImageService.
  • Add/extend command-line parser tests, unit tests, and new E2E coverage for the --all-tags behavior 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.

Comment thread localization/strings/en-US/Resources.resw Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 1, 2026 17:25

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

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>
Copilot AI review requested due to automatic review settings September 1, 2026 18:07

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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Comment thread src/windows/service/inc/wslc.idl
Comment thread src/windows/wslcsession/WSLCSession.cpp Outdated
ggarzia-MSFT and others added 2 commits September 1, 2026 11:39
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 2, 2026 01:27

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.

🔵 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>
Copilot AI review requested due to automatic review settings September 2, 2026 18:15

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

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

Comment thread test/windows/wslc/e2e/WSLCE2EImagePullTests.cpp
Comment thread localization/strings/en-US/Resources.resw Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 2, 2026 19: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.

🟡 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

Comment thread src/windows/wslcsession/WSLCSession.cpp
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.

2 participants