Principle:173TECH Sayn Project Configuration
| Knowledge Sources | |
|---|---|
| Domains | Software_Engineering, Configuration_Management |
| Last Updated | 2026-10-17 00:00 GMT |
Overview
Pattern for defining and validating project-level configuration through declarative YAML files with schema enforcement and credential scoping.
Description
Project configuration is the practice of specifying a project's structural requirements — required credentials, default database, task groups, naming conventions, and parameters — in a declarative configuration file. The configuration is validated against a schema at load time, ensuring that invalid configurations fail early with clear error messages. This approach solves the problem of distributed, implicit configuration by centralizing it into a single source of truth that is both human-readable and machine-validatable.
Key aspects include:
- Schema validation: Configuration is validated via pydantic models with strict field rules
- Credential scoping: Required credentials are declared upfront, ensuring all databases are configured
- Default resolution: Sensible defaults (e.g., single credential becomes default_db) reduce boilerplate
- Naming rules: Prefix/suffix/override settings for database objects are defined at project level as production defaults
Usage
Use this principle when designing data processing frameworks that need a structured, validated project configuration. It is the right choice when configuration must be validated before any execution begins and when multiple environments (dev/prod) share a common project structure.
Theoretical Basis
The configuration validation pattern operates in three phases:
- Parsing: YAML content is read into a Python dictionary
- Validation: The dictionary is passed to a pydantic model that enforces:
- Required fields are present
- Field types are correct
- Cross-field validators (e.g.,
default_dbmust be inrequired_credentials) - Extra fields are forbidden (fail-fast on typos)
- Resolution: Defaults are applied (e.g., single credential auto-becomes
default_db)
The preset system forms a DAG: presets can reference other presets, and the resolution uses topological sort to merge configurations in dependency order.
Practical Guide
A project.yaml file defines:
required_credentials:
- warehouse
- api_db
default_db: warehouse
parameters:
start_date: "2024-01-01"
presets:
incremental:
materialisation: incremental
groups:
sql_models:
type: sql
file_name: "*.sql"
materialisation: table