Expand description
Workflow version management and diffing.
WorkflowVersion represents a named snapshot of a workflow’s serialised
data string (e.g. a JSON or YAML definition). Two versions can be compared
with WorkflowVersion::diff which returns a line-level diff as a
Vec<String> in unified diff style (lines prefixed with + or -).
§Design
- Versions are identified by a numeric
id(e.g. a monotonically increasing revision number or a timestamp). - The
datafield holds the full serialised workflow as aString. WorkflowVersion::diffcomparesselfagainstotherline by line, returning lines that appear only inself(prefixed+) or only inother(prefixed-).
§Example
use oximedia_workflow::versioning::WorkflowVersion;
let v1 = WorkflowVersion::new(1, "step: ingest\nstep: transcode\n");
let v2 = WorkflowVersion::new(2, "step: ingest\nstep: upload\n");
let diff = v1.diff(&v2);
assert!(diff.iter().any(|l| l.starts_with('+')));
assert!(diff.iter().any(|l| l.starts_with('-')));Structs§
- Version
Summary - Compact statistics for a
WorkflowVersion. - Workflow
Version - A versioned snapshot of a workflow’s serialised definition.
- Workflow
Version Registry - An ordered registry of workflow versions, supporting diff and history queries.