Skip to main content

Basis

Enum Basis 

Source
pub enum Basis {
    OwnerLanded {
        owner: String,
    },
    OwnerApproved {
        owner: String,
    },
    ApprovalWeight {
        required: u32,
        met: u32,
    },
}
Expand description

The rule that admitted a landing, as the evaluation that admitted it computed it (D43).

Three variants because there are three ways a protected-ref landing is currently allowed, and an approver list alone distinguishes none of them: under D42 a landing can be authorized with zero approvals, so an empty list would equally mean “an owner landed it” and “the policy required nobody”.

There is deliberately no variant for an ungated ref. A Submit whose ref is unprotected, or whose node is not running the review gate, is refused rather than recorded — see OpKind::Submit. The record therefore means exactly one thing, and cannot be used to dress an unexamined ref move as an authorized one.

Where a variant names a principal it names it in the namespace the rule actually read. The ownership rule reads the ACL’s subject column, which holds usernames and has no actor id to offer, so owner is a username. Recording the rule’s real input beats recording a prettier identity the rule never saw.

Variants§

§

OwnerLanded

owner holds own on the repository and performed the landing themselves (D42). Performing the landing is assent, which is why no approval is recorded.

Fields

§owner: String

The ACL subject the node resolved the acting identity to.

§

OwnerApproved

owner holds own on the repository and approved a review naming this exact (ref, commit) pair (D42).

Fields

§owner: String

The approving owner’s reviewer channel, which is also its ACL subject. The fold checks it against the review’s standing approvals; it cannot check the grant, which lives in a file.

§

ApprovalWeight

No owner is granted on the repository, so the weight rule applied and was met.

Fields

§required: u32

The threshold in force when the landing was admitted.

This is the part of the “the rule itself is not pinned” residual that could be closed cheaply: for this basis an auditor no longer has to reconstruct the threshold from operator-side config history. The ACL grants behind the two owner variants stay unpinned, and still need a tripwire rather than taste.

§met: u32

The review’s approval weight at admission.

Trait Implementations§

Source§

impl Clone for Basis

Source§

fn clone(&self) -> Basis

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 Basis

Source§

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

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

impl<'de> Deserialize<'de> for Basis

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Basis

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Basis

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Basis

Source§

impl StructuralPartialEq for Basis

Auto Trait Implementations§

§

impl Freeze for Basis

§

impl RefUnwindSafe for Basis

§

impl Send for Basis

§

impl Sync for Basis

§

impl Unpin for Basis

§

impl UnsafeUnpin for Basis

§

impl UnwindSafe for Basis

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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 = Infallible

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,