Repository navigation
Conversation
resolveScript shared one seen set across sibling branches, so a script reached twice (ci runs build and test, test runs build) was reported as a cycle and the step was left not executable. Each nested call now gets its own copy of its ancestors. Fixes DiffCI#187 Signed-off-by: FredApps <[email protected]>
resolveScript found nested scripts with a regex that took the word after a bare yarn or pnpm as a script name, so yarn install, pnpm add, yarn why and flags such as -r or -s became missing scripts. Each nested call is now read with packageManagerCommand, the grammar the top-level step already uses. Fixes DiffCI#197 Signed-off-by: FredApps <[email protected]>
…verbs Each nested resolveScript call now gets a copy of its ancestors, as in DiffCI#188. A script reached twice through different branches is not a cycle. Without this copy, merging this branch after DiffCI#188 would bring that bug back. Signed-off-by: FredApps <[email protected]>
FredApps
left a comment
There was a problem hiding this comment.
Cross-review (Yandere-san). Head 166d94b (includes my follow-up).
Checked: nestedScriptNames uses packageManagerCommand, so yarn install, pnpm add, builtins and flags (-r, -s, npm run -s) are not treated as script names. The original three tests fail on main and pass here.
This loop is the same one #188 changes. On 374b04a, #188's diamond test still failed (script cycle through build). I pushed 166d94b: each nested call now gets new Set(seen), plus a diamond test, so this branch no longer undoes #188 if it merges second. tests/ci-inference/*.test.ts pass locally after that (80). Hosted CI is re-running on 166d94b.
Nothing further open.
|
CI follow-up: 166d94b is green (12 success, change-impact neutral on the fork). |
…n either order Both change the nested-script loop in resolveScript; this PR already carried DiffCI#188's fix (each nested call gets new Set(seen)). Merging DiffCI#188 in adds its diamond test and lets GitHub merge DiffCI#188 and this PR in either order, or this PR alone. Signed-off-by: FredApps <[email protected]>
|
Thanks for this one. #188 is now in Could you merge For later PRs that include other PRs (for example #258 with #232, #248, #250 and #254), I'll merge the combined PR by itself so this doesn't happen again. |
…nes (#198) yarn install, pnpm install and flags before a script name inside a package.json script were read as nested script names and left the command unresolved. Nested calls now go through the same parser as top-level ones. Fixes #197. Signed-off-by: FredApps <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fixes #197
Changed behavior
resolveScriptnow finds eachnpm run,yarnorpnpmcall in a script body and reads it up to the next shell separator withpackageManagerCommand, the same grammarinfer.tsuses for top-level steps:install,i,add,ci, …) and a bareyarnare installs, not script references;why,exec,dlx, …) are not script references;pnpm -r buildandnpm run -s buildreferencebuild.A missing nested script is still
UNRESOLVED.Validation
tests/ci-inference/script-pm-verbs.test.tsis new and added torelease-files.json. All three tests fail onmain; the output is in CI inference: yarn install, pnpm install and flags inside a package.json script are read as script names #197.npm run typecheck,npm test(1170 pass, 0 fail),npm run build,npm run audit:boundary.Unsupported cases
yarn <bin>(for exampleyarn tsc) is still read as a script reference and is unresolved when no such script exists. Top-level steps behave the same way.npm test/npm startinside a script are still not followed, as before.Includes #188. Both change the nested-script loop in
resolveScript, and this PR already carried #188's fix (each nested call getsnew Set(seen)). This branch merges #188 in, which adds its diamond test, so #188 and this PR merge in either order, or this PR alone (GitHub then marks #188 as merged).