Skip to content

CI: fix Windows nightly yarnrc path expectation (#1689) - #1710

Open
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
mainfrom
agent/fix-ci-windows-yarnrc-escaped-path
Open

Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
mainfrom
agent/fix-ci-windows-yarnrc-escaped-path

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-opus-5-5

Fixes #1689

Problem

Tonight's nightly CI on main (run 40067511756, head 3db3cdf) fails on one leg only, test (windows-latest, 1) (job 120794033397). Every other job is green, including test (windows-latest, 2), so the fixes from #1686 still hold. The only failing test is:

patch::redirect::yarnrc::tests::global_folder_values_read_like_yarn
panicked at crates\socket-patch-core\src\patch\redirect\yarnrc_tests.rs:594:9:
assertion `left == right` failed: "global-folder=\\${HOME}/x\n"
  left: ["\\${HOME}/x"]
 right: ["/w/\\${HOME}/x"]

#1696 added this test yesterday. Windows test legs run only in the full-scope tier, so neither PR CI nor the merge queue saw it.

Root cause

The escaped-expression case resolves the verbatim value \${HOME}/x against the cwd /w (resolve_with_home → cwd.join(value)). On Unix that gives /w/\${HOME}/x. On Windows a leading \ is root-relative: Path::join keeps the cwd's drive (/w has none) and replaces the rest, giving \${HOME}/x. Yarn behaves the same way, since Node's path.resolve('C:\\w', '\\${HOME}/x') is C:\${HOME}\x. The product behavior is correct; the expectation only held on Unix. This is the same kind of bug as the path-form failures fixed in #1686.

Fix

Test-only change. The expected value is \${HOME}/x on Windows and /w/\${HOME}/x elsewhere, with a comment explaining why. No production code changes.

Evidence

  • Windows, proven: the full-scope workflow_dispatch run 40070451767 on b3e8e4c is green: test (windows-latest, 1), test (windows-latest, 2) and ci-ok all pass. The same leg fails on main's nightly. The later push (50f5840) only rewords the comment.
  • Lean PR CI on 50f5840: green (ci-ok, clippy, coverage, all e2e legs). Cursor Bugbot found no issues.
  • Linux: cargo test -p socket-patch-core --lib global_folder_values_read_like_yarn passes. cargo fmt --all -- --check and cargo clippy --locked --workspace --all-features -- -D warnings are clean.

/code-review high findings

  • Comment wording (it said the cwd's root is replaced, but Windows keeps the drive): fixed in 50f5840.
  • Two findings were not taken: "use a platform-neutral input such as a\${HOME}/x instead of a cfg! branch", and "the Windows expectation comes from Path::join, not a yarn run". The current input is the case Fix yarn global folder moved by global-folder (#1629) #1696 checked against yarn global dir (escape at the start of the value), and its Windows result is now proven on a real Windows runner. Swapping inputs would change what the test covers and would need a second full-scope Windows run to prove. A real-drive Windows check of resolve_with_home would be a product-lane test, not a CI fix.

CI cost

No workflow change. A lean PR run is unchanged at about 28 Linux jobs, about 8 min wall-clock. This PR used one full-scope dispatch run because the expectation is Windows-specific.

https://claude.ai/code/session_01UCnLJqUYK9uEo1t22xjq2i


Generated by Claude Code

The nightly Windows `test` leg has been red since #1696 added
global_folder_values_read_like_yarn. Its escaped-expression case
expected `/w/\${HOME}/x`, which only holds on Unix. On Windows a
leading `\` is root-relative, so joining it onto the cwd replaces the
cwd's root (as Node's path.resolve does) and gives `\${HOME}/x`.

The test now expects the platform's join result. No product change.

Refs #1689

Assisted-by: Claude Code:claude-opus-5-5
Windows keeps the cwd's drive and replaces only the path below it;
the comment said the root was replaced.

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 24, 2026 06:55
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for 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 50f5840. Configure here.

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 24, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Labeled Ready for review by the burn-down agent.

  • Head: 50f5840145d80303a4944493f16dc9493df15762
  • CI: 38/38 non-skipped checks green (50 skipped), no main-wide failures.
  • Bugbot: reviewed this head, no findings.
  • Mergeable against main, no CHANGELOG.md change.

Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Final review brief

What it does. Fixes the one failing Windows nightly leg (#1689). The global_folder_values_read_like_yarn test expected the escaped value \${HOME}/x to resolve to /w/\${HOME}/x on every OS; on Windows a leading \ is root-relative, so Path::join gives \${HOME}/x (same as Node's path.resolve). The expectation is now per-platform. Test-only; no production code changes.

Risk: low. One test file, 9 lines.

Look here

  • yarnrc_tests.rs:592 – the cfg!(windows) expectation and the comment explaining it

Verified. Read the diff and the failing nightly log quoted in the description. The full-scope dispatch run 40070451767 on b3e8e4c is green on both Windows test legs (the later commit only rewords the comment). CI 38/38 non-skipped green on 50f5840; Cursor Bugbot: no issues; no review threads; CHANGELOG.md untouched.

Changes I made. None. Open questions. None.

Auto-merge is armed, so approving sends it straight to the merge queue.


Generated by Claude Code

Mikola Lysenko (mikolalysenko) pushed a commit that referenced this pull request Oct 24, 2026
The full-scope dispatch of this PR fails test (windows-latest, 1) on
global_folder_values_read_like_yarn, the same failure main's nightly
has. #1710 fixes it (a leading backslash is root-relative on Windows)
and is waiting on review; port its test-only change so this PR's
full-scope run can go green. It no-ops once #1710 lands.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PwwQCHPjEtXHWXW4SqeBh7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly Windows test shards fail on temp-path spelling (RUNNER~1 vs canonical \\?\ paths)

2 participants