feat(wsl): auto-terminate distros instead of prompting (SC-017)#74
Merged
Conversation
Replace user-facing "please run wsl --terminate" messages and running-state guard rails with automatic Stop-WslDistro calls so update/clone/remove and the various setup-* actions succeed without manual intervention. Invoke-ConfigureWsl now auto-shuts down WSL when .wslconfig changed, since the new global settings only take effect after a subsystem restart. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #74 +/- ##
===========================================
- Coverage 86.07% 86.00% -0.07%
===========================================
Files 22 22
Lines 1917 1908 -9
===========================================
- Hits 1650 1641 -9
Misses 267 267
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Owner
Author
|
@claude opus review thoroughly. In addition check if code coverage can be increased by this pull request. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
…-017) A post-merge review of SC-017 (auto-terminate distros) surfaced an incomplete migration (New-WslUser still uses raw wsl.exe --terminate), a regression in Install-WslProxy that mis-reports termination failures as proxy failures, dropped integration coverage for clone/remove, and stale doc references. Reopen SC-017 with new ACs covering each gap, and add SC-037 for the unrelated WSL Manager unit test coverage gaps found during the review. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…tion coverage, docs (SC-017) Address the four post-merge review gaps that re-opened SC-017: - New-WslUser: replace raw wsl.exe --terminate + Start-Sleep with Stop-WslDistro; add user.Tests.ps1 assertion for the auto-terminate call. - Install-WslProxy: wrap Stop-WslDistro in its own try/catch so a termination failure no longer mis-reports a successful proxy configuration as failed; emit Write-Warning instead. Add Pester test. - manager.docker.Integration.Tests.ps1: add clone and remove auto- terminate integration tests paralleling the existing update test, with try/finally cleanup of the temp distros. - docker.ps1 .NOTES and docs/wsl-manager.md: drop stale manual-terminate instruction; clarify that configure-wsl terminates ALL running distributions (a wsl --shutdown is required to apply .wslconfig). Unit tests: 744 passed (was 742). Integration tests not re-run locally. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wsl --terminate" messages and running-state guard rails (inupdate,clone,remove,repair-interop,setup-user) with automaticStop-WslDistrocalls — actions complete without manual intervention.setup-proxyso a fresh shell loads the updated~/.profile; auto-shutdown afterconfigure-wslso the new.wslconfigsettings take effect.setup-docker/setup-podmanpre-config restart: replaceInvoke-CommandLine wsl.exe --terminate+Start-SleepwithStop-WslDistroto gain verification + retry.Closes
Test plan
testrunner.ps1 -Unit): 997/997Should auto-terminate the distribution and complete update when running) passesNotes
curl: (7) Failed to connect to github.com— the immediately-following idempotency test in the same context downloaded the same 81.9 MB binary successfully. Not caused by SC-017; CI rerun should clear it.Read-SpectreConfirmfor the explicit destructive commandsremove/terminate/shutdown) is intentionally kept separate. SC-017 removes prompts on side-effect terminations; SC-016e adds confirmations on user-invoked destructive commands. They don't overlap.🤖 Generated with Claude Code