Skip to content

Fix CRLF checkout of pnpm registry fixtures (#2238) - #2239

Merged
Mikola Lysenko (mikolalysenko) merged 3 commits into
mainfrom
agent/fix-pnpm-registry-fixtures-crlf
Nov 25, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 3 commits into
mainfrom
agent/fix-pnpm-registry-fixtures-crlf

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-fable-5-2

Fixes #2238

Summary

Seven unit tests of socket-patch-core fail on every Windows run,
on main and on each PR that runs the Windows tests. They read the
pnpm-registry-overrides golden fixtures byte for byte, and a Windows
checkout converts those fixtures to CRLF. This PR marks the directory
-text in .gitattributes, as the other captured pnpm fixtures
already are. No product code changes.

Root cause

The fixtures are real pnpm output, committed with LF line endings.
.gitattributes had no rule for
crates/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 -text rule for the fixture directory.
  • vex/discover/testing/golden.rs: a module comment listed the
    -text fixture 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), running

cargo test -p socket-patch-core --lib -- formats::pnpm::named_registries \
  formats::pnpm::registry_alias \
  hosted::engine::tests::the_registry_route_writes_what_pnpm_writes
checkout fixtures on disk result
main (e685fb1) 116 files w/crlf 27 passed, 7 failed (the seven tests of #2238)
this branch 116 files w/lf, attr/-text 34 passed, 0 failed

No 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 --check on the touched Rust file.

On Windows itself (run 45625281895,
workflow_dispatch -f os=windows on this branch; the PR checks do not
run the Windows tests): test (windows-latest, 1) passes with
8066 passed; 0 failed in the core unit tests, against
8059 passed; 7 failed on main.

That run's ci-ok (windows only) is still red because of one
end-to-end test,
pnpm11_registry_route_is_cleaned_up_when_a_patch_is_not_needed. It
fails the same way on main, is tracked in #2235, and is not caused
or fixed by this PR.

Notes for reviewers

  • An existing Windows clone keeps its CRLF copies after pulling this
    change, because git does not rewrite files when only attributes
    change. Delete crates/socket-patch-core/tests/fixtures/pnpm-registry-overrides
    and restore it with git checkout -- <dir>. Fresh clones and CI
    are unaffected.
  • /code-review high found no defects. Its three notes are covered
    above: the Windows run, the stale comment, and the existing-clone
    note. I left the .replace("\r\n", "\n") in the CLI test's
    member_golden helper alone; it is now redundant but harmless.
  • Nightly: pnpm11_registry_route_is_cleaned_up_when_a_patch_is_not_needed fails on Windows (pnpm records the RUNNER~1 short path as a second importer) #2235 (the pnpm 11 end-to-end test on Windows) is a different
    failure and is not addressed here.

Generated by Claude Code

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
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review November 25, 2026 13:54
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test fixture checkout behavior and documentation only; no production logic touched.

Overview
Adds a .gitattributes -text rule for crates/socket-patch-core/tests/fixtures/pnpm-registry-overrides/**, matching other byte-exact pnpm golden directories. On Windows checkouts with core.autocrlf, those fixtures were rewritten to CRLF while the tests compare scan output byte for byte, which caused seven socket-patch-core unit tests to fail.

The golden.rs module comment no longer enumerates which corpus trees are -text; it points readers at .gitattributes so the list cannot drift again. No runtime or product code changes.

Reviewed by Cursor Bugbot for commit 94322d4. Configure here.

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] Windows-only run of this branch (run 45625281895, workflow_dispatch -f os=windows):

These two checks come from the manual dispatch; the PR's own required checks do not run the Windows legs.


Generated by Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[agent] Reviewed; no major findings.

Merged via the queue into main with commit 332b3e8 Nov 25, 2026
153 of 155 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-pnpm-registry-fixtures-crlf branch November 25, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows unit tests fail on main: pnpm-registry-overrides fixtures are checked out as CRLF (mixes CRLF and LF line endings)

3 participants