Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 4, 2025

Problem

The findVirtualEnvironments function in src/managers/builtin/venvUtils.ts was logging misleading warning messages. When encountering an invalid virtual environment (missing prefix, executable, or version), it would log:

Invalid conda environment: {...}

However, this function is specifically designed to find and process venv environments, not conda environments. The function correctly filters for NativePythonEnvironmentKind.venv on line 179, making the conda reference in the warning message incorrect and confusing for developers debugging environment discovery issues.

Solution

Updated the warning message on line 183 to accurately reflect the environment type being processed:

// Before
log.warn(`Invalid conda environment: ${JSON.stringify(e)}`);

// After
log.warn(`Invalid venv environment: ${JSON.stringify(e)}`);

Impact

This change provides accurate debugging information when invalid venv environments are encountered, making it easier for developers and users to understand which type of environment manager is reporting the issue. The fix is minimal and surgical, changing only the log message text without affecting any functionality.

All existing tests continue to pass, confirming that this change doesn't introduce any regressions.

Created from VS Code via the GitHub Pull Request extension.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…onda

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Reference for Invalid Virtual Environment Fix log message to correctly reference invalid venv environment not conda Sep 4, 2025
Copilot AI requested a review from eleanorjboyd September 4, 2025 20:20
Copilot finished work on behalf of eleanorjboyd September 4, 2025 20:20
@eleanorjboyd eleanorjboyd marked this pull request as ready for review September 4, 2025 22:15
@vs-code-engineering vs-code-engineering bot added this to the August 2025 milestone Sep 4, 2025
@eleanorjboyd eleanorjboyd enabled auto-merge (squash) September 5, 2025 15:50
@eleanorjboyd eleanorjboyd merged commit e81a721 into main Sep 5, 2025
14 checks passed
@eleanorjboyd eleanorjboyd deleted the copilot/fix-bf19f220-f6f6-4f8f-9707-c1f16be89ad9 branch September 5, 2025 17:55
NguyenCuong1989 referenced this pull request in NguyenCuong1989/vscode-python-environments Oct 23, 2025
…onda (#788)

## Problem

The `findVirtualEnvironments` function in
`src/managers/builtin/venvUtils.ts` was logging misleading warning
messages. When encountering an invalid virtual environment (missing
prefix, executable, or version), it would log:

```
Invalid conda environment: {...}
```

However, this function is specifically designed to find and process
**venv** environments, not conda environments. The function correctly
filters for `NativePythonEnvironmentKind.venv` on line 179, making the
conda reference in the warning message incorrect and confusing for
developers debugging environment discovery issues.

## Solution

Updated the warning message on line 183 to accurately reflect the
environment type being processed:

```typescript
// Before
log.warn(`Invalid conda environment: ${JSON.stringify(e)}`);

// After
log.warn(`Invalid venv environment: ${JSON.stringify(e)}`);
```

## Impact

This change provides accurate debugging information when invalid venv
environments are encountered, making it easier for developers and users
to understand which type of environment manager is reporting the issue.
The fix is minimal and surgical, changing only the log message text
without affecting any functionality.

All existing tests continue to pass, confirming that this change doesn't
introduce any regressions.

<!-- START COPILOT CODING AGENT SUFFIX -->

Created from VS Code via the [GitHub Pull
Request](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github)
extension.

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/vscode-python-environments/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
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