Knowledge
Knowledge
Understand the service components, execution stages and Python modules before changing infrahub-sync. Start with the architecture for a registered run or the repository tour for a module to edit. For development rules see Guidelines; for step-by-step procedures see Guides.
Orientation
- Sync architecture — service components, the registered-run lifecycle, durable records and deployment limits.
- Repository tour — the modules for CLI requests, service execution, plans, storage and adapters, with a trace from the HTTP client to worker operations.
Adapters
- Adapter anatomy — the two classes every adapter provides, the
DiffSyncMixin/DiffSyncModelMixincontract, and what you implement versus what you get for free. - Schema mapping — how
config.ymlmaps source resources to destination models: fields, identifiers, references, filters, and transforms. - Incremental sync and cache — cursors, tiers, plans, and row-count guardrails, and what an adapter implements to participate.
Plans and applying them
- The saved plan artifact — the manifest and operations a run records before it writes: layout, canonical encoding, operation identifiers, the checksum, and how a stored plan is read and verified.
- Planned writes and apply — the destination write surface for saved operations, apply-time peer resolution, replace-set semantics, and why recorded deletes are not executed.
- The configuration write guard — the PostgreSQL session advisory lock that serializes one configuration's writes across processes: its direct-connection requirement, key derivation, deadline bounds, ownership proof, and failure sanitizing.
Configuration and execution
- Configuration foundation — declared package identity, runtime credential references, and the connection-free adapter capability declaration.
- The shared execution surface — service and direct Python callers, plan/verify/apply inputs and return types, failure handling and filesystem locks.
- Prefect orchestration — registered service execution and direct read-only planning, with their inputs, results and optional dependencies.
Repository workflow
- Quality gates — what
invoke lintandinvoke formatactually run, the inherited pylint baseline, and how to measure a no-regression claim. - Testing tiers — which test command covers which tier, what each one needs, and what a skip means.
Related
- Guidelines — rules that apply to this code.
- Guides — adding and testing an adapter.
- Decision records — why the architecture is shaped the way it is.
- Constitution — project principles these documents serve.