Skip to content

Add wslc network connect and disconnect commands#41011

Open
beena352 wants to merge 8 commits into
microsoft:masterfrom
beena352:user/beenachauhan/network-connect-disconnect
Open

Add wslc network connect and disconnect commands#41011
beena352 wants to merge 8 commits into
microsoft:masterfrom
beena352:user/beenachauhan/network-connect-disconnect

Conversation

@beena352

@beena352 beena352 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Adds wslc network connect and wslc network disconnect CLI commands as thin shims over the existing IWSLCContainer::ConnectToNetwork / DisconnectFromNetwork COM methods.

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

  • Added NetworkConnectCommand and NetworkDisconnectCommand
  • Added NetworkConnectTask and NetworkDisconnectTask in the task pipeline
  • Added ConnectContainerToNetwork and DisconnectContainerFromNetwork to NetworkService
  • Added localization strings (WSLCCLI_NetworkConnectDesc, WSLCCLI_NetworkConnectLongDesc, WSLCCLI_NetworkDisconnectDesc, WSLCCLI_NetworkDisconnectLongDesc)
  • Updated WSLCE2ENetworkTests.cpp help output to include the new subcommands

Validation Steps Performed

Copilot AI review requested due to automatic review settings July 7, 2026 00:12

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 aims to add wslc network connect and wslc network disconnect CLI subcommands as shims over the existing IWSLCContainer::ConnectToNetwork / DisconnectFromNetwork COM APIs, plus corresponding localization and test help-output updates.

Changes:

  • Adds NetworkService::Connect / NetworkService::Disconnect and corresponding task entrypoints (ConnectNetwork / DisconnectNetwork).
  • Registers new connect / disconnect subcommands under the network root command and updates the e2e “available commands” help list.
  • Adds en-US localization strings for the new subcommands’ short/long descriptions.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/windows/wslc/e2e/WSLCE2ENetworkTests.cpp Adds connect/disconnect to the expected wslc network --help subcommand list.
src/windows/wslc/tasks/NetworkTasks.h Declares new network connect/disconnect task functions.
src/windows/wslc/tasks/NetworkTasks.cpp Implements task shims that call into NetworkService connect/disconnect.
src/windows/wslc/services/NetworkService.h Declares NetworkService::Connect / Disconnect.
src/windows/wslc/services/NetworkService.cpp Implements COM calls to connect/disconnect a container to/from a network.
src/windows/wslc/commands/NetworkCommand.h Declares new NetworkConnectCommand / NetworkDisconnectCommand command types.
src/windows/wslc/commands/NetworkCommand.cpp Registers the new connect / disconnect subcommands under wslc network.
localization/strings/en-US/Resources.resw Adds localized description strings for the new subcommands.

Comment thread src/windows/wslc/commands/NetworkCommand.cpp
Comment thread src/windows/wslc/tasks/NetworkTasks.cpp
Comment thread src/windows/wslc/tasks/NetworkTasks.cpp
Comment thread test/windows/wslc/e2e/WSLCE2ENetworkTests.cpp

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 11 out of 11 changed files in this pull request and generated no new comments.

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 11 out of 11 changed files in this pull request and generated no new comments.

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 11 out of 11 changed files in this pull request and generated 2 comments.

Comment thread localization/strings/en-US/Resources.resw
Comment thread localization/strings/en-US/Resources.resw
@beena352 beena352 marked this pull request as ready for review July 7, 2026 00:45
@beena352 beena352 requested a review from a team as a code owner July 7, 2026 00:45
Copilot AI review requested due to automatic review settings July 7, 2026 00:45

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 11 out of 11 changed files in this pull request and generated no new comments.

dkbennett
dkbennett previously approved these changes Jul 7, 2026

@dkbennett dkbennett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good, would recommend putting the tests into the existing network tests just to try to be a little more efficient with builds without significant incremental/maintenance cost added.

Comment thread test/windows/wslc/e2e/WSLCE2ENetworkConnectDisconnectTests.cpp Outdated
OneBlue
OneBlue previously approved these changes Jul 8, 2026

@OneBlue OneBlue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Minor test comment

Comment thread test/windows/wslc/e2e/WSLCE2ENetworkConnectDisconnectTests.cpp Outdated
Copilot AI review requested due to automatic review settings July 8, 2026 19:04
@beena352 beena352 dismissed stale reviews from OneBlue and dkbennett via 3392921 July 8, 2026 19:04

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 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread test/windows/wslc/e2e/WSLCE2ENetworkTests.cpp
Copilot AI review requested due to automatic review settings July 8, 2026 19:14

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 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread test/windows/wslc/e2e/WSLCE2ENetworkTests.cpp
Comment thread test/windows/wslc/e2e/WSLCE2ENetworkTests.cpp
Copilot AI review requested due to automatic review settings July 8, 2026 19:40

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 10 out of 10 changed files in this pull request and generated no new comments.

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