Skip to main content

Module versioning

Module versioning 

Source
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 data field holds the full serialised workflow as a String.
  • WorkflowVersion::diff compares self against other line by line, returning lines that appear only in self (prefixed +) or only in other (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§

VersionSummary
Compact statistics for a WorkflowVersion.
WorkflowVersion
A versioned snapshot of a workflow’s serialised definition.
WorkflowVersionRegistry
An ordered registry of workflow versions, supporting diff and history queries.