fix: deduplicate Windows Conda casing aliases - #519
Conversation
Preserve authoritative Windows path casing when well-known and configured Conda aliases refer to the same installation. Add a regression covering lowercase environment aliases.\n\nFixes #518\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Performance Report (Linux)Result: ✅ Within regression budgets
Inventory schema transition
|
Test Coverage Report (Linux)Result: ✅ Within regression budget
|
Performance Report (macOS)Result: ✅ Within regression budgets
Inventory schema transition
|
Performance Report (Windows)Result: ✅ Within regression budgets
Inventory schema transition
|
Test Coverage Report (Windows)Result: ✅ Within regression budget
|
Keep the casing assertion independent of CI temp-path short-name behavior.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allow the one-time Windows Conda deduplication transition while keeping exact inventory matching for snapshots that share a schema. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates PET’s snapshot/performance gating and Windows Conda discovery to support a deliberate “inventory schema” transition (v1 → v2) while eliminating duplicate Conda installs discovered under casing aliases on Windows.
Changes:
- Add an
inventory_schema_versionfield to performance snapshots and gate inventory count comparisons on matching schema versions (with explicit v1→v2 transition reporting). - Normalize and deduplicate Windows known Conda install locations after case normalization, preserving on-disk leaf casing.
- Add regression tests for the inventory-schema transition logic and Windows Conda casing-alias deduplication; update docs accordingly.
Show a summary per file
| File | Description |
|---|---|
| scripts/tests/test_quality_snapshot.py | Adds snapshot helper support + unit tests covering inventory schema transition behavior. |
| scripts/quality_snapshot.py | Introduces inventory schema versioning, transition reporting, and conditional inventory count matching. |
| docs/QUALITY_SNAPSHOTS.md | Documents the new inventory schema semantics and the one-time v1→v2 transition behavior. |
| crates/pet/tests/e2e_performance.rs | Emits inventory_schema_version in the performance JSON output. |
| crates/pet-conda/tests/environment_locations_test.rs | Adds a Windows-only regression test for casing-alias deduplication/preserved casing. |
| crates/pet-conda/src/environment_locations.rs | Implements Windows leaf-casing restoration + post-normalization deduplication for known Conda install paths. |
| crates/pet-conda/Cargo.toml | Adds tempfile for the new Windows-only test. |
| Cargo.lock | Records the new tempfile dependency in the lockfile. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 7/8 changed files
- Comments generated: 0
- Review effort level: Lite
Summary
Fixes #518
Related: microsoft/vscode-python-environments#1703
Validation
cargo test -p pet-conda --test environment_locations_testcargo test --features ci-perf --test e2e_performance test_performance_summary --no-runpython -B -m unittest discover -s scripts/tests -p 'test_*.py' -v(47 passed)./scripts/rust-precommit.ps1