#[non_exhaustive]pub struct Config {Show 23 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 publish: PublishHooks,
pub proposal: Proposal,
pub changelog: Changelog,
pub templates: Templates,
pub tags: Tags,
pub patterns: BTreeMap<String, PinPattern>,
pub pins: Vec<Pin>,
pub steps: BTreeMap<String, StepSpec>,
pub at: AttachPoints,
pub ecosystems: BTreeMap<String, EcosystemSpec>,
}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
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: boolWhether 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: StringThe 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: PrepareWork done after the version bumps.
publish: PublishHooksCommands release runs before and after registry uploads. Omit to run
no publish hooks.
proposal: ProposalThe Version PR’s title and commit message. Omit for
chore(release): version packages as both.
changelog: ChangelogWhose names changelog entries never credit. Omit to list no one.
templates: TemplatesWhere served-file templates live. Omit for the convention.
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.
steps: BTreeMap<String, StepSpec>Named extension steps referenced from at, package block overrides,
and ecosystems. Omit when no custom steps are needed.
at: AttachPointsRun-wide lifecycle points (version, verify, released) where named
steps attach. Omit to run no run-wide steps.
ecosystems: BTreeMap<String, EcosystemSpec>Repository-declared ecosystems built from named steps for each release block. Omit when built-in ecosystems cover every package.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(path: &Path) -> Result<Self>
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.
Sourcepub fn verify_packslip_tracked(&self, tracked: &[PathBuf]) -> Result<()>
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.
Sourcepub fn parse(raw: &str) -> Result<Self>
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.
Sourcepub fn trusted_publishing_only_of(&self, package: &PackageSpec) -> bool
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).
Sourcepub fn owners_of<'a>(&'a self, package: &'a PackageSpec) -> Option<&'a [String]>
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.
Sourcepub fn find(&self, name: &str) -> Result<&PackageSpec>
pub fn find(&self, name: &str) -> Result<&PackageSpec>
Sourcepub fn driver_spec(&self, name: &str) -> Option<DriverSpec>
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<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Source§impl Validate for Config
impl Validate for Config
Source§fn validate_into(
&self,
config: &Self::Context,
__garde_path: &mut dyn FnMut() -> Path,
__garde_report: &mut Report,
)
fn validate_into( &self, config: &Self::Context, __garde_path: &mut dyn FnMut() -> Path, __garde_report: &mut Report, )
Self, aggregating all validation errors into Report.