Repository navigation
Fix CRLF checkout of pnpm registry fixtures (#2238) - #2239
Conversation
Refs #2238. Assisted-by: Claude Code:claude-fable-5-2
The pnpm-registry-overrides fixtures are real pnpm output, and seven unit tests compare what the scan writes against them byte for byte. Unlike the other captured pnpm fixtures they were not marked -text, so a Windows checkout converted them to CRLF and the tests failed. Fixes #2238. Assisted-by: Claude Code:claude-fable-5-2
The module comment listed the fixture trees marked -text by name and had drifted from .gitattributes, which now also covers the pnpm registry goldens. Refs #2238. Assisted-by: Claude Code:claude-fable-5-2
|
bugbot run Generated by Claude Code |
PR SummaryLow Risk Overview The Reviewed by Cursor Bugbot for commit 94322d4. Configure here. |
|
[agent] Windows-only run of this branch (run 45625281895,
These two checks come from the manual dispatch; the PR's own required checks do not run the Windows legs. Generated by Claude Code |
Wenxin Jiang (Wenxin-Jiang)
left a comment
There was a problem hiding this comment.
[agent] Reviewed; no major findings.
LLM Description written by Claude Code:claude-fable-5-2
Fixes #2238
Summary
Seven unit tests of
socket-patch-corefail on every Windows run,on
mainand on each PR that runs the Windows tests. They read thepnpm-registry-overridesgolden fixtures byte for byte, and a Windowscheckout converts those fixtures to CRLF. This PR marks the directory
-textin.gitattributes, as the other captured pnpm fixturesalready are. No product code changes.
Root cause
The fixtures are real pnpm output, committed with LF line endings.
.gitattributeshad no rule forcrates/socket-patch-core/tests/fixtures/pnpm-registry-overrides/**,so git with
core.autocrlf=true(the default of Git for Windows)checked them out as CRLF. The tests then compared LF output against
CRLF goldens, or failed earlier with "mixes CRLF and LF line endings".
Changes
.gitattributes: add the-textrule for the fixture directory.vex/discover/testing/golden.rs: a module comment listed the-textfixture trees by name and had drifted; it now points at.gitattributes. Comment only.Evidence
Reproduced on Linux with a clone that converts line endings
(
git clone -c core.autocrlf=true), runningmain(e685fb1)w/crlfw/lf,attr/-textNo new test: the seven existing tests are the regression tests, and
they go from red to green on a converting checkout. On the same
checkout
cargo test -p socket-patch-cli --test in_process_pnpm_registry_cleanup,which reads the same fixtures, passes (21 passed).
Also run locally:
cargo clippy --locked --workspace --all-features -- -D warnings(clean) and
cargo fmt --checkon the touched Rust file.On Windows itself (run 45625281895,
workflow_dispatch -f os=windowson this branch; the PR checks do notrun the Windows tests):
test (windows-latest, 1)passes with8066 passed; 0 failedin the core unit tests, against8059 passed; 7 failedonmain.That run's
ci-ok (windows only)is still red because of oneend-to-end test,
pnpm11_registry_route_is_cleaned_up_when_a_patch_is_not_needed. Itfails the same way on
main, is tracked in #2235, and is not causedor fixed by this PR.
Notes for reviewers
change, because git does not rewrite files when only attributes
change. Delete
crates/socket-patch-core/tests/fixtures/pnpm-registry-overridesand restore it with
git checkout -- <dir>. Fresh clones and CIare unaffected.
/code-review highfound no defects. Its three notes are coveredabove: the Windows run, the stale comment, and the existing-clone
note. I left the
.replace("\r\n", "\n")in the CLI test'smember_goldenhelper alone; it is now redundant but harmless.failure and is not addressed here.
Generated by Claude Code