fix: tolerate Windows NSIS line endings#509
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single test assertion in the Windows NSIS installer shortcut customization test is updated to use newline-tolerant regex matching ( ChangesNSIS Shortcut Test Robustness
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates a test in electron-builder-nsis-shortcut.test.ts to use a regular expression for matching script content, which improves compatibility with different line endings. The review feedback suggests further enhancing the regex by using \s+ to make the test more resilient to variations in indentation and whitespace.
Root cause: - The post-merge `windows-advisory` workflow was still red after PR #509, but the remaining failure was no longer the NSIS desktop installer test. - The failing job was `unit-windows-opencode-session`, and the failure happened inside `packages/opencode/test/session/export.test.ts` before the export assertion ran. - Windows reported `EBUSY: resource busy or locked` while the test attempted to delete a git-backed temp project directory with `fs.rm(...)` in order to simulate a missing original session instruction directory. - The same `EBUSY` signature appeared in consecutive dev advisory runs, so it was actionable CI instability rather than a one-off signal to ignore. What changed: - Added a small test-local helper, `removeSessionProjectDirectory`, that keeps the existing deletion behavior but adds retry budget for transient Windows file-handle release delays. - Replaced the two direct `fs.rm(sessionProject.path, ...)` calls in the export tests that intentionally remove the original session project directory. - Kept the export/runtime implementation and the existing assertions unchanged. Scope boundary: - Test-only change in `packages/opencode/test/session/export.test.ts`. - No product export behavior, installer code, workflow configuration, dependencies, or generated files changed. - This is separate from the PR #509 NSIS line-ending fix; #509 fixed `unit-windows-desktop`, while this PR addresses the remaining opencode session export advisory failure. Verification: - `git diff --check` completed with no whitespace errors. - `bun --cwd packages/opencode test test/session/export.test.ts` passed locally with 32 pass / 0 fail. - PR #511 status rollup completed successfully: `ci`, `desktop-smoke`, `codeql`, `e2e-artifacts`, `commit-lint`, PR title lint, dependency review, CodeRabbit, and unit result checks were all green. Follow-up: - The direct original failure surface is the `windows-advisory` workflow on dev. That workflow is not part of the normal PR path, so the final confirmation is the next dev advisory run after this squash merge, or a manual dispatch of `windows-advisory`.
Summary
Allow the Windows NSIS shortcut customization test to match both LF and CRLF line endings.
Why
The post-merge
windows-advisoryworkflow started failing after #503 because Git for Windows checked outpackages/desktop-electron/resources/installer.nshwith CRLF line endings, while the test asserted a literal LF-only substring. The installer script content was correct; the test was too line-ending-specific for the Windows runner.Related Issue
No dedicated issue. This fixes the repeated post-merge
windows-advisoryfailure introduced by #503.Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
Confirm the regex preserves the original structural assertion while accepting Windows CRLF checkout behavior.
Risk Notes
Low. This is a test-only change and does not change installer runtime behavior.
How To Verify
Screenshots or Recordings
Not applicable. No visible UI change.
Checklist
dev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit
Release Notes