compute_change_status

Function compute_change_status 

Source
pub fn compute_change_status(
    ito_path: &Path,
    change: &str,
    schema_name: Option<&str>,
    ctx: &ConfigContext,
) -> Result<ChangeStatus, TemplatesError>
Expand description

Compute the workflow status for every artifact in a change.

Validates the change name, resolves the effective schema (explicit or from the change metadata), verifies the change directory exists, and produces per-artifact statuses plus the list of artifacts required before an apply operation.

§Parameters

  • ito_path: base repository path containing the .ito state directories.
  • change: change directory name to inspect (must be a validated change name).
  • schema_name: optional explicit schema name; when None, the change’s metadata is consulted.
  • ctx: configuration/context used to locate and load schemas.

§Returns

ChangeStatus describing the change name, resolved schema, overall completion flag, the set of artifact ids required for apply, and a list of ArtifactStatus entries where each artifact is labeled done, ready, or blocked and includes any missing dependency ids.

§Errors

Returns a WorkflowError when the change name is invalid, the change directory is missing, or the schema cannot be resolved or loaded.

§Examples

let ctx = ConfigContext::default();
let status = compute_change_status(Path::new("."), "my-change", None, &ctx).unwrap();
assert_eq!(status.change_name, "my-change");