Skip to main content

analyze

Function analyze 

Source
pub fn analyze(
    root: &Path,
    registry: &CapabilityRegistry,
    objects: &[Object],
    since: Option<&str>,
) -> Result<VersionPlan, SurfaceError>
Expand description

The one analysis. Everything that answers a version question calls this.

use majordomus_cli::capability::registry::CapabilityRegistry;
use majordomus_cli::release::compat::analyze;

let registry = CapabilityRegistry::builder().build().expect("an empty registry composes");
let dir = tempfile::tempdir().unwrap();
// A repository that has published nothing has no baseline, and the analysis refuses
// rather than reporting an empty diff — which would read as "nothing changed".
assert!(analyze(dir.path(), &registry, &[], None).is_err());