app.source_config¶
Validation of the sources section of catalog.yaml.
Part of the configuration loader (app.catalog_config, which
re-exports the public names). Common registration fields are validated
here; type-specific settings are handed to the source type registry
(app.sources.registry). Push tokens are resolved from env var
names and kept as pydantic.SecretStr; the stored config is
secret-free (secret-looking keys are redacted defensively).
Public API: NonEmptyStr, ConfigProblem,
ConfigContext, SourceRegistration,
parse_sources().
- type app.source_config.NonEmptyStr = Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)]¶
A string that is not blank (surrounding whitespace stripped).
- class app.source_config.ConfigProblem(severity, location, message)¶
Bases:
objectOne configuration finding.
- Parameters:
- class app.source_config.SourceRegistration(*, id, type, position, config, enabled, config_error=None, config_error_code=None, path='doc/decisions', published_ref='', intake=frozenset({}), push_tokens=(), binding=None, warnings=())¶
Bases:
objectOne configured source registration.
- Parameters:
id (
str) – Stable registration id.type (
str) – Source type name.position (
int) – Index in the configuration (ownership order).config (
JsonObject) – Non-secret settings as stored in the database.enabled (
bool) –Falsewhen the entry is invalid.config_error_code (
ConfigErrorCode|None) – Stable code of config_error.path (
str) – ADR path inside each project.published_ref (
str) – Configured published ref.intake (
frozenset[IntakeKind]) – Enabled intake mechanisms.push_tokens (
tuple[SecretStr,...]) – Resolved CI push tokens (never logged).binding (
SourceBinding|None) – Adapter factory;Nonewhen disabled.warnings (
tuple[str,...]) – Non-fatal findings for this registration.
- config: JsonObject¶
- config_error_code: ConfigErrorCode | None¶
- intake: frozenset[IntakeKind]¶
- binding: SourceBinding | None¶
- property pollable: bool¶
Tell whether polling may run for this registration.
- Returns:
Trueif enabled withpollintake.
- to_storage()¶
Convert to the value synced into
source_registration.- Return type:
- Returns:
The registration config (no secrets).
- class app.source_config.ConfigContext(env, registry, base_dir, problems=list())¶
Bases:
objectShared state while parsing one file.
- Parameters:
env (
Mapping[str,str]) – Environment used to resolve secret env var names.registry (
SourceTypeRegistry) – Source type registry.base_dir (
Path) – Directory for relative paths in source settings.problems (
list[ConfigProblem]) – Findings collected so far.
- registry: SourceTypeRegistry¶
- problems: list[ConfigProblem]¶
- error(location, message)¶
Record an error.
- app.source_config.parse_sources(raw, ctx)¶
Validate the
sourcessection.Entries without a usable or with a duplicate
idare reported and skipped; invalid entries become disabled registrations.- Parameters:
raw (
object) – Raw section value.ctx (
ConfigContext) – Parse context.
- Return type:
- Returns:
Registrations in file order.