You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CI inference: a script reached twice through package.json (a diamond) is reported as a script cycle #187
resolveScript (src/ci-inference/resolve.ts) passes one seen set to every nested call, so it records every script visited anywhere in the tree, not just the current chain of ancestors. A script reached through two different branches, a diamond, is then reported as UNRESOLVABLE: script cycle through <name> even though there is no cycle.
Repro
{ "scripts": { "ci": "npm run build && npm run test", "test": "npm run build && jest", "build": "tsc" } }
ci: UNRESOLVED depends on 2 unresolved reference(s)
test: UNRESOLVED depends on 1 unresolved reference(s)
build: UNRESOLVABLE script cycle through build
Through inferPipeline, with a committed lockfile and steps npm ci then npm run ci, the npm run ci operation is executable: false on main and true with the fix. SCRIPTS_RESOLVED fails on the phantom cycle.
Impact
This is a false refusal for a common package.json shape: a top-level ci or test script that builds first, while a nested script also builds. The operation and its purpose path are reported not executable, and the receipt blames a cycle that does not exist.
Failing test
tests/ci-inference/script-diamond.test.ts in the linked PR. Output on main:
✖ a script reached through two branches is not a cycle
... {"identifier":"build","resolution":"UNRESOLVABLE", ... "reason":"script cycle through build"}
actual: 'UNRESOLVED',
expected: 'RESOLVED',
✔ a real cycle is still unresolvable
Activity
fix(ci-inference): only an ancestor script makes a cycle (DiffCI#188)