Configuration inheritance allows you to share common settings across repositories while still allowing individual repositories to customize specific values. When enabled, CodeRabbit merges configuration from parent levels instead of using only the highest-priority source.Documentation Index
Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
Use this file to discover all available pages before exploring further.
Inheritance is disabled by default. You must explicitly enable it by
adding
inheritance: true to your configuration file.Enabling inheritance
Addinheritance: true at the root level of your .coderabbit.yaml file:
- CodeRabbit merges values from the parent configuration level
- If the parent also has
inheritance: true, the chain continues to the grandparent level - The chain stops at the first level where
inheritance:falseor not set
Configuration hierarchy
CodeRabbit resolves configuration from multiple levels. Without inheritance, only the highest-priority source is used. With inheritance enabled, values merge across levels.Cloud/SaaS deployment
| Priority | Source | Location |
|---|---|---|
| 0 (Highest) | Global overrides | CodeRabbit UI - Organization Settings - Global Overrides |
| 1 | Repository YAML | .coderabbit.yaml in the repository |
| 2 | Central YAML | .coderabbit.yaml in coderabbit repository |
| 3 | Repository UI | CodeRabbit UI - Repository Settings |
| 4 | Organization UI | CodeRabbit UI - Organization Settings |
| 5 (Lowest) | Defaults | CodeRabbit schema defaults |
Self-hosted deployment
| Priority | Source | Location |
|---|---|---|
| 1 (Highest) | Repository YAML | .coderabbit.yaml in the repository |
| 2 | Central YAML | .coderabbit.yaml in coderabbit repository |
| 3 | Environment YAML | YAML_CONFIG environment variable |
| 4 (Lowest) | Defaults | CodeRabbit schema defaults |
How inheritance works
When you enable inheritance, CodeRabbit walks up the configuration hierarchy and merges values. The merge behavior depends on the data type.How the inheritance chain works
- Each level with
inheritance: truemerges with its parent - The chain stops at the first level where
inheritance:falseor unset - Missing configuration levels are skipped automatically
Merge behavior by type
| Type | Behavior |
|---|---|
| Objects | Deep merge - child properties override parent properties at each nesting level |
| Arrays | Child items first, then unique parent items appended (deduplicated by path, label, name, id, or key) |
| Scalars | Simple override - child value wins when defined |
Example
This example demonstrates all three merge behaviors. Repository configuration (.coderabbit.yaml):
coderabbit/.coderabbit.yaml):
The
src/** path instruction from central is excluded because the repository
already defines the same path. Arrays deduplicate using the first available
stable key: path, label, name, id, or key.Common use cases
Organization-wide defaults
Set up common settings in your centralcoderabbit repository, then enable inheritance in individual repositories to use those defaults while customizing specific values.
Central configuration (organization/coderabbit/.coderabbit.yaml):
organization/my-repo/.coderabbit.yaml):
Team-specific configurations (GitLab)
GitLabโs nested group structure allows team-specific configurations. Each team can have their owncoderabbit repository with settings that inherit from parent groups.
Related topics
- YAML configuration - Configuration file reference
- Central configuration - Set up organization-wide configuration
- Repository settings - Configuring individual repositories
- Organization settings - Managing organization-level settings