Configuration Inheritance
Use configuration inheritance to share settings across projects while allowing per-project customization.Overview
Without Inheritance (Duplicate Config):How it works
- Parent Config - Stored in shared repository
- Child Config - References parent via
extends - Fetch & Merge - Child fetches parent, merges settings
- Override - Child settings override parent
Setup
1. Create base configuration
Incompany/policies repository:
2. Create child configurations
In individual repositories: backend/.github/simili.yaml:Merging rules
When child extends parent:- Parent loaded and parsed
- Child loaded and parsed
- Child values override parent
- Arrays are replaced (not merged)
Use cases
Organization-wide defaults
Parent handles organization policies:Multiple inheritance levels
- Organization defaults
- Team customizations
- Repository specifics
Staged rollouts
Base (stable):Best practices
1. Keep base minimal
Base should have:- Common credentials setup
- Organization-wide policies
- Standard library versions
- Repository-specific rules
- Per-team exceptions
- Implementation details
2. Use raw GitHub URLs
Always use raw content URLs:3. Version your configs
Tag base configurations:- 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 childCircular dependencies
Error: Config extends itself (directly or indirectly) Solution: Check inheritance chainPerformance
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
extends
- Update individual repos to extend base
- Keep all settings same (no breaking changes)
- Move common parts to base
- Keep only repo-specific in child
- Update base when needed
- All repos automatically use new config
- Gradual rollout possible with versions