Modular Configuration
Learn how to build a scalable configuration system for Simili Bot using modular pieces and inheritance.The extends Keyword
The core of modular configuration is the extends keyword. It allows one configuration file to inherit settings from another, typically hosted at a remote URL (like GitHub).
Pattern: Shared Defaults
Create a single source of truth for your organization’s Simili Bot policies.1. Create Base Config (org-base.yaml)
2. Use in Repositories
Each repository only needs to specify itself:Pattern: Environment Overrides
Manage different settings for staging and production environments.base-staging.yaml
base-prod.yaml
Pattern: Team-Specific Overrides
Allow teams to define their own routing rules while sharing infrastructure settings.team-mobile.yaml
Best Practices
- Use Raw URLs: Always extend from the “Raw” version of a file on GitHub.
- Version Your Bases: Use tags or branches in your URLs (e.g.,
.../main/base.yamlor.../v1.0/base.yaml) to prevent breaking changes. - Keep Repositories Local: Don’t put the
repositorieslist in the base config unless you want every repo to monitor every other repo (Pattern B). - Environment Variables: Use
${VAR_NAME}syntax for secrets to keep your config files secure.
Troubleshooting
- URL Failures: Ensure the
extendsURL is publicly accessible or accessible to the machine running the bot. - Merge Order: Local settings ALWAYS override extended settings.
- Circular References: Avoid extending a file that eventually extends back to the current file.
Configuration Inheritance Guide
Deep dive into technical merge rules and multi-level inheritance.