Repository navigation
Conversation
The Test step interpolated the package and files inputs into single-quoted PowerShell source, so a quote in a value broke parsing or ran as code. Bind them as step env values and read them from $env. The empty checks use -not so an unset variable counts as empty, as an empty string did before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Dispatch inputs now reach PowerShell through environment variables, avoiding direct interpolation while preserving empty-input test selection. The change is confined to the existing manual Windows test workflow and leaves permissions and infrastructure unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Test step input handling .github/workflows/windows-tests.yml |
The test step reads PACKAGE and FILES from environment variables. A falsy package runs the all-package test command; a truthy package with falsy files proceeds to the package-suite branch. |
Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Bug fix
Possibly related PRs
- pingdotgg/t3code#28753: It classifies the Windows test workflow for package-job selection.
Suggested reviewers: macroscopeapp
Merge Risk: 
Minimal · up to dc868
-
No actionable merge-blocking risk remains in this workflow change.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the bug, implementation, approval basis, test results, and untested Windows-runner behavior.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Problem
The manual Windows Tests workflow pasted its
packageandfilesinputs straight into single-quoted PowerShell source:GitHub substitutes the expression before PowerShell parses the script, so a quote in either value changes the script. A file name with an apostrophe (
src/it's.test.ts) fails with aParserErrorbefore any test runs, and a value such asx'; Write-Output INJECTED; 'runs as a command. This is a manualworkflow_dispatchworkflow, so it is a correctness bug in input handling rather than a public exploit.Change
envvalues (PACKAGE,FILES) and reads them with$env:, the same patternmobile-eas-production.ymluses for its dispatch inputs. PowerShell now gets the values as data.-not $package/-not $filesinstead of-eq '', so an empty input that arrives as an unset variable ($null) still counts as empty.$null -eq ''is false in PowerShell.Branching, the
$files.Split(' ')splitting, triggers, permissions, package selection and action refs are unchanged.Scope and approval
A small, focused fix for an obvious bug under CONTRIBUTING.md § Prior approval: a quote in a workflow input breaks or rewrites the Test step's script. It changes one step in one workflow and no product behavior, so no prior issue or discussion was opened. Our open #28749 pins action refs in this same file on other lines; the two do not overlap.
Verification
actionlint -ignore 'label "blacksmith-8vcpu-windows-2025" is unknown' .github/workflows/windows-tests.ymlwith actionlint 1.7.12: exit 0. Base gets the same result; unfiltered actionlint reports only the unknown runner label on both.Ran the Test step's
run:script from base and from this branch under PowerShell 7.6.9 (macOS arm64), modelling the runner'sshell: pwsh: expressions substituted into the script text andenv:values,$ErrorActionPreference = 'stop'and the$LASTEXITCODEexit check around it, thenpwsh -command ". '<file>'". A nativevpstub onPATHprinted each argument as[arg].vp [run] [--parallel] [--concurrency-limit] [4] [--filter] [!t3] [--filter] [!@t3tools/monorepo] [test]package=packages/shared, also with emptyFILESunsetvp [run] [--filter] [./packages/shared] [test]package=apps/server,files=src/process/externalLauncher.test.ts src/cli/theme.test.tsvp [test] [run] [src/process/externalLauncher.test.ts] [src/cli/theme.test.ts]inapps/serverfiles=src/it's.test.tsParserError: Unexpected token 's.test.ts', exit 1vp [test] [run] [src/it's.test.ts]files=x'; Write-Output INJECTED; 'INJECTED, thenvp [test] [run] [x]vp [test] [run] [x';] [Write-Output] [INJECTED;] [']files=$(Write-Output SUBEXPR) ; & | $env:PATHvp run check:changed 3fd2b855c5c6b9169cdfe3733b34011c1c5ed4b7: format, typecheck (39 packages) and the 1 selected test file pass.Not checked:
blacksmith-8vcpu-windows-2025runner, which a fork cannot use, so Windows-only behavior was not exercised: how the runner passes an emptyenvvalue, and Windows native argument passing tovp.Prior PRs
Generated with Claude Opus 5.5 and GPT-6.1 Terra and GPT-6.1 Sol in T3 Code Nightly