Skip to content

[WSLC] Enable portMappings for WSLC (TCP host->container forwarding)#530

Merged
SohamDas2021 merged 5 commits into
mainfrom
user/sodas/wslc-port-mapping
Jun 23, 2026
Merged

[WSLC] Enable portMappings for WSLC (TCP host->container forwarding)#530
SohamDas2021 merged 5 commits into
mainfrom
user/sodas/wslc-port-mapping

Conversation

@SohamDas2021

@SohamDas2021 SohamDas2021 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

📖 Description

This change enables port mappings for TCP hosts; we call WSLC SDK API WslcSetContainerSettingsPortMappings and wire the portMappings in the runner.

🔗 References

🔍 Validation

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

GitHub Actions runs the PR validation build automatically. The ADO pipeline
(MXC-PR-Build) is the official build pipeline that signs the binaries; it
runs on merge to main and nightly, and Microsoft reviewers can trigger it
on a PR with /azp run. See docs/pull-requests.md.

Microsoft Reviewers: Open in CodeFlow

Copilot AI review requested due to automatic review settings June 15, 2026 18:45
@SohamDas2021 SohamDas2021 requested a review from a team as a code owner June 15, 2026 18: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

Enable WSLC host→container TCP port forwarding by wiring experimental.wslc.portMappings through the Rust config parser into the WSLC SDK container-settings call, with accompanying schema/docs/test updates.

Changes:

  • Add WSLC SDK bindings + runner support for WslcSetContainerSettingsPortMappings and WslcContainerPortMapping.
  • Strengthen port-mapping config parsing/validation (required fields, normalization, duplicate detection; explicit UDP rejection with a clear message).
  • Add/update dev schema, docs, and local/SDK tests to cover TCP port-mapping usage and UDP rejection.

Reviewed changes

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

Show a summary per file
File Description
tests/scripts/run_wslc_all_tests.ps1 Adds two WSLC network test configs to the local WSLC test runner.
tests/configs/wslc_port_mapping_tcp.json New WSLC config exercising a single TCP port-mapping entry.
tests/configs/wslc_port_mapping_multiple.json New WSLC config exercising multiple TCP port-mapping entries.
src/core/wxc_common/src/config_parser.rs Parses/validates WSLC portMappings (required fields, protocol normalization, UDP rejection, duplicate detection) + updates unit tests.
src/backends/wslc/common/src/wslc_bindings.rs Introduces FFI types and function pointer for WslcSetContainerSettingsPortMappings, plus layout test.
src/backends/wslc/common/src/wsl_container_runner.rs Applies port mappings to WSLC container settings before container creation.
sdk/tests/integration/wslc-e2e.test.ts Adds E2E coverage for TCP forwarding and UDP rejection; improves assertions/timeout.
sdk/src/types.ts Expands documentation for portMappings/protocol in SDK types.
schemas/dev/mxc-config.schema.0.8.0-dev.json Updates WSLC portMappings schema to TCP-only + adds default [].
docs/wsl/wsl-container-support-plan.md Documents WSLC portMappings API + notes UDP E_NOTIMPL limitation and parser behavior.
docs/schema.md Adds portMappings example to the main schema doc snippet.

Comment thread sdk/src/types.ts Outdated
Comment thread sdk/tests/integration/wslc-e2e.test.ts
Comment thread src/core/wxc_common/src/config_parser.rs

@MGudgin MGudgin 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.

🕐

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs-Author-Feedback Issue needs attention from issue or PR author label Jun 18, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Jun 18, 2026
@microsoft microsoft deleted a comment from azure-pipelines Bot Jun 18, 2026
@microsoft microsoft deleted a comment from azure-pipelines Bot Jun 18, 2026

@MGudgin MGudgin 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.

:shipit:

@SohamDas2021

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in 74d0bbf. The branch now merges main cleanly; the only conflict was in src/backends/wslc/common/src/wsl_container_runner.rs, and I kept the WSLC port-mapping logic while taking main’s newer fail-fast volume-mount handling.

@SohamDas2021 SohamDas2021 merged commit 724174f into main Jun 23, 2026
18 checks passed
@SohamDas2021 SohamDas2021 deleted the user/sodas/wslc-port-mapping branch June 23, 2026 18:47
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the Needs-Attention Issue needs attention from Microsoft label Jun 23, 2026
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