Skip to main content

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

  1. Use Raw URLs: Always extend from the “Raw” version of a file on GitHub.
  2. Version Your Bases: Use tags or branches in your URLs (e.g., .../main/base.yaml or .../v1.0/base.yaml) to prevent breaking changes.
  3. Keep Repositories Local: Don’t put the repositories list in the base config unless you want every repo to monitor every other repo (Pattern B).
  4. Environment Variables: Use ${VAR_NAME} syntax for secrets to keep your config files secure.

Troubleshooting

  • URL Failures: Ensure the extends URL 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.