xtask 0.4.0
xtask: ^0.4.0 copied to clipboard
A task runner whose tasks are data. The graph lives in xtask.yaml; a job body is either an external process (argv, never a shell) or a verb the project implements in Dart.
Changelog #
0.4.0 #
Added #
--only <set>=<pattern>,…narrows a set for one run: everyeach:andall:in the plan that names it gets only the members a pattern matches, and--dry-runtakes it too. A set the file has not got, a set nothing in the plan expands, and a pattern matching no member are each a2. The summary saysover 2 of 17 members, and--check-cireports a step that runs a gate set narrowed.alone: true: under-jthe run waits for what it has started, runs the task, and starts nothing else until it has ended.--validaterefuses it besideexclusive:,serial:orinterruptible:, and on a task with no body.- For verbs:
context.tee(argv, workingDirectory:, timeout:), which iscapturewith the output shown as it arrives. A hand-builtVerbContextgives it throughrelay:. - For verbs:
context.file(path)andcontext.directory(path), a path from the repository root written with/, ending the task with2when it climbs out of the root or leads out through a link. --completion bash|zsh|fishprints a completion script, which reads task, gate set and set names from--nameswhen TAB is pressed.- A name that is not a task is answered with the near ones —
did you mean `check`?— or withxtask --list.
Fixed #
- An argument holding
%is refused for a batch file, as&and^are:cmd.exeexpands%VAR%on the command line before the file sees it. context.outhands on a line written with\r\nwithout its\r.
0.3.0 #
Breaking #
VerbContextrequiresroot:and is no longerconst. Only code that builds a context itself — a verb's tests — is affected.ExitCode.continuationNoticeis replaced by the top-levelcontinuationNotice(body:, continuation:).
Added #
--check-schema <path>answers 2 when a committed schema is not the one this engine emits.--check-cinames the tasks in a gate set that no job reaches.- For verbs:
context.root;context.capture(argv, workingDirectory:, timeout:), which starts a program ascontext.rundoes and returns its exit code and output;context.which(name, workingDirectory:); andcontext.out, aStringSinkoverlog.
Changed #
- A failed
then:names the task that finished and the continuation that failed, instead of always saying "the upload took place".
Fixed #
--check-cireadsdefaults: run: working-directory:on the job and the workflow. It reports a${{ … }}working directory instead of reading it as the root, and a${{ … }}continue-on-error:instead of reading it as false.- A blank name (
" ") is refused like an empty one. - The schema refuses what the parser refuses:
all:witheach:,timeout:orinterruptible: truewithoutrun:, a blank entry inneeds:,then:,gate:orexclusive:, and a blankdo:. - The README described
context.workingDirectoryas the repository root. It is where the task runs; a set's members are relative tocontext.root.
0.2.0 #
Breaking #
- Gate sets are declared with
gates: [...]and joined withgate: [...].collects:is gone. argv-from:isall:, and$allgoes where it is written.--parallelis-j <n>;-j autois the processor count, at most 8.- An absolute path, or one through
.., is refused inin:, a set member and aremoveargument. - A name containing a line break is refused.
removelists each path once, sorted.
Added #
values:sets,produced-by:on glob sets,$eachin arguments,exclusive:,interruptible:andserial:.- For verbs:
context.memberandcontext.run(argv, workingDirectory:).
Fixed #
- Seven paths that ended the process at 255 answer a documented code.
do: removerefuses its own directory ('',.,./) and deletes relative to where the task runs, not the root.x needs y,y then z,z needs xis no longer refused as a cycle.--check-cireads a step with the command line's own parser instead of guessing at shell. A step under anotherxtask.yamlor withcontinue-on-error: truedoes not count; a multi-line script, a${{ … }}expression and xtask outside command position are reported; the# xtask: not a gate — reasonmarker requires the reason;xtask.exeand.\xtaskare recognised.{lib,}is refused instead of crashing at match time.- A closed stdout (
| head -1) no longer ends the run. - The exit code no longer depends on scheduling.
--dry-runprints the resolved argv, directory andremovepaths.--validaterefuses everything a run would.- Every contradiction in a task is reported in one refusal.
- A repository-relative program is resolved from where the body runs.
- A set is read when its task is about to run, not at planning.
- YAML aliases, merge keys and invisible whitespace in an indent are refused.
- A killed task no longer leaves the run waiting on a grandchild.
Performance #
- Planning is linear in a chain's length, a glob prunes the walk, and a
removeof several patterns reads the tree once.
0.1.0 #
First release.
xtask.yamland--validate, with errors that name the line.- The graph:
needs,then, cycle detection, run-once, declared order, and five exit codes. - Bodies:
runas argv,dofor a verb the project registers,args,argv-from,each,in,env. Executables are resolved throughPATHandPATHEXT, and Windows batch shims are handled. env-required, checked before a body runs.- Sets: lists and globs with exclusions, in a deterministic order. A set that expands to nothing is an error.
- Gate sets through
collects:,--list,--gate-members, and folded log sections on a host that supports them. - The built-in
removeverb. --dry-run,--emit-schema,--why,--check-ci,--keep-goingand--parallel.- Per-task timings, printed after the last section.