Skip to main content

validate_change

Function validate_change 

Source
pub fn validate_change(
    change_repo: &(impl DomainChangeRepository + ?Sized),
    ito_path: &Path,
    change_id: &str,
    strict: bool,
) -> CoreResult<ValidationReport>
Expand description

Validate a change and produce a ValidationReport describing any issues found.

The function resolves the change’s schema (when available) and runs schema-driven validation if the schema provides a validation.yaml. For legacy delta-driven schemas or when schema resolution/validation is unavailable it falls back to delta-specs and tasks-tracking validations. The strict flag influences severity handling and the report’s final valid value.

§Returns

A ValidationReport summarizing all discovered issues and an aggregate summary, wrapped in CoreResult. The error variant is used for IO or repository access failures that prevent performing the validations.

§Examples

use std::path::Path;
// let change_repo = ...; // impl DomainChangeRepository
// let report = validate_change(&change_repo, Path::new("/path/to/ito"), "change-123", true).unwrap();
// println!("Valid: {}", report.valid);