Skip to main content

Module caproni

Module caproni 

Source
Expand description

Port of internal/config/caproni.go: the top-level config loader (LoadCaproniConfig), schema compilation, and the variable-expansion / literal-field guards it orchestrates.

extends: composition supports both local (same-filesystem) and https:// remote fragments (see merge.rs’s module doc comment for the RemoteFetcher design), and caproni-project.yaml per-repository fragment application (applyCaproniProject, in merge.rs) is fully ported. The one remaining documented gap is compile_schema_lazy_loading (#[ignore]d below): the Go original’s sync.Once-cached schema pointer-identity assertion has no equivalent here, since this port compiles the schema fresh per call rather than caching it — see validate_schema_v2’s doc comment.

Functions§

apply_version_defaults
Populates runtime fields on the config from CI version variables.
load_caproni_config
Loads and parses the caproni.yaml configuration file. Returns a v2 CaproniConfig regardless of input version. Remote (https://) extends: fragments are fetched with a fresh super::merge::UreqFetcher; use load_caproni_config_with_fetcher to inject a different one (e.g. a wiremock-backed test double — see merge.rs’s module doc comment).
load_caproni_config_with_fetcher
Port of the private loadCaproniConfig(ctx, gc, httpClient, cache): the full loader, parameterized over the super::merge::RemoteFetcher used for extends: remote fragments and downloaded deployer files.
load_from_context
Gets the global config from the context and loads the config instance from it using load_caproni_config.
skip_variable_expansion
Reports whether path (dotted segments from the config root) points at a value whose variable references must survive expansion verbatim (a literal cluster field, or a mirror filesystem regex field).