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: run lines with quotes, \ continuations, VAR=value, comments or globs get a wrong but executable argv #180
argvOf (src/ci-inference/infer.ts) turns a workflow run: line into an operation's command. It refuses lines with | & ; < > $ \ ( ) { }; everything else it splits on whitespace. schema.tsdocumentscommandas "argv, never a shell string, so it cannot be re-split differently later", but for ordinary shell syntax the argv is not whatsh` would pass. The operation is still marked executable with that wrong argv.
Repro with one workflow.step.run fact through inferPipeline on main (40aa308):
These are TEST operations reported executionRepresentation: RESOLVED and executable: true. A consumer that executes command runs something different from CI. It may pass literal quote characters to the runner, run CI=true as the program, or pass #, every, test as test patterns. The pipeline still counts as complete and optimisable. The engine's stated rule is that a command it cannot represent faithfully must be UNRESOLVED, not approximated.
Failing test
tests/ci-inference/argv.test.ts in the linked PR. Output on main:
✖ quotes are removed the way sh removes them
+ actual - expected
+ '"user',
+ 'login"'
- 'user login'
✖ shell syntax the splitter does not reproduce leaves the test step without argv
+ actual - expected
+ [ 'npx', 'jest', '--ci', '\\' ]
- []
✔ plain words are still split as before
Activity
fix(ci-inference): split run lines into argv the way sh would (DiffCI…