pub struct Selection {
pub plan: Result<VersionPlan, String>,
pub report: VersionReport,
}Expand description
The release selection: the contract’s analysis against the last release, and the version report decided from it — made once, by one function.
release version (the capability, and every surface that renders it) and release bump
without an explicit target both take their answer from here, so the report and the writer
cannot disagree about what the next version is: the report’s next is the version the
writer raises to (default_target).
use majordomus_cli::capability::registry::CapabilityRegistry;
use majordomus_cli::release::model::DecidedBy;
use majordomus_cli::release::version::{select, Selection};
let dir = tempfile::tempdir().unwrap();
let registry = CapabilityRegistry::builder().build().unwrap();
let selection: Selection = select(dir.path(), ®istry, &[]);
// nothing published: no plan, and so a report that decides nothing — with the same reason
let why = selection.plan.as_ref().unwrap_err();
assert_eq!(selection.report.decided_by, DecidedBy::Undecided);
assert_eq!(selection.report.contract_unreadable.as_ref(), Some(why));
assert_eq!(selection.report.next, None);Fields§
§plan: Result<VersionPlan, String>The analysis release analyze makes against the last release, or why it could not be
made at all (no release to compare with, a baseline whose registry is not committed).
report: VersionReportThe version report decided from that analysis.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Selection
impl RefUnwindSafe for Selection
impl Send for Selection
impl Sync for Selection
impl Unpin for Selection
impl UnsafeUnpin for Selection
impl UnwindSafe for Selection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more