pub struct RepositoryEnvironment {Show 14 fields
pub schema: String,
pub generated_at: String,
pub resolution: Resolution,
pub project: ProjectIdentity,
pub repository: RepositoryIdentity,
pub vcs: VcsState,
pub toolchains: Vec<ToolchainState>,
pub layer: LayerSummary,
pub workflows: WorkflowCatalogue,
pub providers: Vec<ProviderState>,
pub services: Vec<ServiceState>,
pub reasoning: Option<ReasoningSummary>,
pub diagnostics: Vec<Diagnostic>,
pub provenance: Vec<FieldSource>,
}Expand description
The snapshot: what this checkout is, right now.
Every surface that reports any of this renders this value. Collections are in a
documented, stable order — kinds and workflows by name, services and providers in the
order their canonical source declares them, diagnostics in the order they were found —
so that two snapshots of the same repository serialise identically apart from
RepositoryEnvironment::generated_at.
Fields§
§schema: StringThe contract this document follows, majordomus/repository-environment/v1.
generated_at: StringWhen it was taken, RFC 3339 in UTC.
resolution: ResolutionHow completely it was resolved.
project: ProjectIdentityWhat the project is.
repository: RepositoryIdentityWhat the checkout is.
vcs: VcsStateWhat version control says.
toolchains: Vec<ToolchainState>The toolchains the repository declares, sorted by id.
layer: LayerSummaryWhat the layer holds.
workflows: WorkflowCatalogueThe workflows a person can run.
providers: Vec<ProviderState>The provider projections the policy declares, in the policy’s order.
services: Vec<ServiceState>The local services, in the order the service table declares them.
reasoning: Option<ReasoningSummary>Reasoning (ADR 0098): operational whatever the advisors, the mode in force, and how many optional advisors can be asked. Absent when the distribution declares none.
diagnostics: Vec<Diagnostic>Everything that went wrong or is worth knowing, in the order it was found.
provenance: Vec<FieldSource>Where every field came from.
Implementations§
Source§impl RepositoryEnvironment
impl RepositoryEnvironment
Sourcepub fn explain(&self, field: &str) -> Option<&FieldSource>
pub fn explain(&self, field: &str) -> Option<&FieldSource>
The provenance of one field, by its dotted name.
use majordomus_cli::environment::{FieldSource, RepositoryEnvironment};
let _ = env.explain("project.version");Sourcepub fn digest(&self) -> String
pub fn digest(&self) -> String
A digest of everything a reader would notice, excluding the moment it was taken. Two snapshots with the same digest say the same thing, which is how the banner decides whether a person has already seen this.
Sourcepub fn news_digest(&self) -> String
pub fn news_digest(&self) -> String
The digest that decides whether a banner is news: Self::digest without the
services.
The entry file watches the server’s lease, so a server coming up re-evaluates entry twice more — once when it claims the lease, once when it publishes its address — and a digest that counted the services made each of those a first look, drawing the whole box again at a person who had just seen it. A server arriving or leaving is not a different repository; the short form names the Cockpit when it answers.
use majordomus_cli::environment::RepositoryEnvironment;
// a server arriving or leaving is not a different repository, so clearing the
// services changes nothing this digest can see
let mut without = env.clone();
without.services.clear();
assert_eq!(env.news_digest(), without.news_digest());
// and with no services left, the two digests are the same value
assert_eq!(without.news_digest(), without.digest());Sourcepub fn service(&self, id: &str) -> Option<&ServiceState>
pub fn service(&self, id: &str) -> Option<&ServiceState>
The service with this id.
Sourcepub fn headline_diagnostic(&self) -> Option<&Diagnostic>
pub fn headline_diagnostic(&self) -> Option<&Diagnostic>
The worst thing in the snapshot worth telling a person about, when there is one.
Trait Implementations§
Source§impl Clone for RepositoryEnvironment
impl Clone for RepositoryEnvironment
Source§fn clone(&self) -> RepositoryEnvironment
fn clone(&self) -> RepositoryEnvironment
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 RepositoryEnvironment
impl Debug for RepositoryEnvironment
Source§impl<'de> Deserialize<'de> for RepositoryEnvironment
impl<'de> Deserialize<'de> for RepositoryEnvironment
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 RepositoryEnvironment
Source§impl JsonSchema for RepositoryEnvironment
impl JsonSchema for RepositoryEnvironment
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for RepositoryEnvironment
impl PartialEq for RepositoryEnvironment
Source§fn eq(&self, other: &RepositoryEnvironment) -> bool
fn eq(&self, other: &RepositoryEnvironment) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for RepositoryEnvironment
impl Serialize for RepositoryEnvironment
impl StructuralPartialEq for RepositoryEnvironment
Auto Trait Implementations§
impl Freeze for RepositoryEnvironment
impl RefUnwindSafe for RepositoryEnvironment
impl Send for RepositoryEnvironment
impl Sync for RepositoryEnvironment
impl Unpin for RepositoryEnvironment
impl UnsafeUnpin for RepositoryEnvironment
impl UnwindSafe for RepositoryEnvironment
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>,
§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.