Skip to content

one time mitigation of unintentional setting saved to user settings#1527

Merged
eleanorjboyd merged 5 commits into
microsoft:mainfrom
eleanorjboyd:psychiatric-raven-one-time-mitigation
May 13, 2026
Merged

one time mitigation of unintentional setting saved to user settings#1527
eleanorjboyd merged 5 commits into
microsoft:mainfrom
eleanorjboyd:psychiatric-raven-one-time-mitigation

Conversation

@eleanorjboyd
Copy link
Copy Markdown
Member

@eleanorjboyd eleanorjboyd commented May 13, 2026

On activation (right after setPersistentState), runs once per profile. If python-envs.defaultEnvManager has a globalValue of 1ms-python.python:system1, it clears it via config.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

@eleanorjboyd eleanorjboyd changed the title Psychiatric raven one time mitigation one time mitigation of unintentional setting saved to user settings May 13, 2026
…ne-time-mitigation

# Conflicts:
#	docs/managing-python-projects.md
#	src/features/settings/settingHelpers.ts
#	src/test/features/settings/settingHelpers.unit.test.ts
@eleanorjboyd eleanorjboyd added the bug Issue identified by VS Code Team member as probable bug label May 13, 2026
@eleanorjboyd eleanorjboyd self-assigned this May 13, 2026
@eleanorjboyd eleanorjboyd requested a review from Copilot May 13, 2026 17:23
@eleanorjboyd eleanorjboyd marked this pull request as ready for review May 13, 2026 17:24
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 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

Comment thread src/extension.ts Outdated
Comment thread src/features/settings/settingHelpers.ts Outdated
Comment thread src/features/settings/settingHelpers.ts Outdated
Comment thread src/test/features/settings/settingHelpers.unit.test.ts
@eleanorjboyd eleanorjboyd merged commit a4ca628 into microsoft:main May 13, 2026
44 checks passed
@eleanorjboyd eleanorjboyd deleted the psychiatric-raven-one-time-mitigation branch May 13, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants