Skip to main content

Config

Struct Config 

Source
#[non_exhaustive]
pub struct Config {
Show 19 fields pub drivers: BTreeMap<String, DriverSpec>, pub packages: Vec<PackageSpec>, pub owners: Option<Vec<String>>, pub trusted_publishing_only: bool, pub release_workflow: String, pub release_checks: Vec<ReleaseCheck>, pub publishers: BTreeMap<String, PublisherSpec>, pub runners: BTreeMap<String, Runner>, pub assets: Option<Assets>, pub packslip: Option<Packslip>, pub vendored: BTreeMap<String, Vendored>, pub ci: BTreeMap<String, Job>, pub prepare: Prepare, pub proposal: Proposal, pub changelog: Changelog, pub templates: Templates, pub tags: Tags, pub patterns: BTreeMap<String, PinPattern>, pub pins: Vec<Pin>,
}
Expand description

The whole file, and the context every rule in it is checked against. A pattern is only unused, and an id only unknown, relative to the rest of the config. Config::parse reads the shape with serde and then validates it once, here, so a complaint names the field that has to change.

A section verctl does not know stops the load instead of being dropped. Ignoring pattern: for patterns: would ship a release with the pins it declares never rewritten.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§drivers: BTreeMap<String, DriverSpec>

Custom drivers by name. A stock name (cargo, npm, pyproject, go, version) is overridden field by field.

§packages: Vec<PackageSpec>

What this repo releases. Omit only when the repo declares vendored; a config with neither has nothing to do.

§owners: Option<Vec<String>>

The crates.io logins every package’s crates must list as owners, which check registry proves. A package’s own owners replaces it. When omitted here and on a package, that package has no owner proof.

§trusted_publishing_only: bool

Whether crates.io crates must disable API-token publishing (trustpub_only = true). Defaults to true; set false here or on a package to allow API-token publishes.

§release_workflow: String

The file under .github/workflows/ whose run publishes, which a crates.io trusted publisher entry must name for check trust to pass. crates.io matches the entry against the calling workflow that the OIDC token’s workflow_ref claim names (crates_io_trustpub/src/github/workflows.rs), so a reusable workflow it calls does not count. When omitted, it is release.yml, the caller file the template renders.

§release_checks: Vec<ReleaseCheck>

The checks release and release --dry-run run before the first write, from registry and trust. Only registry state can change between the merge and the release, so the checks that prove anything else run before the merge and are not listed here. trust runs only when VERCTL_OWNER_TOKEN contains an owner’s token, and is reported as skipped otherwise. When omitted, it is [registry, trust]; [] runs no check.

§publishers: BTreeMap<String, PublisherSpec>

Publish recipes by name, for a package’s publisher to select.

§runners: BTreeMap<String, Runner>

Machines, declared once and named. Entirely repo-owned: verctl ships no built-in names.

§assets: Option<Assets>

Release tarball recipe. Omit for libraries.

§packslip: Option<Packslip>

The packslip the Release carries. When it is set, the Release that carries the tarballs also carries packslip.sigstore.json, signed by the release workflow. {} signs a packslip that lists assets.bin and attests the tarballs. Omit to publish no packslip.

§vendored: BTreeMap<String, Vendored>

Asset sets built from someone else’s source at its own version, by name. Omit when the repo vendors nothing.

§ci: BTreeMap<String, Job>

PR and push validation. Empty means one verify on ubuntu-26.04.

§prepare: Prepare

Work done after the version bumps.

§proposal: Proposal

The Version PR’s title and commit message. Omit for chore(release): version packages as both.

§changelog: Changelog

Whose names changelog entries never credit. Omit to list no one.

§templates: Templates

Where served-file templates live. Omit for the convention.

§tags: Tags

How release tags are named. Omit for v{version}: one tag when every released package shares a version. Put {name} in the template for one tag (and one Release) per package.

§patterns: BTreeMap<String, PinPattern>

Version spellings, named once and listed by the files that carry them, so a spelling three files share is written once.

§pins: Vec<Pin>

Collocated tool pins rewritten when package is bumped.

Implementations§

Source§

impl Config

Source

pub fn load(path: &Path) -> Result<Self>

Read and validate the file at path.

This parses the schema and checks that any packslip.manifest parses as TOML. Callers inside a git checkout should use verctl_release::forge::load_config (or call Config::verify_packslip_tracked) to also verify that packslip.manifest is tracked by git.

§Errors

Returns an error when the file cannot be read, when its YAML does not match the schema, or when validation fails. Each complaint names the line it comes from.

Source

pub fn verify_packslip_tracked(&self, tracked: &[PathBuf]) -> Result<()>

Verify that packslip.manifest, when configured, is among the paths git tracks.

§Errors

Returns an error naming packslip.manifest when it is not in tracked.

Source

pub fn parse(raw: &str) -> Result<Self>

A config from text in memory, named as the file a repo writes.

§Errors

Returns an error when raw does not match the schema or fails validation, as described for Config::load.

Source

pub fn trusted_publishing_only_of(&self, package: &PackageSpec) -> bool

Whether package enforces crates.io trustpub_only: its own override, or else the top-level trusted_publishing_only setting (default true).

Source

pub fn owners_of<'a>(&'a self, package: &'a PackageSpec) -> Option<&'a [String]>

The crates.io logins package must list as owners: its own owners, or else the top-level list. None when neither is set, so the package has no owner proof.

Source

pub fn find(&self, name: &str) -> Result<&PackageSpec>

The package declared as name.

§Errors

Returns an error when no declared package has that name.

Source

pub fn driver_spec(&self, name: &str) -> Option<DriverSpec>

The spec for name: a stock driver, a declared one, or a declared one over the stock.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

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 Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Config

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 Validate for Config

Source§

type Context = Config

A user-provided context. Read more
Source§

fn validate_into( &self, config: &Self::Context, __garde_path: &mut dyn FnMut() -> Path, __garde_report: &mut Report, )

Validates Self, aggregating all validation errors into Report.
Source§

fn validate(&self) -> Result<(), Report>
where Self::Context: Default,

Validates Self, returning an Err with an aggregate of all errors if the validation failed. Read more
Source§

fn validate_with(&self, ctx: &Self::Context) -> Result<(), Report>

Validates Self, returning an Err with an aggregate of all errors if the validation failed. Read more

Auto Trait Implementations§

§

impl Forget for Config

§

impl Freeze for Config

§

impl Move for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config
where NodeRef<Owned, String, DriverSpec, LeafOrInternal>: Send, BoxRaw<(String, DriverSpec)>: Send, RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send, NodeRef<Owned, String, IgnoredAny, LeafOrInternal>: Send, BoxRaw<(String, IgnoredAny)>: Send, NodeRef<Owned, String, PublisherSpec, LeafOrInternal>: Send, BoxRaw<(String, PublisherSpec)>: Send, NodeRef<Owned, String, Runner, LeafOrInternal>: Send, BoxRaw<(String, Runner)>: Send, NodeRef<Owned, String, AssetTarget, LeafOrInternal>: Send, BoxRaw<(String, AssetTarget)>: Send, NodeRef<Owned, String, Vendored, LeafOrInternal>: Send, BoxRaw<(String, Vendored)>: Send, NodeRef<Owned, String, Job, LeafOrInternal>: Send, BoxRaw<(String, Job)>: Send, NodeRef<Owned, String, PinPattern, LeafOrInternal>: Send, BoxRaw<(String, PinPattern)>: Send,

§

impl Sync for Config
where NodeRef<Owned, String, DriverSpec, LeafOrInternal>: Sync, BoxRaw<(String, DriverSpec)>: Sync, RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync, NodeRef<Owned, String, IgnoredAny, LeafOrInternal>: Sync, BoxRaw<(String, IgnoredAny)>: Sync, NodeRef<Owned, String, PublisherSpec, LeafOrInternal>: Sync, BoxRaw<(String, PublisherSpec)>: Sync, NodeRef<Owned, String, Runner, LeafOrInternal>: Sync, BoxRaw<(String, Runner)>: Sync, NodeRef<Owned, String, AssetTarget, LeafOrInternal>: Sync, BoxRaw<(String, AssetTarget)>: Sync, NodeRef<Owned, String, Vendored, LeafOrInternal>: Sync, BoxRaw<(String, Vendored)>: Sync, NodeRef<Owned, String, Job, LeafOrInternal>: Sync, BoxRaw<(String, Job)>: Sync, NodeRef<Owned, String, PinPattern, LeafOrInternal>: Sync, BoxRaw<(String, PinPattern)>: Sync,

§

impl Unpin for Config
where *const LeafNode<String, DriverSpec> is !null: Unpin, Box<(String, DriverSpec)>: Unpin, *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin, *const LeafNode<String, IgnoredAny> is !null: Unpin, Box<(String, IgnoredAny)>: Unpin, *const LeafNode<String, PublisherSpec> is !null: Unpin, Box<(String, PublisherSpec)>: Unpin, *const LeafNode<String, Runner> is !null: Unpin, Box<(String, Runner)>: Unpin, *const LeafNode<String, AssetTarget> is !null: Unpin, Box<(String, AssetTarget)>: Unpin, *const LeafNode<String, Vendored> is !null: Unpin, Box<(String, Vendored)>: Unpin, *const LeafNode<String, Job> is !null: Unpin, Box<(String, Job)>: Unpin, *const LeafNode<String, PinPattern> is !null: Unpin, Box<(String, PinPattern)>: Unpin,

§

impl UnsafeUnpin for Config

§

impl UnwindSafe for Config

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.