Skip to content

Generate custom container name on empty input#40432

Open
yao-msft wants to merge 11 commits intomasterfrom
user/yaosun/autocontainername
Open

Generate custom container name on empty input#40432
yao-msft wants to merge 11 commits intomasterfrom
user/yaosun/autocontainername

Conversation

@yao-msft
Copy link
Copy Markdown
Contributor

@yao-msft yao-msft commented May 6, 2026

Summary of the Pull Request

When containerOptions.Name is empty, generate our own container name.

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

Validation Steps Performed

Added tests.

Copilot AI review requested due to automatic review settings May 6, 2026 00:56
@yao-msft yao-msft requested a review from a team as a code owner May 6, 2026 00:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 changes WSLC container creation so that when a caller does not provide a container name, the service generates a human-readable name (using a descriptor + mountain word list), and adds tests that validate the generated name format and uniqueness.

Changes:

  • Add descriptor/mountain word lists for generated container names.
  • Generate a unique container name during WSLCSession::CreateContainer() when no name is provided.
  • Expand WSLC tests to validate the generated name format and uniqueness; update test include paths accordingly.

Reviewed changes

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

File Description
src/windows/wslcsession/WSLCSession.cpp Adds container name generation helpers and injects generated names into container creation when name is absent.
src/windows/wslcsession/ContainerNameGenerator.h Introduces the descriptor/mountain constants used for name generation and test validation.
test/windows/WSLCTests.cpp Adds coverage for generated-name format and uniqueness when creating unnamed containers.
test/windows/CMakeLists.txt Adds include path so tests can include the new name constants header.

Comment thread src/windows/wslcsession/WSLCSession.cpp Outdated
Comment thread src/windows/wslcsession/WSLCSession.cpp
Comment thread src/windows/wslcsession/WSLCSession.cpp Outdated
Comment thread src/windows/wslcsession/WSLCSession.cpp Outdated
Comment thread src/windows/wslcsession/ContainerNameGenerator.h
Comment thread test/windows/WSLCTests.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