Scheduler preflight option

The preflight@scheduler option is processed by the scheduler during the scheduling of the tasks. The option allows recipes to indicate situations in which the task does not have to be executed, for example when an input precondition fails.

This option does not have to be defined in the checklet’s meta options as it is enabled by default for all checklets., but it can be defined to change the default preflight check for this checklet.

The expected format for the option value is:

preflight_option ::=  [ selector ] "=>" [ preflight_status | preflight_props ]
preflight_status ::=  text status message
preflight_props  ::=  "{" prop ":" value ( "," prop ":" value )* "}"
action           ::=  "run" | "pass" | "pass-secret" | "pass-hidden"
                      | "fail" | "fail-secret" | "fail-hidden" | "skip"
                      | "error" | "skip-error"

If a selector matches or is empty, a results bundle based on the action and status message is created (unless the action is run). If no selectors match, or a selector matches with action run, no result is created and the step should execute as normal.

Possible values for action are:

  • run: runs the checklet. When a run action is encountered, no further preflight options are processed.

  • pass, pass-secret, and pass-hidden: will return a pass outcome without running the checklet.

  • fail, fail-secret, and fail-hidden: will return a fail outcome without running the checklet.

  • skip and skip-error: will return a skip outcome without running the checklet.

  • error: will return an error outcome without running the checklet.

If a result is created, the properties will contain a preflight-trigger property with the selector that triggered the action, a source property with the name of this module. If status is provided and does not start with a {, a status property with the status message is added. If status starts with a {, it is parsed as a (json style) dictionary of properties and added to the result properties.

Some of the actions will add additional properties to the result:

The default preflight check is:

%any error => skip-error

This default check is always executed before any other preflight checks provided in the options unless an explicit preflight action for the error outcome exists. So, by default tasks are skipped if any of their dependencies result in an error, but this default behaviour can be overridden by providing an explicit rule with the error outcome.