Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:173TECH Sayn Project Configuration

From Leeroopedia
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:

  1. Parsing: YAML content is read into a Python dictionary
  2. 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_db must be in required_credentials)
    • Extra fields are forbidden (fail-fast on typos)
  3. 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

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment