one time mitigation of unintentional setting saved to user settings#1527
Merged
eleanorjboyd merged 5 commits intoMay 13, 2026
Merged
Conversation
…ne-time-mitigation # Conflicts: # docs/managing-python-projects.md # src/features/settings/settingHelpers.ts # src/test/features/settings/settingHelpers.unit.test.ts
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a one-time startup migration to remove an unintentionally persisted global python-envs.defaultEnvManager value of system, mitigating environment auto-selection failures such as issue #1468.
Changes:
- Adds migration logic and invokes it during activation.
- Adds telemetry for migration outcomes.
- Adds unit tests for migration behavior.
Show a summary per file
| File | Description |
|---|---|
src/extension.ts |
Starts the migration after persistent state initialization. |
src/features/settings/settingHelpers.ts |
Implements the one-time global setting cleanup. |
src/common/telemetry/constants.ts |
Defines the migration telemetry event and properties. |
src/test/features/settings/settingHelpers.unit.test.ts |
Adds tests for migration success, skip, already-migrated, and failure cases. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 4
benvillalobos
approved these changes
May 13, 2026
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.
On activation (right after
setPersistentState), runs once per profile. Ifpython-envs.defaultEnvManagerhas a globalValue of 1ms-python.python:system1, it clears it viaconfig.update(..., undefined, ConfigurationTarget.Global), logs an info trace pointing at issue #1468, and sets a persistent-state flag(globalSettingsMigration.systemEnvManagerRemoved)so it never runs again.NOTE: Here we can't distinguish "user intent" from "bug-set value". If anyone deliberately set
defaultEnvManager: "system"globally, this silently undoes it. This is a tradeoff Im willing to take given the number of users potentially in each bucket