Skip to content

Use the long temp path in the dev secret guard test on Windows - #397

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/dev-secret-guard-windows-temp-root
Oct 8, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
fix/dev-secret-guard-windows-temp-root

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Problem

main CI fails on test (windows-latest, 2/2) on every push since #384:

dev-trigger-secret-guard.test.ts > still serves other files under .void
AssertionError: expected 403 to be 200

The test is not flaky. It never passed on Windows. #384 added it, and PRs only run Windows CI with the test: windows label.

Cause

tmpdir() on the Windows runner = C:\Users\RUNNER~1\AppData\Local\Temp   (8.3 short name)
        │
        ▼
realpathSync (JS)  ── keeps RUNNER~1 ──►  test root
        │
GET /.void/routes.d.ts
        │
        ├─ Void guard: no secret path → next()
        └─ Vite static step → isFileLoadingAllowed()
                 if (isWindows && looksLikeWindowsShortNamePath(path)) return false
                 → 403

Vite 8.3 refuses every file under a short-name path on Windows. This is Vite's own rule. The Void guard is correct: all the 404 cases in the file pass on Windows.

What this PR changes

realpathSync(tmp)  →  realpathSync.native(tmp)
C:\Users\RUNNER~1\…     C:\Users\runneradmin\…

realpathSync.native expands the short name. plugin-env-schema.ts already uses it for the same reason, and its tests pass on Windows.

Testing

Check Result
vp test run packages/void/test/integration/dev-trigger-secret-guard.test.ts (macOS) 15/15 pass
Windows simulation with a RUNNER~1 root 403 before, 200 with the long root
windows-latest CI on this PR (test: windows label) the real check

🤖 Generated with Claude Code

The Windows CI temp dir is C:\Users\RUNNER~1\..., an 8.3 short name.
Plain realpathSync keeps it, and Vite refuses to serve any file under a
short-name path, so /.void/routes.d.ts returned 403 instead of 200.
realpathSync.native expands it to the long name.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T14:42:35.442898Z 7aa0fe7 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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-dev-secret-guard-windows-temp-root-void-cloud.voidzero-docs.workers.dev (commit 7aa0fe7)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://e489cfbe-void-cloud.voidzero-docs.workers.dev 7aa0fe7 2026-10-08T14:42:36.909Z Visit the dashboard ↗

@Brooooooklyn
Brooooooklyn merged commit 762c304 into main Oct 8, 2026
34 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/dev-secret-guard-windows-temp-root branch October 8, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant