Fix Testbox scripts pnpm bootstrap#4072
Conversation
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughBoth CI scripts ( ✨ Finishing Touches📝 Generate docstrings
🧪 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. Comment |
|
Thanks for your contribution! We require all external PRs to be opened in draft status first so you can address CodeRabbit review comments and ensure CI passes before requesting a review. Please re-open this PR as a draft. See CONTRIBUTING.md for details. |
| Sort-Object Name | | ||
| Select-Object -Last 1 |
There was a problem hiding this comment.
🟡 Windows Node version lookup may select an older version when multiple patch releases are cached
The Node version directory lookup uses lexicographic string sorting (Sort-Object Name at scripts/test-pr-check-windows.ps1:26) instead of version-aware sorting, so a version like "20.20.9" is ranked higher than "20.20.10".
Impact: On a Windows runner with multiple cached Node patch releases, an older Node binary may be selected instead of the latest.
Lexicographic vs version sort mismatch with the Linux equivalent
The bash equivalent at scripts/test-pr-check.sh:39 uses sort -V (version sort), which correctly orders 20.20.9 before 20.20.10. The PowerShell Sort-Object Name does lexicographic comparison, where "20.20.9" > "20.20.10" because the character '9' > '1'. When Select-Object -Last 1 picks the last entry, it gets the wrong version.
For example, with directories 20.20.1, 20.20.2, 20.20.9, 20.20.10:
- Bash
sort -V | tail -n 1→20.20.10✓ - PowerShell
Sort-Object Name | Select-Object -Last 1→20.20.9✗
| Sort-Object Name | | |
| Select-Object -Last 1 | |
| Sort-Object { [version]$_.Name } | | |
| Select-Object -Last 1 |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Testing
bash -n scripts/test-pr-check.shpwshis not installed