Skip to main content

ReleaseState

Struct ReleaseState 

Source
pub struct ReleaseState {
    pub(crate) cargo: Option<CargoReleaseState>,
    pub(crate) npm: Option<NpmReleaseState>,
    pub(crate) authoritative_branch: BranchName,
    pub(crate) proposal_branch: BranchName,
    pub(crate) commit_subject: CommitSubject,
    pub(crate) commit_format: Option<CommitFormat>,
    pub(crate) units: BTreeMap<String, ReleaseUnitState>,
    pub(crate) artifacts: BTreeMap<String, BTreeMap<String, ReleaseArtifactState>>,
    pub(crate) account: Account<Expr>,
    pub(crate) packages_credential: String,
}
Expand description

Evaluated release policy. This component can be decoded on its own.

Fields§

§cargo: Option<CargoReleaseState>

Cargo registry settings, when Cargo units publish.

§npm: Option<NpmReleaseState>

npm registry settings, when npm units publish.

§authoritative_branch: BranchName

Merged branch from which publication is permitted.

§proposal_branch: BranchName

Maintained release proposal branch.

§commit_subject: CommitSubject

Subject template of the proposal commits.

§commit_format: Option<CommitFormat>

Format of the commit messages that bumps and changelog entries are derived from.

§units: BTreeMap<String, ReleaseUnitState>

Release units by ID.

§artifacts: BTreeMap<String, BTreeMap<String, ReleaseArtifactState>>

Publication artifacts by unit ID, then artifact name.

§account: Account<Expr>

Who commits, tags and logs in to registries.

§packages_credential: String

Name of the credential that uploads packages and logs in to OCI registries.

Implementations§

Source§

impl ReleaseState

Source

pub(crate) fn application_units( &self, units: &[Unit], bump: ApplicationBump, ) -> BTreeSet<String>

Resolved application units configured with the given automatic bump.

Source§

impl ReleaseState

Source

pub(crate) fn selected_units<G: GitHistory + GitRefs>( &self, repository: &RepositoryRoot, commit: &str, git: &G, ) -> Result<Vec<Unit>, PublicationError>

Select the configured units this run publishes or resumes.

§Errors

Returns an error for invalid release state, git failures, or malformed versions.

Source

pub(crate) fn stage_releases<'a>( &'a self, repository: &RepositoryRoot, commit: &str, units: Vec<Unit>, artifacts: Option<&Stage>, login: Option<&OciLogin>, ) -> Result<Vec<UnitRelease<'a>>, PublicationError>

Stage the forge release of every selected unit, checking every local file before anything is created.

§Errors

Returns an error for invalid artifact configuration, a zero revision, a unit with artifacts but no artifacts, or staged files that do not match, or an OCI artifact has no login.

Source§

impl ReleaseState

Source

pub const fn commit_subject(&self) -> &CommitSubject

The subject template of the proposal commits.

Source

pub fn cargo_registry(&self) -> Option<&str>

The named Cargo registry to publish to, when one is configured.

Source

pub fn cargo_registry_api_url(&self) -> Option<&str>

The Cargo registry API base URL used to check published versions.

Source

pub fn npm_registry(&self) -> Option<&str>

The npm registry base URL, when one is configured.

Source

pub const fn account(&self) -> &Account<Expr>

The expressions of the account the release acts as.

Source

pub fn packages_credential(&self) -> &str

The name of the credential for package uploads and registry logins.

Source

pub(crate) fn discover_units( &self, root: &RepositoryRoot, ) -> Result<Vec<Unit>, ResolveError>

Resolve configured release targets into graph units.

§Errors

Returns an error when a configured unit cannot be resolved.

Source

pub fn plan_local( &self, root: &RepositoryRoot, release_id: &str, target_version: &str, date: &str, ) -> Result<LocalPlan, Error>

Validate one configured unit’s local release plan for Check, Diff, or Apply.

§Errors

Returns errors for unknown units, invalid or non-increasing versions, unsafe paths, and invalid target plans.

Source

pub fn branches( &self, requested_proposal: Option<&str>, ) -> Result<(AuthorityBranch, String), Error>

The authoritative branch and the proposal branch, checking an explicit proposal branch against the evaluated release policy.

§Errors

Returns an error when the explicit proposal branch conflicts with the configured one.

Trait Implementations§

Source§

impl Clone for ReleaseState

Source§

fn clone(&self) -> ReleaseState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReleaseState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ReleaseState

Source§

impl<'ʄ> Facet<'ʄ> for ReleaseState

Source§

const SHAPE: &'static Shape

The shape of this type, including: whether it’s a Struct, an Enum, something else? Read more
Source§

impl PartialEq for ReleaseState

Source§

fn eq(&self, other: &ReleaseState) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ReleaseState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more