fix: repair PNPM_HOME registry type - #32
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🧰 Additional context used🪛 ast-grep (0.45.3)os/env/path-extender-windows/path-extender-windows.ts[warning] 148-148: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns. (regexp-from-variable) 🔇 Additional comments (2)
📝 WalkthroughWalkthroughThe Windows path extender now checks the registry value type as well as its data. It skips a matching value only when its type also matches the requested type. Tests cover updates for type mismatches and skips for matching values and types. ChangesWindows registry type matching
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The Windows path extender now updates matching registry values with the wrong type, while retaining the skip behavior for matching values and types. No actionable merge-blocking risk is identified. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks each registry key Comment |
Summary
Repair legacy Windows
PNPM_HOMEregistry entries when the stored path is already correct but the registry value type is not.Older pnpm setup versions could leave
PNPM_HOMEasREG_EXPAND_SZ. Current setup compared only the stored data, so a matching path was treated as already correct and never rewritten as the non-expandableREG_SZvalue that%PNPM_HOME%references inPathrequire.The Windows path extender now:
PNPM_HOMEpoints somewhere else;This is the TypeScript/v11 half of pnpm/pnpm#5696. The companion pacquet/v12 fix is pnpm/pnpm#15746.
Regression evidence
On native Windows 11 x64:
REG_EXPAND_SZPNPM_HOMEwas reported asskippedrather thanupdated.path-extender-windows.spec.tssuite passes: 12/12 tests.PNPM_HOMEis alreadyREG_SZ, different-value protection, forced overwrite, Path behavior, and failure handling.git diff --checkpasses.The repository-documented
bit test pnpm.os/env/path-extender-windowscommand could not reach the tests locally because this checkout's Bit workspace fails to resolvepnpm.env/envs/pnpm-env@3.1.0, including afterbit install. The standalone Jest evidence above runs the component's actual source/spec with its declared test dependencies.Written by an agent (ChatGPT, GPT-5.6 Sol).
Summary by CodeRabbit
Pathentry is not rewritten.