GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — Fix Windows nightly test failures and absolute --patch-dir bound by mikolalysenko · Pull Request #2049 · SocketDev/socket-patch Conversation
|
| Test | Cause |
|---|---|
patch::user_patches::tests::an_absolute_patch_dir_inside_the_repository_is_read |
package.json built with format!, so C:\... became invalid JSON escapes. The fix below also found a real bug behind this test. |
patch::user_patches::tests::the_repository_bound_holds_for_workspace_runs_only |
ends_with("fixes/left-pad+1.3.0.patch") on a \-separated path |
utils::cargo_build_cache::tests::a_config_above_the_repository_is_named_when_its_target_dir_is_unread |
contains(".cargo/config.toml") checked against .cargo\config.toml |
utils::repo_root::upward_tests::pnpm_workspace_file_above_the_repository_fails_closed |
expected the canonical \\?\C:\... path, but governing_workspace_file deliberately returns it through without_verbatim_prefix |
vex::discover::user_patched::tests::patch_package_patches_mark_yarn_classic_vlt_and_npm_pins |
/ substring checked against patches\left-pad+1.3.0.patch |
vex::discover::user_patched::tests::workspace_member_patches_agree_with_the_consent_gate |
packages/a checked against packages\a\package.json |
hosted_memory_engine::user_patched_npm_packages_are_never_pinned (cli) |
same separator mismatch in the skip detail |
/ separators, unescaped JSON, and \\?\-prefixed expectations.Bound::outside (user_patches.rs) compares the path against the canonical repo root, which on Windows is \\?\C:\proj. A script's --patch-dir C:\proj\fixes is written the way users type it, and Path::starts_with treats the VerbatimDisk and Disk prefixes as different. So on Windows every absolute in-repo --patch-dir was reported as outside the repository, and every npm package was protected. The old test passed a \\?\ path, which no real package.json contains.Bound::outside now compares both sides through pnpm_workspace::without_verbatim_prefix. This changes nothing on Unix.--patch-dir test now spells the directory the way a user does: unprefixed, quoted, and built through serde_json so the backslashes are escaped.\ to /.without_verbatim_prefix(file).No assertion is weaker.
cargo test -p socket-patch-core --lib -- patch::user_patches vex::discover::user_patched utils::repo_root utils::cargo_build_cache: 73 passed.cargo test -p socket-patch-cli --test hosted_memory_engine --test user_patches: 57 passed.rustfmt --check on the touched files is clean.os=windows on this head, 42772455462, passed test (windows-latest, 1) and test (windows-latest, 2). Its only failures are the mode_migration_vlt e2e legs, which fail the same way on main's nightly on every OS and are not this PR's (see the comment below)./code-review high:
user_patch_conflict detail text uses OS separators (Path::display). Production servers run Linux, so changing how in-memory sources are rendered is a larger change and out of scope here. Worth a follow-up.slashed helper. The .replace('\\', "/") call is repeated inline, and there is no shared helper for it. Core has no test-util module that all of these tests share. That refactor is left out of a CI fix.No tests were removed or moved.
🤖 Generated with Claude Code
https://claude.ai/code/session_011f9aeRDbxjatib28cpxPqQ
Note
Medium Risk
Changes workspace-bound patch discovery on Windows (consent gate / user-patch conflicts); incorrect comparison previously over-protected npm packages.
Overview
Fixes Windows nightly CI failures and a production bug where in-repo absolute patch-package --patch-dir paths were treated as outside the git repository.
Production: Bound::outside in user_patches.rs now strips Windows \\?\ verbatim prefixes on both sides before starts_with, so user-typed C:\repo\fixes matches canonical \\?\C:\repo. Unix behavior is unchanged.
Tests: Assertions that assumed / separators or \\?\ paths now normalize with .replace('\\', "/") or expect without_verbatim_prefix. The absolute --patch-dir test builds package.json via serde_json with a quoted, user-style path so JSON escaping is valid on Windows.
Reviewed by Cursor Bugbot for commit c40cda6. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The scheduled CI run has been red on main for five nights. Its `test (windows-latest, 1|2)` legs (nightly-only) fail seven tests that pass on Linux and macOS, all from test-side assumptions about Unix paths: - an_absolute_patch_dir_inside_the_repository_is_read built its package.json with format!, so the Windows path's backslashes were invalid JSON escapes; build it with serde_json instead. - five assertions matched `/`-separated substrings in user-facing detail text that Windows prints with `\`; compare after mapping `\` to `/`. - pnpm_workspace_file_above_the_repository_fails_closed expected the canonical `\\?\` path, but governing_workspace_file deliberately strips that prefix; expect without_verbatim_prefix(file). No production code changes; every assertion still checks the same path on every OS. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011f9aeRDbxjatib28cpxPqQ
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
On Windows the bound's repository root is canonical (`\\?\C:\...`) while a script names its patch directory as users type it (`C:\...`), and Path::starts_with treats the verbatim and plain disk prefixes as different. Every absolute in-repo `--patch-dir` was reported as outside the repository, protecting every npm package. Compare both sides without the verbatim prefix, and make the test spell the directory the way a user does (quoted, unprefixed). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011f9aeRDbxjatib28cpxPqQ
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c40cda6. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
In the Windows dispatch run 42772455462, The same legs failed on main in last night's scheduled run 42763778797 (main @ c751724). They failed on all three OSes there: The failing assertion is I'm leaving it out of this PR. It's the next CI-janitor target. This PR's own target is the Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Labeled Ready for review by the burn-down agent.
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Final review briefWhat it does. Fixes the 7 tests that fail only on the nightly Windows Risk: low. One production line, a no-op on Unix. On Windows it makes an in-repo absolute Look here
Verified
Changes I made. None. Open questions. None blocking. The description lists two follow-ups it chose not to do: OS separators in the hosted engine's detail text, and a shared Auto-merge (squash) is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.