Skip to main content

Configuration Inheritance

Use configuration inheritance to share settings across projects while allowing per-project customization.

Overview

Without Inheritance (Duplicate Config):
With Inheritance (DRY):

How it works

  1. Parent Config - Stored in shared repository
  2. Child Config - References parent via extends
  3. Fetch & Merge - Child fetches parent, merges settings
  4. Override - Child settings override parent

Setup

1. Create base configuration

In company/policies repository:

2. Create child configurations

In individual repositories: backend/.github/simili.yaml:
frontend/.github/simili.yaml:

Merging rules

When child extends parent:
  1. Parent loaded and parsed
  2. Child loaded and parsed
  3. Child values override parent
  4. Arrays are replaced (not merged)
Example:

Use cases

Organization-wide defaults

Parent handles organization policies:
Child customizes per repository:

Multiple inheritance levels

Three levels:
  1. Organization defaults
  2. Team customizations
  3. Repository specifics

Staged rollouts

Base (stable):
Staging (testing):
Production (when stable): Update base.yaml, all inherit

Best practices

1. Keep base minimal

Base should have:
  • Common credentials setup
  • Organization-wide policies
  • Standard library versions
Avoid:
  • Repository-specific rules
  • Per-team exceptions
  • Implementation details

2. Use raw GitHub URLs

Always use raw content URLs:
Not:

3. Version your configs

Tag base configurations:
Allows:
  • Safe updates to old configs
  • Gradual migration to new versions
  • A/B testing configurations

4. Document inheritance

Add comments in child config:

Troubleshooting

Configuration not found

Error: Failed to fetch extends URL Solutions:
  • Verify URL is correct and accessible
  • Check GitHub repository is public
  • Use raw content URL, not web UI URL
  • Verify base configuration file exists

Merge conflicts

Issue: Child and parent have incompatible settings Solution: Explicitly override in child

Circular dependencies

Error: Config extends itself (directly or indirectly) Solution: Check inheritance chain

Performance

Fetch time

  • First fetch: 100-500ms (network)
  • Cached: <10ms
  • No real-world impact on processing

Size limits

  • No hard limit on config size
  • Typical: <10KB
  • Can handle 100+ repositories

Migration path

Step 1: Create Base
  • Extract common config to repository
  • Store in company/policies
Step 2: Add extends
  • Update individual repos to extend base
  • Keep all settings same (no breaking changes)
Step 3: Remove Duplication
  • Move common parts to base
  • Keep only repo-specific in child
Step 4: Maintain Centrally
  • Update base when needed
  • All repos automatically use new config
  • Gradual rollout possible with versions

Real-world example

Easy to update organization-wide settings while keeping repo-specific rules!

Next steps

Patterns overview

Manage multiple repositories

Configuration overview

View all configuration options