Skip to main content

Module task_config

Module task_config 

Source
Expand description

Task configuration file format — .oo/tasks.yaml.

Defines the types, parser, and validator for user-defined task definitions. Each task is a named unit of execution that can be a shell command, an ordered sequence, or an unordered parallel composition of other tasks.

§File format

version: 1

tasks:
  build:
    type: shell
    queue: build
    command: "cargo build --{mode}"
    inputs:
      mode:
        type: select
        options: [debug, release]
        default: debug

  check:
    type: parallel
    steps:
      - build
      - lint

§Validation

parse_str and load both run a post-parse validation pass that checks:

  • version == 1
  • All step references point to existing tasks
  • Step input-overrides reference declared inputs on the target task
  • Shell command {placeholder} interpolations match declared inputs
  • select inputs declare a non-empty options list; default must be one of the options
  • text / number validation bounds are consistent; regex patterns compile
  • No cyclic dependencies in the task graph

Structs§

CompositeTaskDef
Shared structure for sequence and parallel tasks.
ConfigError
A validation error produced while loading or validating a tasks.yaml.
InputDef
Declaration of a single parameterisable input.
ShellTaskDef
A task that runs a shell command.
TasksFile
Parsed and validated contents of a tasks.yaml file.
UiMeta
Optional human-readable display information for a task.
ValidationRules
Validation constraints for an input.

Enums§

CancelPolicy
When a new task is scheduled on the same queue, how to handle the current one.
InputType
Data type of a task input.
InputValue
A runtime-configurable input value for a task.
StepRef
A reference to a task inside a steps list.
TaskDef
A single task definition. The type field selects the variant.

Functions§

load
Load and validate tasks.yaml from the given path.
parse_str
Parse and validate a YAML string containing task configuration.