pub enum DraftReason {
AwaitingRelease {
awaiting: String,
target: TargetName,
reference: String,
because: String,
},
Held {
because: String,
},
}Expand description
Why a change request is a draft, in the shape a machine reads it.
A draft is a change request that must not land yet, and there are two reasons one
is held. A change that has gone as far as it can and stopped short of the one step
that would make something temporary permanent — a dependency pinned to a branch
rather than to a release — is AwaitingRelease,
and what it is waiting for is the whole of the reason: which repository, which of
that repository’s release targets, and the reference the change is pinned to in
the meantime. A change whose work is still being made — evidence gathered, a
description started — is Held by the session that opened
it, and the one line a person reads is the whole of that reason. The kind tag
is what a consumer routes on; because is the same fact as a sentence, for
whoever reads it rather than routes on it.
It is recorded on the session’s own event stream — the publication record — and nowhere else. Nothing is written into the change request’s body, under a marker heading or anywhere: a body is prose a reviewer reads and a drafting caller may rewrite, and deciding a control action from it would turn an editorial act into one. The cost of that is carried openly: somebody looking at the draft change request without access to this host sees that it is a draft and not why.
Variants§
AwaitingRelease
A change pinned to a dependency’s branch until that dependency releases — what a fast-adoption publication carries.
Fields
awaiting: StringThe repository identity whose release is awaited, as the registry keys one.
A String rather than a newtype because an identity key is one everywhere
this crate spells one — Identity::origin, Recoverable::identity, the
registry document’s own map key — so a narrower type here would disagree
with every type it is compared against. What must not be representable is
a value that renders as something other than itself in a refusal or an
event payload, and checked refuses exactly that at every boundary one
arrives at.
target: TargetNameWhich release target of it is awaited.
reference: StringThe reference this change is pinned to until that release arrives — the branch of the awaited repository the pin names.
A String for the reason awaiting above is, and one more of its own:
this is the awaited repository’s branch name rather than one this
repository’s git could be asked about, so the parser that would decide it
is not this host’s. checked refuses the values that would render as
something else.
Held
A change request the session that opened it is holding open as a draft while
its work is still being made: evidence gathered, description started. Lifted
by onevcs change ready, or taken by a later publication of the same session
carrying no reason into the draft lifecycle — which keeps it a draft when green
on a change-open identity whose approvals are required.
Implementations§
Source§impl DraftReason
impl DraftReason
Sourcepub fn checked(&self) -> Result<()>
pub fn checked(&self) -> Result<()>
The rule a publication holds a reason to, or the refusal that this is not one.
Every field here is printed: into a refusal, into an event payload a consumer
reads back, and — through --draft — at a host. So the check is the one that
decides whether a value renders as itself: nothing empty, and nothing carrying
a control character, which is what turns one line of a record into two.
Public for the reason MergePolicy::narrow and FailureKind::of are: it
belongs to publication rather than to any one implementation of it, so a
supplied Vcs applies this rule at its own boundary rather
than a restatement of it that could accept what the real one refuses. It is a
method rather than a conversion because the contract fixes the fields as
public and settable, so there is no constructor for a check to live in.
§Errors
Error::Invalid naming the field that would not render as itself.
Trait Implementations§
Source§impl Clone for DraftReason
impl Clone for DraftReason
Source§impl Debug for DraftReason
impl Debug for DraftReason
Source§impl<'de> Deserialize<'de> for DraftReason
impl<'de> Deserialize<'de> for DraftReason
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for DraftReason
Source§impl PartialEq for DraftReason
impl PartialEq for DraftReason
Source§impl Serialize for DraftReason
impl Serialize for DraftReason
impl StructuralPartialEq for DraftReason
Auto Trait Implementations§
impl Freeze for DraftReason
impl RefUnwindSafe for DraftReason
impl Send for DraftReason
impl Sync for DraftReason
impl Unpin for DraftReason
impl UnsafeUnpin for DraftReason
impl UnwindSafe for DraftReason
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.