pub struct Protection {Show 16 fields
pub trunk_ruleset: Option<String>,
pub safety_ruleset: Option<String>,
pub tag_ruleset: String,
pub lines_ruleset: String,
pub title_check: String,
pub tag_pattern: String,
pub bypass_actors: Vec<String>,
pub allowed_merge_methods: Vec<String>,
pub strict_required_status_checks: bool,
pub owned_trunk_rules: Vec<String>,
pub required_approving_review_count: i64,
pub dismiss_stale_reviews_on_push: bool,
pub require_code_owner_review: bool,
pub require_last_push_approval: bool,
pub github: Github,
pub gitlab: Gitlab,
}Expand description
The protection table.
Fields§
§trunk_ruleset: Option<String>N: trunk ruleset name. Absent derives <trunk>-protection, which
is the name the setup script built before the key existed, so a
target that states none keeps the ruleset it already has.
safety_ruleset: Option<String>N: safety ruleset name. Absent derives <trunk>-safety. This is the
ruleset that names no bypass actor, so the deletion and force-push
protections hold against every actor including the one the trunk
ruleset may excuse.
tag_ruleset: StringN: tag ruleset name.
lines_ruleset: StringN: release-line ruleset name.
title_check: StringN: title job context.
tag_pattern: StringF: invariant, covers every published version.
bypass_actors: Vec<String>F: invariant, the actors git.integration names. It excuses the
trunk ruleset alone; the safety ruleset names nobody.
allowed_merge_methods: Vec<String>F: invariant, exactly squash.
strict_required_status_checks: boolF: invariant, true.
owned_trunk_rules: Vec<String>F: invariant, the rules git.integration names. A landing writes
this key with the authority, and a target that narrowed or
widened it keeps what it stated.
required_approving_review_count: i64F: floor zero; higher is stricter.
dismiss_stale_reviews_on_push: boolF: floor false; true is stricter.
require_code_owner_review: boolF: floor false; true is stricter.
require_last_push_approval: boolF: floor false; true is stricter.
github: GithubGitHub policy.
gitlab: GitlabGitLab policy.
Implementations§
Source§impl Protection
impl Protection
Sourcepub fn trunk_ruleset(&self, trunk: &str) -> String
pub fn trunk_ruleset(&self, trunk: &str) -> String
The trunk ruleset’s name: the target’s own answer, or the name the setup script derived before the key existed.
Sourcepub fn safety_ruleset(&self, trunk: &str) -> String
pub fn safety_ruleset(&self, trunk: &str) -> String
The safety ruleset’s name: the target’s own answer, or the derived
<trunk>-safety.
A separate ruleset because a bypass actor is recorded on a ruleset and never on a rule. The deletion and force-push rules therefore cannot sit beside a bypassed rule without inheriting its excuse.
Trait Implementations§
Source§impl Clone for Protection
impl Clone for Protection
Source§impl Debug for Protection
impl Debug for Protection
Source§impl Default for Protection
impl Default for Protection
Source§impl<'de> Deserialize<'de> for Protectionwhere
Protection: Default,
impl<'de> Deserialize<'de> for Protectionwhere
Protection: Default,
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 Protection
Source§impl PartialEq for Protection
impl PartialEq for Protection
Source§impl Serialize for Protection
impl Serialize for Protection
impl StructuralPartialEq for Protection
Auto Trait Implementations§
impl Freeze for Protection
impl RefUnwindSafe for Protection
impl Send for Protection
impl Sync for Protection
impl Unpin for Protection
impl UnsafeUnpin for Protection
impl UnwindSafe for Protection
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<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§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.