Turn on inheritance
- In the app
- YAML
Open the repositoryâs settings, go to the General section, and turn on Inheritance. Repository settings take part only while the repositoryâs Use organization settings toggle is off.
inheritance is a top-level key in both configuration schema V2 and V3. A .coderabbit.config.ts file uses the same key.
When inheritance applies
The inheritance walk runs when any of these is true:- The starting layer sets
inheritance: true. - The starting layer leaves
inheritanceblank and Use workspace settings as defaults is on. - An organization or workspace global override sets
inheritance: true. This beats every layerâs own flag. A workspace overrideâsinheritancevalue wins over the organizationâs. When an organization has Use workspace settings on, its organization overrides are ignored. See Enforce settings.
How the inheritance walk works
The walk follows a fixed order below the starting layer: central configuration, then Repository settings, Organization defaults and workspace settings, then schema defaults. On self-hosted CodeRabbit,YAML_CONFIG takes the place of the web interface layers. CodeRabbit merges each parent it finds. It stops after a parent whose inheritance is false, or blank while Use workspace settings as defaults is off. When a global override sets inheritance: true, the walk doesnât stop and merges every layer. Missing layers are skipped.
In this example the review gets values from the repository file, the central file and Organization defaults. Workspace settings arenât merged because Organization defaults has inheritance off.
Parents for each starting layer
A parent takes part only when it exists for the repository:
- Repository settings, while the repositoryâs Use organization settings toggle is off.
- Organization defaults, when the organization has saved settings and Use workspace settings is off.
- Workspace settings, when the organization belongs to a workspace.
YAML_CONFIG, and a central file can merge YAML_CONFIG. Schema defaults fill whatever is still unset after the walk.
Why saved Repository settings can hide organization values
A form save in the web interface stores every value, including defaults you didnât change and the Inheritance toggle itself. When the walk reaches Repository settings saved this way, every value is already set, so Organization defaults and workspace settings canât change any single value below them. Only lists still combine. If Inheritance was off when you saved, the walk also stops there. To let organization values through, save Repository settings from the YAML editor view mode, which stores only the values you wrote, or turn on the repositoryâs Use organization settings toggle. See Settings in the web app.How values merge
Arrays of objects are matched by the first of these fields they have:
path, label, name, id, key, repository. Entries without any of them are matched by their whole content. For path_instructions, every inherited rule whose path the child doesnât redefine is kept.
Directory documents combine as whole documents. For each changed file, documents from the repository root and every enclosing .coderabbit/ directory apply, and the closest document with the same kind and ID replaces the one above it.
Example: merge a repository file with central configuration
The repository file turns on inheritance. The central file leavesinheritance blank, so the walk merges central configuration and stops there.
- Central
- Repository
- Result
.coderabbit.yaml in the coderabbit repository
Whatâs next
Global overrides
Enforce settings on top of every repository and force inheritance everywhere.
Workspace settings
Share a baseline across organizations and fill unset values.
Apply settings to every repository
Combine central configuration and inheritance for an organization-wide baseline.