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.
Merged branch from which publication is permitted.
proposal_branch: BranchNameMaintained release proposal branch.
commit_subject: CommitSubjectSubject 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: StringName of the credential that uploads packages and logs in to OCI registries.
Implementations§
Source§impl ReleaseState
impl ReleaseState
Sourcepub(crate) fn application_units(
&self,
units: &[Unit],
bump: ApplicationBump,
) -> BTreeSet<String>
pub(crate) fn application_units( &self, units: &[Unit], bump: ApplicationBump, ) -> BTreeSet<String>
Resolved application units configured with the given automatic bump.
Source§impl ReleaseState
impl ReleaseState
Sourcepub(crate) fn selected_units<G: GitHistory + GitRefs>(
&self,
repository: &RepositoryRoot,
commit: &str,
git: &G,
) -> Result<Vec<Unit>, PublicationError>
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.
Sourcepub(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>
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
impl ReleaseState
Sourcepub const fn commit_subject(&self) -> &CommitSubject
pub const fn commit_subject(&self) -> &CommitSubject
The subject template of the proposal commits.
Sourcepub fn cargo_registry(&self) -> Option<&str>
pub fn cargo_registry(&self) -> Option<&str>
The named Cargo registry to publish to, when one is configured.
Sourcepub fn cargo_registry_api_url(&self) -> Option<&str>
pub fn cargo_registry_api_url(&self) -> Option<&str>
The Cargo registry API base URL used to check published versions.
Sourcepub fn npm_registry(&self) -> Option<&str>
pub fn npm_registry(&self) -> Option<&str>
The npm registry base URL, when one is configured.
Sourcepub const fn account(&self) -> &Account<Expr>
pub const fn account(&self) -> &Account<Expr>
The expressions of the account the release acts as.
Sourcepub fn packages_credential(&self) -> &str
pub fn packages_credential(&self) -> &str
The name of the credential for package uploads and registry logins.
Sourcepub(crate) fn discover_units(
&self,
root: &RepositoryRoot,
) -> Result<Vec<Unit>, ResolveError>
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.
Sourcepub fn plan_local(
&self,
root: &RepositoryRoot,
release_id: &str,
target_version: &str,
date: &str,
) -> Result<LocalPlan, Error>
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.
Sourcepub fn branches(
&self,
requested_proposal: Option<&str>,
) -> Result<(AuthorityBranch, String), Error>
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
impl Clone for ReleaseState
Source§fn clone(&self) -> ReleaseState
fn clone(&self) -> ReleaseState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReleaseState
impl Debug for ReleaseState
impl Eq for ReleaseState
Source§impl<'ʄ> Facet<'ʄ> for ReleaseState
impl<'ʄ> Facet<'ʄ> for ReleaseState
Source§impl PartialEq for ReleaseState
impl PartialEq for ReleaseState
impl StructuralPartialEq for ReleaseState
Auto Trait Implementations§
impl Freeze for ReleaseState
impl RefUnwindSafe for ReleaseState
impl Send for ReleaseState
impl Sync for ReleaseState
impl Unpin for ReleaseState
impl UnsafeUnpin for ReleaseState
impl UnwindSafe for ReleaseState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.