Skip to content

test(link): import the retirement module by file path in subprocess cases - #8692

Merged
lidge-jun merged 1 commit into
devfrom
fix/dev-red3-route-intent-windows-a
Nov 13, 2026
Merged

lidge-jun merged 1 commit into
devfrom
fix/dev-red3-route-intent-windows-a

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

windows 3/14 of dev batch run 43413601225 failed tests/clients/link-retirement.test.ts:27 "receipt survives a fresh process and is private" (JSON Parse error: Unexpected EOF) and :39 "competing processes cannot both claim the same link". These cases came with #8416 (f23910ab2d). They build the module path for a bun -e child with new URL(...).pathname. That gives /D:/a/... for a Windows file URL and keeps percent escapes (for example %20 for a space), so the child cannot import the module and prints nothing.

Both cases now use fileURLToPath. Assertions are unchanged; test-only.

Verification

  • Reproduced the escape half on Linux by running a copy of the file from a checkout path containing spaces. Before: "receipt survives a fresh process and is private" fails with the same Unexpected EOF. After: 8 pass, 0 fail.
  • bun test tests/clients/link-retirement.test.ts: 8 pass, 0 fail. bun run typecheck: exit 0.
  • NOT RUN: a native Windows runner (next dev batch), and the full suite.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Tests
    • Improved cross-platform path handling in child-process tests for link retirement.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 13, 2026 13:36
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T13:38:24.812523Z 220f55e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The retirement tests now convert the module URL to a filesystem path with fileURLToPath in both child-process cases. The change affects test code only.

Changes: Retirement test path resolution

Layer / File(s) Summary
Convert module URLs to filesystem paths
tests/clients/link-retirement.test.ts
The test imports fileURLToPath at line 6 and uses it instead of .pathname in the fresh-process test at line 26 and the competing-process test at line 37.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: Minimal · up to 220f5

This test-only change fixes how the retirement module path is built for child-process tests, so paths with spaces or Windows paths should resolve correctly. There is no production impact, and the merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test(link): import the retirement module by file path in subprocess cases" matches the main change. The raw summary and PR objectives both say the two child-process tests in tests/clients/l…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(link): import the retirement module by file path in subprocess cases" matches the main change. The raw summary and PR objectives both say the two child-process tests in tests/clients/link-retirement.test.ts now build the retirement.ts path with fileURLToPath instead of URL.pathname. The title names the test scope, the subprocess cases, and the path-handling intent. It is short, single-sentence, and specific. It does not mention the Windows and percent-escape motivation, but that detail is not required for a title.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ee0098a and 220f55e.

Files selected for processing: 1

  • tests/clients/link-retirement.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer judgment (dev integration, MAINTAINERS.md maintainer-integration exception): merging without a second maintainer approval, as part of the DEV-RED repair for dev batch run 43413601225 (windows 3/14).

  • Exact head: 220f55e891cf64b6b386a4c9982965f55ed0ed86. Every required PR check on this head passed.
  • Fresh independent review on this exact head (gpt-6.1-terra, high): VERDICT: PASS, no findings. Its fresh runs: link-retirement 8 pass / 0 fail; typecheck, layout, ratchet, structure:check and privacy:scan pass.
  • Classification: test-assumption bug from feat(link): sync route intent and materialize clients per device (re-land #8276) #8416 (new URL().pathname is not a Windows file path). Test-only.
  • No outstanding change requests.

@lidge-jun
lidge-jun merged commit c9d49df into dev Nov 13, 2026
31 checks passed
@lidge-jun
lidge-jun deleted the fix/dev-red3-route-intent-windows-a branch November 13, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant